piyo's computer tips
starting syslog on Cygwin
CygwinLots of software use syslog, I think... Like tftpd! To get started with syslog, run the syslogd-config command when you have installed inetutils-1.3.2. Then run net start syslog!
Devfs in Gentoo, fighting Subversion on Colinux 0.6.1
Gentoo, Subversion, ColinuxWhat I want to do is to be able to use Subversion without those stupid hangs for /dev/random input. Usually you can workaround this by linking /dev/random to /dev/urandom. However, the current
gentoo uses devfs, and I can't figure how to do exactly that.
Edit:
Gentoo can be configured to use either devfs, udev, or a static /dev. Set
RC_DEVICES="static" in the
/etc/conf.d/rc file. This is drastic, right?
curl & cookies
curl, webdevcurl allows you to automate the registration of web forms and cookies. A quick example with bloglines:
Create a cookie jar file of a bloglines login
curl http://www.bloglines.com/login --form "email=${email}" --form "password=${password}" --cookie-jar ${cookieJarFile}
Then use that cookie jar file to export your subscription
curl http://www.bloglines.com/login?r=/export --data "email=${email}&password=${password}&r=/export&Sign%20In=Log%20In" --cookie-jar ${cookieJarFile} --location > ${outputSubscriptionFile}
%q & %w
Ruby%q gives you the quotes:
irb(main):001:0>
p %q( a b c )" a b c "=>
nilWhile %w gives you the list.
irb(main):002:0>
p %w( a b c )["a", "b", "c"]=>
nilLispy!
Where is mq_send explained?
manpages, Debianmq_send man page is located in the manpages-posix or manpages-posix-dev .deb package.
Convert Unix timestamps to human-readable format
Unix, Timekeeping, Excel, RubyIf you get a time as a number from the Unix epoch (for example, you're looking at your generated Internet Explorer cookie file and you see "1149920545" == "2006/06/10 06:22:25") you'll probably want to convert it to be able to read it.
In Excel, it's as easy as writing in this formula:
=DATE(1970,1,1)+F1/86400 in a cell and formatting the results as "
yyyy/mm/dd hh:mm:ss".
You could also try at the command line:
ruby -e "puts Time.at(1149920545).strftime('%Y/%m/%d %H:%M:%S')"(For some reason, Time#iso8601 isn't available...)
Update 2006/02/13:
For Time#iso8601, you need to use
require "time" to be able to use Time#iso8601.
How I keep remembering new ways of using computers. My (computer-centric) new-optimization learning blog.