Tuesday, December 4, 2012

Read through all values in an array in PostgreSQL

Same applies to Greenplum:

select col1,array1 from schema.table WHERE 'value_to_search_for'= ANY(array1);

array1 is a column in the table with type name[] in this case

Sunday, December 2, 2012

Flash bios Dell Latitude E4300 running Fedora 17

I did not figure this out on my own. I cobbled together information from a few sources. Run the first six steps from here (listed below). To get my new menu item to show up upon boot, so I could actually flash the bios, I started with 3.2 here. I simply added the menuentry {} section listed in step 2 below. I then ran grub2-makeconfig.
  1. Get the bios update from Dell (exe file)
  2. Get biosdisk from the Dell projects site[1]
  3. Get "memdisk" (Fedora: "syslinux" package)
  4. modify the biosdisk script, set the "baseDir" variable (first line after the comments) to the directory to which you extracted the biosdisk archive. The other option is to copy dosdisk.img to the default location ("/usr/share/biosdisk").
  5. Create a bootdisk as root: "./biosdisk mkimage <exe filename>"
  6. After the last step there should be a img file in /tmp (e.g. "E4300A24.img") which contains the bios flasher program. Move that file to /boot.
  7. As root, cp /boot/grub2/grub /boot/grub2/grub.ORIG
  8. Copy memdisk to /boot: cp /usr/share/syslinux/memdisk /boot
  9. Edit /etc/grub.d/40_custom add
    menuentry 'Dell Bios Update A24'{
     linux16 /memdisk
     initrd16 /E4300A24.img
  10. grub2-makeconfig -f /boot/grub2/grub
Reboot. You should have a menu option 'Dell Bios Update A24'. Select that and press enter.

Time machine backups fail on new Toshiba drive

I did not develop this solution on my own. I found it in the Apple discussion forums, specifically this thread. Here are the details.

I purchased a new external drive, the Toshiba Canivo Basics 1.5TB model number  HDTB115XK3BA at Best Buy. I then follow the directions here to copy my old backup to the new drive. I went to back it up after the transfer and it immediately failed. The transfer had completed while I was at work so it had been 6+ hours since the transfer completed. That was plenty of time for the new hard drive to go to sleep. Turns out this is a habit of Toshiba drives from what I've been reading. I unchecked the option Put the hard disk(s) to sleep when possible in System Preferences/Engergy Saver and rebooted but that didn't fix the problem. I then came across a post about creating a crontab job to touch a file every minute to keep the drive away. Brilliant. So I now have the following crontab job that runs as the user I log in with every day.

* * * * * touch /Volumes/BackupDisk/test.txt

So far that seems to have done the trick.