Every dog has a blog!
[ start | index | login or register ]
Next Page
Thursday, 05. January 2012

Prepaid Discount UMTS in Österreich am Arlberg (Lech)

Da ich selbst im Urlaub gerne mit mobilem Internet versorgt bin, habe ich mir in bei "Aldi/Hofer" Supermarkt in Österreich eine mobile UMTS Internet SIM für 10 Euro geholt. Im Paket ist 1GB Traffic enthalten.

Leider habe ich im Voraus nicht herausbekommen, wie gut die Netzabdeckung am von YESSS Arlberg ist. Die Eigenmarke für Mobilfunkprodukte bei Hofer heißt "YESSS!", der dahinterstehende Carrier ist Orange.ch.

Ich kann hier nur berichten, dass ich auf der Zugfahrt zum Arlberg recht guten Empfang hatte, in Oberlech selbst hatte ich nur Verbindungen mit GRPS, also 64 KBit/s - aber besser als Nichts :/

Lang lebe die ssh shell ;)

no comments | post comment

Wednesday, 06. July 2011

How to Reboot a Draytek Router from remote with a perl-script

Probably due a complex setup and a slightly buggy firmware the VPN of my Draytek Vigor Router 2950 stops working from time to time. The only way to make it run again is a reboot.

As a workaround I created a perl-script to reboot the boxen from remote and added the reboot to the crontab of my linux server in the secure zone (telnet, unencrypted!). Now that the Vigor is rebooted every night, the VPN lockups don't occur anymore.

#!/usr/bin/perl

use Net::Telnet;

$telnet = new Net::Telnet ( Timeout=>10, Errmode=>'die', Host=>'**INSERTYOURHOSTIP**', Port=>'**INSERTPORTFORTELNET**', Prompt=>'/> $/'); $telnet->open(); $telnet->waitfor('/Password: $/i'); $telnet->print('**INSERTYOURPASSWORDHERE**'); print $telnet->cmd('sys reboot');

Of course you need Net::Telnet (from CPAN or your distribution).

no comments | post comment

Tuesday, 03. May 2011

How to get the pathes and names of blockdevices (vbd) in XEN

I always wondered how the block device (vdb) management is done in XEN for domUs without restarting the domU. After I discovered "xm block-attach" to attach ISO-Images or LVMs on the fly, I looked for a way to check which vbds are already attachmed to a domU. As there is no single command to do that, I created a script called "/usr/local/sbin/xenstore-vbdresolve" to do that lookup:

#!/bin/sh

if [ -n "$1" ]; then DOMUID=$(xm domid $1) else echo "usage: $0 <xendomain>" exit 1 fi

for i in $(xenstore-list /local/domain/${DOMUID}/device/vbd); do

TEMPPATH=$(xenstore-read /local/domain/${DOMUID}/device/vbd/$i/backend); echo -n "$(xenstore-read ${TEMPPATH}/dev): " xenstore-read ${TEMPPATH}/params ;

done

It will deliver an output such like this example:

# xenstore-vbdresolve mydomu hda: /dev/vg2/mydomu-raw hdc: /install/myisoimage.iso
no comments | post comment

Wednesday, 23. June 2010

Extent Badboy to write a CSV-Logfile by using a JScript Tool Element

From time to I use tool "Badboy" from Simon Sadedin to create functional tests for websites or web-based applications. Now I needed to extend the tests for logging the runtime of certain steps and the whole test, but the Badboy Tool doesn't offer such a counter out of the box. To I created some lines of JavaScript that can be used in Badboy via the the "JScript" tool element to log into a csv-file, which can be processed in Excel or Openoffice later on.

Instructions to setup

  1. Create a variable called "logfile" and set it's value to the name of the desired logfile, e.g. mylogfile.csv. (You can also define it with a path like "c:
    myfile.csv")
  2. Create a test file called "logentry.js" and place it in the same directory as your test. The content of the file is the script shown at the end of this blog entry.
  3. Add a "JScript Tool" to your testplan at the points where you want to write a timestamp into the logfile, select checkbox "Allow Access to Plugin Priviliges" and set the source to to the formerly created "logentry.js" file. (You can reference the script file with absolute or relative pathes. If you go for relative ones, the whole test can be simply transferred to other machines)
That's it! You can copy that element to all that points in your test, where you want to log a line. The logline will contain the host-Variable as well as the parent steps name and the name you gave to the JSctipt tool element.

The Code:

var datumzeit = new Date(); var stepname = badboy.script.find(badboy.current).parent.get('name'); var value = '"' + badboy.getVariable('host') + '","' + stepname + '","' + badboy.script.find(badboy.current).get('name') + '","' + datumzeit.toUTCString() + '","' + datumzeit.getTime() + '"' + " rn"; var fso = badboy.plugin.createObject("Scripting.FileSystemObject"); var textFile = fso.OpenTextFile( badboy.getVariable('logfile') + '-' + badboy.getVariable('host') + '.csv', 8, true); textFile.Write (value); textFile.Close();

one comment (by bryanfurry) | post comment

Saturday, 02. January 2010

Context Menu (ServiceMenu) in KDE4 for "Send as e-mail"

Quite often I send multiple files via e-mail. My Desktop is driven by KDE4 and I use Icedove (Thunderbird) as Mail-Client. Sadly in KDE4 there is no context menu in the file-manager (dolphin / konqueror) that give the functionality to create archive of multiple files on the fly and send the achive as e-mail.

So I created a KDE4 ServiceMenu file in /usr/share/kde4/services/ServiceMenus/sendwithicedove.desktop

[Desktop Entry] Type=Service ServiceTypes=KonqPopupMenu/Plugin,all/allfiles,inode/directory ExcludeServiceTypes=kdedevice/* Encoding=UTF-8 Actions=sendwithicedove;sendtargzwithicedove;sendzipwithicedove;

[Desktop Action sendwithicedove] Exec=icedove -compose "$( echo -ne "subject=Attachments,body=Files:n"; for i in $(echo %F); do echo ' '$(basename ${i}); done; echo -n ",attachment='"; for j in $(echo %F); do echo -n file://${j},; done; echo "'";)" Icon=icedove Name=Send as E-Mail Attachment (Icedove) Name[de]=Als Anhang per E-Mail senden (Icedove)

[Desktop Action sendtargzwithicedove] Exec=icedove -compose "$( echo -en "subject=tar.gz-file: archive.tar.gz,body=Content:n"; for i in $(echo %F); do echo ' '$(basename ${i}); done; mytmpdir=$(mktemp -d --tmpdir sendtargzwithicedove-XXXXXXXXXXXX); tar czf ${mytmpdir}/archive.tar.gz --transform='s#^.*/##' %F 2> /dev/null; echo -n ',attachment=file://'${mytmpdir}'/archive.tar.gz'; )" Icon=icedove Name=Send as tar.gz Attachment E-Mail (Icedove) Name[de]=Als tar.gz-Anhang per E-Mail senden (Icedove)

[Desktop Action sendzipwithicedove] Exec=icedove -compose "$( echo -en "subject=zip-file: archive.zip,body=Content:n"; for i in $(echo %F); do echo ' '$(basename ${i}); done; mytmpdir=$(mktemp -d --tmpdir sendzipwithicedove-XXXXXXXXXXXX); zip -9qjr ${mytmpdir}/archive.zip %F 2> /dev/null; echo -n ',attachment=file://'${mytmpdir}'/archive.zip'; )" Icon=icedove Name=Send as zip Attachment E-Mail (Icedove) Name[de]=Als zip-Anhang per E-Mail senden (Icedove)

(If you are using Thunderbird, then you must replace icedove with thunderbird manually)

It provides there menuitems the dolphins and konquerors context (right-click) menu:

  • Send as E-Mail Attachment (Icedove)
  • Send as tar.gz Attachment E-Mail (Icedove)
  • Send as zip Attachment E-Mail (Icedove)
The script has some disadvantages:
  • It doesn't clean up the /tmp directory: It can't to, becuase the archive must say there until the user really send the e-mail.
  • It does store directories recursively, but the file-list in the e-mail body only list the directory and not the files within (Hereby I define this as feature :-))
no comments | post comment

Wednesday, 30. December 2009

JQuery Boxy Plugin with Iframe Content

Today I was struggling with a lightbox-alike feature for a customer's intranet-website. I chose the boxy-plugin for JQuery, because JQuery itself was already used on that particular site, so I kept the library-overhead at a minimum.

The problem was, that a "boxed overlay" ("boxy") consists only of a basic <DIV>. There were no scrollbars inside the boxy and the overlay didn't work as expected in IE6, as it was not able to hide <SELECT> elements under it (in newer browsers it worked fine, though).

I decided to embed an <iframe> into the boxy's content as a solution to both problems mentioned above. This works like this:

[...] <script type="text/javascript"> function showboxy(myactuator) { mycontent='<iframe border=0 src="mycontentfortheiframe.php">You need a Browser which can display iframes</iframe>'; new Boxy( mycontent, { unloadOnHide: true, draggable: false, show: true, modal: true, title: "Replaceme!", closeText:"[ Close ]", actuator: $('#'+myactuator)[0]} ); } </script> [...] <a id="boxyfoo" title="tutorial" onclick="showboxy('boxyfoo');" href="#" style="visibility:hidden; text-decoration: none;"> <button type="button" >Click here to boxy!</button> [...]

The tricky part is to access the boxy's properties from _within_ the iframe. You need to access the DOM element the boxy is linked to on the main page, not on the iframe:

window.parent.Boxy.linkedTo( window.parent.$('#boxyfoo')[0]).setTitle('I am replaced');
(This example replaces the boxy window's title from within the iframe).
no comments | post comment

Monday, 21. December 2009

WiFi-/WLAN-Authentication at T-Mobile Hotspots (ICE Train)

At the moment I take the ICE train of Deutsche Bahn twice a week. The particular train does offer Internet-Connection in cooperation with T-Mobile. The authentication is done via a captive portal and one needs a T-Mobile Hotspot Account, which is part of many Deutsche Telekom and T-Mobile products. The usability of the captive portal sucks a little, as the browser does not save your credentials. So I captured the https-communication via Firefox liveheaders extension, extracted what's needed for authentication and wrote a little bash script to simplify the logon :-) It's free, public domain, so use it if you like. Keep in mind that the script does accept the terms of use (AGB) automatically!

Simply start it like this:

shell$ wlan-auth.sh yourlogin yourpass
If you use wicd as WiFi-Manager, you can also make the script run automatically if wicd connects to the T-Mobile_ICE Hotspot :)

And here is the wlan-auth.sh script:

#!/bin/sh HSUSER=$1 HSPASS=$2

echo "You accepted the terms of use (AGB)!";

if [ -e /tmp/tmobilehotspot-cookie ]; then rm /tmp/tmobilehotspot-cookie; fi

curl -c /tmp/tmobilehotspot-cookie \\ -F username=${HSUSER} \\ -F password=${HSPASS} \\ -F strAGB=AGB \\ -F strHinweis=Zahlungsbedingungen \\ -F x=48 \\ -F y=3 \\ >>https://hotspot.t-mobile.net/wlan/index.do

while ( true ); do curl -b /tmp/tmobilehotspot-cookie >>https://hotspot.t-mobile.net/wlan/index.do > /dev/null sleep 300 done

no comments | post comment

Monday, 11. May 2009

Quagga, Debian and SNMP-Support

Currently I try to make the Quagga Routing Daemon talk SNMP in order to monitor it's status (number of routes, changes, etc.).

It's not as straight-forward as it could be. First of all, Quagga has to be complied with the "--enable-snmp" option. Due to licensing issues with the OpenSSL library, the Debian maintainer of the quagga-package had to build the package in Debian without that option. So, the best way is to rebuild the package from Debianized sources with that option enabled.

Here is a 3-Step recipe / howto / tutorial:

Step 1: Build Quagga with --enable-snmp

# cd /usr/local/src # apt-get source quagga # apt-get build-dep quagga # apt-get install libsnmp-dev libsnmp9-dev libsnmp9 libsnmp-base debhelper dpkg-dev snmpd snmp # echo edit quagga-0.99.10/debian/quagga.preinst … remove the "grep ^smux" block at the end … # echo be sure to be in still in /usr/local/src ! # export WANT_SNMP=1 # apt-get -b source quagga
Hint: If you are on a 64-bit system, you currently need that patch additionally: >>http://lists.quagga.net/pipermail/quagga-dev/2008-December/006301.html Update: The newest release included the 64-bit fix. See changelog: smux 64-bit fix for lib/smux.h SNMP_INTEGER() macro

The is result will be a .deb paackage, e.g. quagga_0.99.10-1lenny2_amd64.deb.

# dpkg -i quagga_0.99.10-1lenny2_amd64.deb
...to install it. Quagga is now prepared to connect to snmpd via "smux". But before smux must be enabled in the snmpd.

Step 2: Prepare and configure snmpd To do so, edit /etc/default/snmpd. Remove the "-smux" option from the SNMPDOPTS line. By that way you probably want to add additional IPs snmpd should, listen on. By default it only listens to localhost, but your monitor will be probably on a different box. Then add to /etc/snmp/snmpd.conf

smuxsocket 127.0.0.1 smuxpeer .1.3.6.1.4.1.3317.1.2.1. yourpasszebra smuxpeer .1.3.6.1.4.1.3317.1.2.2. yourpassbgpd smuxpeer .1.3.6.1.4.1.3317.1.2.5. yourpassospfd

(For details about the OIDs see here: >>Quagga MIBs . Mind the dots after the OIDs! They currently do matter! )

# /etc/init.d/snmpd restart

Now prepare each of quagga's daemon to talk to snmpd's smux. (in the above example only the OIDs for zebra, bgpd, ospfd were added). vtysh does _not_ work here!

Step 3: configure Quagga

# telnet localhost 2601 Trying 127.0.0.1… Connected to localhost. Escape character is '^]'. Hello, this is Quagga (version 0.99.10). Copyright 1996-2005 Kunihiro Ishiguro, et al. User Access Verification Password: .... quagga# en quagga# conf terminal quagga(config)# smux peer 1.3.6.1.4.1.3317.1.2.1 yourpasszebra quagga# conf terminal quagga(config)# exit quagga# wr mem

Now you should set up snmpd ACLs and users as usual. Use snmpwalk to test, if you see .1.3.6.1.2.1.4.24 etc.

An example how to find out the AS number:

# snmpwalk -v 2c -c $community -O fn $ip .1.3.6.1.2.1.15.2 .1.3.6.1.2.1.15.2.0 = INTEGER: 20755
You can find more about the BGP MIB in an >>OID browser.
no comments | post comment

Monday, 13. April 2009

Augenentzündung beim Hund?

Unser neuer "Pflegi" hat einen seltsamen Ausfluss am Auge. Wahrscheinlich hat er eine leichte Entzündung, möglicherweise ist diese bakteriell bedingt. Ich behandele ihn derzeit mit Augentropfen, die durch ein enthaltendes Antibiotikum die Bakterien bekämpfen. (Danke Dr. B. aus O.! Ohne Homepage kann ich keinen Link setzen!)
Als ich das Problem festgestellt habe, konnte ich im Netz leider keine guten Bilder zu dem Thema finden, deshalb hänge ich hier welche an.
Achtung! Ich bin kein Mediziner! Dies sind alle Hinweise eines Laien! Im Zweifelsfall zum Tierarzt gehen!

no comments | post comment

Sunday, 12. April 2009

LSI RAID and Linux Support

For some time I am struggeling with LSI RAID controllers in project-based work (my own setup use Linux softraid). My Experience now convers U320-SCSI-based HBAs as well as SATA HBAs. LSI is a somewhat a de-facto standard in the server business for RAID controllers, but IMO not the best solution around. Anyway admins probably don't get around that stuff as it is included on-board in maybe systems or available as OEM ware, e.g. as DELL PERC controller. And: it's not that bad at all and at least most of their HBAs are supported by Linux and VMWare ESX. They offer several software packages for Linux. You'll find them under "downloads" on the LSI website, but at the first sight it's not quite quite what they are good for. So here in short:
  • megamon linux: This one monitors the RAID's status and writes it into a logfile. Plain text.
  • megarc linux: With this one you can control anything on the LSI via command line. Plain text/commandline tool. The README says "First version for DOS" :)
  • megamgr: This one resembles the "CTRL-M"-style BIOS. It's like curses-based or "text menu driven". With that you can mange your RAIDs menu-driven. (But no good diagnosis support, you'll need megamon for doing so)

no comments | post comment

Next Page

< June 2013 >
SunMonTueWedThuFriSat
1
2345678
9101112131415
16171819202122
23242526272829
30


Logged in Users: (0)
… and 2 Guests.

Blogrolling:
>>Blog des Wahnsinns
>>Daniel Holbach's Blog
>>Matt Cutt's blog
>>Randgruppentourismus

XHTML 1.0 validated
CSS validated
RSS 2.0 validated
RSS Feed

Hinweise zur Formatierung
snipsnap-help.

Powered by
SnipSnap 1.0b1-snipit

Ads will be placed here!

dem john sein blog | Impressum: Andreas John, Frankfurter Str. 98a, 63067 Offenbach, E-Mail: himself@derjohn.de