piyo's computer tips
2006/02/27
starting syslog on Cygwin
Cygwin

Lots 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!
 
2006/02/26
Devfs in Gentoo, fighting Subversion on Colinux 0.6.1
Gentoo, Subversion, Colinux

What 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, webdev

curl 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}
 
2006/02/24
%q & %w
Ruby

%q gives you the quotes:
irb(main):001:0> p %q( a b c )
" a b c "
=> nil

While %w gives you the list.
irb(main):002:0> p %w( a b c )
["a", "b", "c"]
=> nil

Lispy!
 
2006/02/13
Where is mq_send explained?
manpages, Debian

mq_send man page is located in the manpages-posix or manpages-posix-dev .deb package.
 
2006/02/02
Convert Unix timestamps to human-readable format
Unix, Timekeeping, Excel, Ruby

If 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.

Name:
Location: Kobe, Hyogo, Japan
September 2003 / October 2003 / December 2003 / March 2004 / April 2004 / May 2004 / June 2004 / July 2004 / August 2004 / September 2004 / February 2005 / March 2005 / April 2005 / May 2005 / June 2005 / July 2005 / August 2005 / September 2005 / December 2005 / January 2006 / February 2006 / March 2006 / April 2006 /


Powered by Blogger