Tuesday, 27 October 2009

Unix myip

Always been missing a quick way (read: UNIX CLI util) of revealing the IP currently show to the global internet, which using NAT could be quite cucumbersome to find out.

The trick below will do the trick :-)


$ cat bin/myip
#!/bin/sh
if [ -n "`whereis curl`" ]; then
IP=`curl -s http://rickvanderzwet.nl/playground/ip.cgi`
else
IP=`fetch -qo - http://rickvanderzwet.nl/playground/ip.cgi`
fi

if [ -n "$IP" ]; then
HOST=`dig +short -x ${IP}`
fi
echo "$IP ($HOST)"



$ cat /var/www/playground/ip.cgi
#!/usr/bin/perl -w

print "Content-length: " . length($ENV{'REMOTE_ADDR'}) . "\n";
print "Content-type: text/html\n\n";
print $ENV{'REMOTE_ADDR'};

Sunday, 27 September 2009

Poor mans (DIY) duplex printing


Saving the environment is always a good thing. So using half the amount of paper needed by printing on two sides is in general always a good this. But as duplex feeding (two sided printing) printers are in general pretty expensive machines, we need some cheaper method to have two sided printing going.

The trick is use is very easy, but it requires some playing around to get it going nicely. You first print the odd pages in normal order. Move the printed pages from the output back into tray. Then the even pages in reverse order needs printing.

You first needs to play around with the paper a bit on how-to put the pages back properly into the input tray in order to get the 2nd output printed on the right side.

NOTE: When printing an odd number of pages in total (3,5,7,9,...). Make sure to remove the last sheet before putting the printed pages back into the printer else your pages will be miss-aligned.

For Mac users, please look at the attached picture on how-to select the proper output. Windows/Linux users, please post a link in the comments on how-to do this kind of stuff on your OS and I will include it.

Friday, 11 September 2009

Intermezzo

I started college again, after a nicely deserved holiday period. Which brings me back to a place full of engineering minded persons, leading to the somehow funny joke, shown at the picture :-).

As I am in the middle of my bachelor thesis about programming with NVDIA CUDA, posting frequencies will remain pretty low. BTW if you wanna keep track of the progress of the bachelor thesis. Visit the briareus project page (Do you like the catchy name? ;-))

Tuesday, 4 August 2009

Repairing my Black and Decker A12 battery

My mobile drilling machine gave up on me :-(. The battery simply stopped working and refusing to charge. I really loved the machine, but a new accu costed me roughly 40EUR almost the same price as a new drilling machine!

So why not DIY instead ;-). First I opened up the battery with revealed me 10 small batteries interconnected which each other. They are normal NiCd battery cells, with a base voltage of roughly 1.2V. I hooked up the multimeter and 3 individual batteries turned out to be dead.

Hunting for replacements was kind of a challenge. But 'the' wiki revealed it are type C NiCd Battery. Buying those is a bit more interesting, if you are interested in batched like 1000+ it's a easy search. But only a few is a bit more interesting. eurobatteries.com brought me to rescue. A actually had to buy 4/5 type C NiCd batteries (I love standards ;-)).

So opened the accu and soldered 3 new ones in, please mind the metal strips are very sharp!
Accu open

Assemble it all:
Protection active

And we got a working battery again :-)!
Working again!

I have to admin it the costs where roughly half the price of a new one and it requires some soldering skills (and equipment) to get it assembled, but -as always- it fun todo!

Friday, 10 July 2009

Asus Eee PC + Ubuntu Netbook Remix



I bought myself an extension for my digital mobile usage, namely the Asus EEE PC 1000HE. With some freaking long battery time (8+ hour) and very lightweight so ideal for long mobile use. Only disadvantage it came with Microsoft Windows XP by default. Nothing against Windows XP, but on a 10' screen with a very small touch-pad, it is not very effective. So the search started, with one basic goal, allowing myself to work more productive on the small machine, with full (or extended) functionality of the things I could do with Windows XP on it. So all hardware has to work well and also nice stuff like hibernation, Fn (function keys) and others. I have tried a number like EasyPasy (Ubuntu Eee), "Eee Ubuntu", the intel one. But not fitted my needs, due to various reasons like look-and-feel, support, resources.

So I came to the official newly released Ubuntu Netbook Remix Which is exactly the kind of stuff I was looking for. Looks greats and works (almost perfectly).

I have to admin some tweaks needs to be made in order to get it to work close to perfectly. But it are no show stoppers.

To get the function (Fn) keys to work properly and get some better control on stuff like power settings, follow the guide of statux.org EeePC ACPI Utilities or in short (I am more of a CLI guy)

$ sudo -s -H
$ echo "deb http://www.statux.org/ubuntu jaunty main" >> /etc/apt/sources.list
$ wget http://www.statux.org/ubuntu/key/statux.pub
$ apt-key add statux.pub
$ apt-get update
$ apt-get install eeepc-acpi-utilities eeepc-tray
$ exit


Next install a custom netbook/eeepc kernel. No details needed to post over here. Just follow the perfect guide of array.org, but to put it on one page ;-)
$ sudo -s -H
$ wget http://www.array.org/ubuntu/array-jaunty.list
$ mv -v array-jaunty.list /etc/apt/sources.list.d/
$ wget http://www.array.org/ubuntu/array-apt-key.asc
$ apt-key add array-apt-key.asc
$ apt-get update
$ apt-get install linux-netbook
$ exit


Now issue a reboot of your machine and select your new netbook kernel.

Both 2 will make your machine rock, run smoother and cooler as Windows XP, Enjoy! If you have questions or remarks, please comment I be happy to include them or answer them.

Sunday, 10 May 2009

Mooie vogel plaatjes

Voor fans van mooie shots van vogels is Flickr een waar walhalla. Hoewel je helaas ook hier het koren van het kaf moet scheiden. Een aanrader zijn de foto's die Ludovic Hirlimann fotografeert van vogels.

Als extra bonus zet hij er meestal ook de Franse en Latijnse namen bij, laat je vogel kennis spreken en zet de Nederlandse naam er eens bij :-)

Thursday, 16 April 2009

Xerox Phaser 6125N working in mac os x

The Xerox Phaser 6125N is roughly 150 EUR cheaper as it is big friend the Phaser 6130N which is 'made for the mac'. Why it needs to come that expensive I don't know, marketing is properly the buzzword. Anyways, let's check out the little friend and try to get it running on a mac anyways ;-).

First lets us find a alternative model which does have supported mac os x drivers. Our friends at OpenPrinting suggested the Fuji Xerox Docuprint 525A. Let us download the Mac OS X drivers and install them (using the regular mac os x clicks, drops).

Now add yourself the printer and make sure to select the driver yourself 'FX DocuPrint C525 A-AP v1.7' is the one you are looking for.

Now print ... ehm every piece of paper needs to inserted via the manual feeder :-(. Luckaly there is also a way to get around that PITA. Mac OS X printing is proudly powered by CUPS which allows us to select the right options.

note: don't be scared when username/password are beeing asked during setup, just provide your login credentials


  1. Goto http://localhost:631/printers/ using your favorite webbrowser and press 'Set Printer Options' on your newly created printer

  2. Head to section called 'Options Installed' and change 'Optional Tray Module' to option '250 Sheet Feeder'

  3. Click 'Set Printer Options in same section'

  4. You will see the message 'Printer example.com has been configured successfully.'

  5. Some more settings are now available, head to http://localhost:631/printers/ again, press 'Set Printer Options' on your newly created printer again.

  6. Now goto section 'Basic' and change 'Paper Source' to 'Tray 1 (250 Sheets)'

  7. Click 'Set Printer Options in same section'

  8. You will see the message 'Printer example.com has been configured successfully.' and could close the page if you like



Print again ... hoara it now feches the pages from the tray :-)
Blogged with the Flock Browser

Thursday, 2 April 2009

Filmpje pakken?

Volledige legale films met nederlandse ondertiteling. Laten we eens met een goude ouwe beginnen ;-)

<a href="http://www.joost.com/39lsidh/t/Austin-Powers-International-Man-of-Mystery">Austin Powers: International Man of Mystery</a>

Monday, 16 March 2009

apache httpd mod_autoindex 'missing' subfolder

Also getting tried when apache httpd is not showing the subfolder of a directory indexes listing (generated by mod_autoindex), when for example the permission is denied by the means of AuthBasic. Don't know where I am talking about, maybe this example makes sense:



DirectoryRoot /usr/local/www/data
Options +Indexes

<Directory "/usr/local/www/data">
Order allow,deny
Allow from all
</Directory>

<Directory "/usr/local/www/data/foo">
AuthUserFile /usr/local/www/secret/.foo-htpasswd
AuthType Basic
AuthName "Directory 'foo' not visible in indexing of /"
Require valid-user
</Directory>


AllowForbidden is the magic keyword we need to follow, as suggested at nixforums.org, join me...


A patch has been proposed and applied. And it it also in tags/3.2.1. But wait a minute ... no release scheduled yet, as 3.2.1 is a so called DOA

Anyways work in process, let there be a new release some day :-)

Friday, 13 March 2009

Hoe gebouwen gebouwd worden...


In Leiden, NL zijn ze een nieuwe ROC aan het bouwen het leuke is dat je dit op de website kan volgen. Nadeel is dat dit beeld zo saai als wat is ;-).

Gelukkig kan je met wat creatief html code kijken de live feed van de ROC Leiden nieuwbouw vinden waarbij je dus 'echt' live kan kijken en dat is natuurlijk veel leuker om te zien!

Thursday, 1 January 2009

ecards.plaxo.com expired certificate


Properly the nightmare of every webadmin, as (the new) firefox does give you all kind of nasty warning enforcing some more strict ssl policy around the net

https://ecards.plaxo.com/ecard/index.php?corpUpdate=1

But one thing more worse than the warning itself and that is their support desk. Expired certificates does not seems to appear in their drop-down problem/answer sheet, resulting in all kind of odd responses like

"Please check with a different browser and system, and also check the Cipher strength on your Internet Explorer." (running a Mac OS X)

"Sorry, Plaxo ecards link is not a secure link. It is http://ecards.plaxo.com and not https://....." (occurred on redirected from logging in, which should be hopefully be https at least)



Blogged with the Flock Browser