Posted in Uncategorized on May 29th, 2010 by admin – Be the first to comment
This occurred whilst using Solaris on Joyent. Somewhat annoying when one can’t remove a file when “Disc quota exceeded”!
What one can do is override the file contents with nothingness.
cat /dev/null >/PATH_TO_FILE
Source: Joyent forums
Posted in Uncategorized on March 27th, 2010 by admin – Be the first to comment
You bought a mac in the UK only to find the keyboard layout isn’t fully British or fully American. See Wikipedia. There’s a pound symbol but the at, hash and quotation marks don’t seem quite right.
You’ll want to go to http://liyang.hu/osx-british.xhtml for a fix for snow leopard.
If you’re thinking that it’s the “mac way” and you should accept it and live with I have to totally disagree. Any system should should be configurable to meet the user’s needs and imposing only one method of doing something is counter productive. It feels good to type this article on a keyboard knowing what each key should output rather than rewiring my brain.
Posted in Uncategorized on February 5th, 2010 by admin – 1 Comment
ruby strftime parameters are not mentioned in the ruby api but are instead specified in the time.c source which can be found at http://ruby-doc.org/.
/*
* call-seq:
* time.strftime( string ) => string
*
* Formats time according to the directives in the given format
* string. Any text not listed as a directive will be passed through
* to the output string.
*
* Format meaning:
* %a - The abbreviated weekday name (``Sun'')
* %A - The full weekday name (``Sunday'')
* %b - The abbreviated month name (``Jan'')
* %B - The full month name (``January'')
* %c - The preferred local date and time representation
* %d - Day of the month (01..31)
* %H - Hour of the day, 24-hour clock (00..23)
* %I - Hour of the day, 12-hour clock (01..12)
* %j - Day of the year (001..366)
* %m - Month of the year (01..12)
* %M - Minute of the hour (00..59)
* %p - Meridian indicator (``AM'' or ``PM'')
* %S - Second of the minute (00..60)
* %U - Week number of the current year,
* starting with the first Sunday as the first
* day of the first week (00..53)
* %W - Week number of the current year,
* starting with the first Monday as the first
* day of the first week (00..53)
* %w - Day of the week (Sunday is 0, 0..6)
* %x - Preferred representation for the date alone, no time
* %X - Preferred representation for the time alone, no date
* %y - Year without a century (00..99)
* %Y - Year with century
* %Z - Time zone name
* %% - Literal ``%'' character
*
* t = Time.now
* t.strftime("Printed on %m/%d/%Y") #=> "Printed on 04/09/2003"
* t.strftime("at %I:%M%p") #=> "at 08:56AM"
*/
Posted in Uncategorized on January 3rd, 2010 by ph-lee – Be the first to comment
Going green
My all-in-one kubuntu media centre and general server sits unused most of the time. So why not set it to switch on and off in sync with when I need it based on the time of day. Should save on some bills.
Requirements
Method
Setup a cron job as root to shutdown at the specified time. To edit crons as root enter the following.
sudo crontab -u root -e
Add the following line to the list. This will shut down the box everyday at 0400. Of course you can modify as needed to suit your needs. And if you want to hibernate I’m sure theres a hibernate command.
0 4 * * * /sbin/shutdown -h now
While we’re at it we’ll also set up the wakeup time using rtcwake. So also add the following to the cron list.
45 3 * * * /usr/sbin/rtcwake -m no -s 29700
15 minutes before the shutdown we set the box to wake up in 29700 seconds which equates to 8 hours and 15 minutes. So the machine is scheduled to wake up at 12 noon.
Setup
This solution might be setup dependent so here are some specs that may help…
- Linux kubuntu 9.10 Karmic Koala
- 2.6.31-16-generic #53-Ubuntu SMP Tue Dec 8 04:01:29 UTC 2009 i686 GNU/Linux
- Motherboard: ASUS A7V-133 ACPI BIOS Revision 1007 (10/03/2001)
Making media centres’ greener.
Posted in Uncategorized on December 28th, 2009 by ph-lee – Be the first to comment
Problem: Getting a blue screen on video and live TV playback with MythTV.
Solution from [ubuntu forums]
xvattr -a XV_CRTC -v 1