Monthly Archive for June, 2009

Epoch to human

How often haven’t I needed to convert a Epoch timestamp (unixtime) to Human readable format?

 

 
 

From commandline:

date -d @1000000000

(replace 1000000000 with your epoch, needs newer version of date)

For more reading, see http://www.epochconverter.com/

twitter from commandline

Here is a oneliner to submit twitter messages via curl to twitter. I found it here

curl –basic –user “yourusername:yourpasswd” –data-ascii “status=`echo $@|tr ‘ ‘ ‘+’`” “http://twitter.com/statuses/update.json” -o /dev/null; echo Message Sent!

Bash: Get latest version of iTunes

Here is a small oneliner to fetch/update the latest version of iTunes.msi AppleMobileDeviceSupport.msi QuickTime.msi and SetupAdmin.exe

wget -q -O- http://swcatalog.apple.com/content/catalogs/others/index-windows-1.sucatalog | grep "061-6666" | egrep -o "http.*\.(msi|exe)" | xargs wget -N

061-6666 is the software key for iTunes.

The -N parameter on wget will make wget only download if the file on the webserver has newer timestamp than the local file.

undefined symbol: Perl_Tstack_sp_ptr

I got this error after a upgrade of perl on my ubuntu desktop station:

rolf@untuome:~/.xmltv$ tv_grab_no_gfeed --output /home/rolf/.xmltv/tv_grab_no_gfeed.xml
/usr/bin/perl: symbol lookup error: /home/rolf/.perl/lib/perl5/i486-linux-gnu-thread-multi/auto/List/Util/Util.so: undefined symbol: Perl_Tstack_sp_ptr
rolf@untuome:~/.xmltv$ mv /home/rolf/.perl/lib/perl5/i486-linux-gnu-thread-multi /tmp
rolf@untuome:~/.xmltv$ tv_grab_no_gfeed --output /home/rolf/.xmltv/tv_grab_no_gfeed.xml
downloading listings

Oneliner: Download csv of all major IP-blocks for countries:

Oneliner to download countries in .csv files. Great for building f.ex firewall (iptables?) rules with special rules for countries:

for a in `wget -q -O- http://nirsoft.net/countryip/ |egrep -o "\"..\.html" |sed -e s/^\"// -e s/\.html//` ; do wget http://nirsoft.net/countryip/$a.csv ; done

Synergy over sshtunnel

A ssh tunnel will slow down the mouse pointer which can result in a slow response on the client machine. But it will encrypt and secure the input information like your passwords typed on the keyboard. Synergy sends these unencrypted over the network.

Here is how to do it:

On the machine you are using(typing on), run synergy bound to the lo (localhost) interface. Synergys will act as a keyboard and mouse server for the machines you want to control. Do it like this:

synergys -a localhost

Remember that you need to have a /etc/synergy.conf for synergys: On the machine you using(typing on). There you need to specify that SynclientName has access to connect to you.

Then, start the ssh port-tunnel by forwarding port 24800 on localhost yourmachine connecting to it’s own localhost on port 24800:

ssh -R localhost:24800:localhost:24800 yourmachine

Start the synergy client on the machine you want to remotely control and connecting it to localhost (which is ssh-tunneled to yourmachine)

DISPLAY=:0 sudo synergyc -n SynclientName localhost

This was only a small howto on connecting two linux machines with synergy.

How to download over 6000 Free True Type fonts?

A small script to download over 6000 free TrueType Fonts from a webpage.
This script should be for learning purpose only. Removing XX makes you guilty!
Continue reading ‘How to download over 6000 Free True Type fonts?’