If you want to get the numeric month from strftime your only only is %m which is zero padded. So January is “01”. But what if you don’t want zero padding? Turns out that’s non-trivial, unless you’re on a system that supports strftime flags. Then you can use “%-m” for no padding (“1”) and “%_m” for space padding (” 1″). These same flags work on all of the other formatters so you can use “%_d” for space padded day instead of having to remember to use “%e”. Not portable, but much more readable.
Some bugs I’ve encountered in Ubuntu 12.04
Installing Windows GPLPV Drivers in Xen
I’ve done this enough times to know it by heart but I remember when I tried to find documentation on this step I ran into countless inaccurate and outdated examples. So here’s what I do to get the Windows GPL PV drivers installed under Xen.
- Download the drivers from meadowcourt.org. As of 1/18/2012 the latest version is 0.11.0.308. You’ll need to get the appropriate drivers for your OS.
- turn testsigning off on Windows
- bcedit
- I like to check out the config first
- bcdedit /set {current} testsigning on
- this turns testsigning on
- bcdedit
- I usually run this again to make sure “testsigning Yes” appears
- restart windows. upon restart the system should indicate it is in “Test Mode”
- install the drivers msi file that was downloaded. I always choose “Typical” installation. I choose not to restart at this point.
- create new default boot option
- bcdedit /copy {current} /d “GPLPV
- this will copy the current boot setup into a new one called GPLPV
- pay attention to the id returned here
- bcdedit /default ID
- replace ID with the id from the copy command
- this sets the new menu to be the default
- bcdedit /set {default} loadoptions GPLPV
- this makaes this option use GPLPV drivers
- bcdedit
- double check everything
- restart windows
Researching Redis on Rails
I’ve been researching how good a fit Redis might be for a project or 2. One project needs a memory based key-value store generally without persistence, which would seem to suggest memcached. However, there may be times where persistence across reboots may be desirable and Redis’ atomic operations and data types may also be useful. Here’s some links I’ve been checking out:
- Software
- redis – obviously
- redis-rb – gem for accessing redis from ruby
- redis-objects – gem for mapping Redis types to Ruby objects
- ohm – gem for creating Redis based object models
- supermodel – gem for ActiveModel descendant that can store to Redis
- Information
- Using Redis with Ruby on Rails
- Datastores with ruby: Redis and Ohm (part 1)
- To Redis or Not To Redis? (Key-Value Stores Part 4) | Engine Yard Blog
- Comparing MongoDB and Redis, Part 1 « While I Pondered…
- Comparing MongoDB and Redis, Part 2 « While I Pondered…
- where_redis_is_a_good_fit
- using_keyvalue_stores_from_ruby
Evaluating open source web control panels again
Here is what I’m looking at:
- ISPConfig – been around a long time, seems quite mature
- Froxlor – an active fork of SysCP which has a decent reputation
- I-MSCP – a fork of ispCP which was a fork of VHCS which I know several people who supported
The sad state of linux desktop environments
I run Ubuntu on my desktop and have since Ubuntu’s first release (4.10) and the current release, 11.10, is the first that I am going to skip over entirely. The reason is that the choice of desktop environments is poor. I upgraded my HTPC to 11.10 and tried every desktop environment available: Gnome Shell, Unity, KDE 4, XFCE, LXDE. Not 1 of them seemed like it would fit my desktop needs. I have a nice Gnome 2 desktop with plenty of customizations to fit how I work but upgrading to from 11.04 to 11.10 would cause me to lose all of that and force me to learn how to be as productive in a new desktop environment. I really cannot afford to take that time when I have so many projects going.
Continue reading ‘The sad state of linux desktop environments’ »
SSD Recomendation
I’ve bought a number of solid state drives and I’ve had to return most of them due to problems. I’ve taken from that experience that a lot of the manufacturers don’t quite know what they are doing yet. There are plenty of places on the internet you can read about the bugs in many of the released drives. I’m hoping the acquisition of Indilinx by OCZ and SandForce by LSI will improve the reliability of drives based on those controllers. However, my SSD purchases have been narrowing to Crucial who’s RealSSD C300 and M4 have been far more reliable than average and extremely well performing. A recent review of the OCZ Octane drive shows the Crucial M4 as one of the better drives in server performance:
- http://techreport.com/articles.x/22078/8
Fixing ALSA sound issues
Ony my desktop I’ve removed pulseaudio because I found it to be more trouble than it was worth. So I use ALSA, which works pretty well. However, sometimes my audio dies and produces chirps and squeaks only. I found the easiest way to fix this is the following command:
- sudo alsa force-reload
how to disable Rack::Cache in Rails 3.1
Couldn’t find this anywhere but what I found worked was to put this in config/application.rb:
require 'rack/cache' config.middleware.delete Rack::Cache
This did fix the issue that sent me to this, as many people are likely to run into. The issue was that since Rack::Cache uses the default Rails FileStore that lots and lots of small files were being created in lots and lots of directories. I don’t think Rack::Cache offers me much for this application, but if it did I would look into switching from a file store to a memory or memcached store.
Playing with LXC
I’ve been wanting to explore the OS-level virtualization space again. For a long time I was running linux-verser on a number of servers. I switched to Xen because I really like the aesthetic of being able to run each virtual machine with it’s own kernel. But I wonder if this is not too heavy a solution when all you really want is a super-chroot. LXC has a lot of support since it’s in the kernel but it’s difficult to tell how big a community there is. Thus far I’ve been pretty disappointed with LXC and I’ve had trouble getting information. For example there is very little information as to whether capabilities are changed in different kernel versions. Here are some of the major difficulties I’ve found so far: