Archive for December, 2006

Open Source Mac Apps

Saturday, December 30th, 2006

Just names and links:
Adium X, Chicken of the VNC, Colloquy, Cyberduck, Chmox, Fink, Firefox, macam, Smultron, Tomato Torrent, Virtuedesktop

Until it’s posssible to mount ssh filesystems…

Saturday, December 30th, 2006

Forget about cyberduck, the real thing is made possible by Amit Singh!! Two visitors dropped comments about about the release of this project. I’ve updated the post that I made back in September.


Until then… I will use cyberduck!!!
Cyberduck is an FTP / SFTP client that let’s you browse filesystems on systems you have ssh access to. It not only lets you upload and download files, it also file edit support. After connecting to a server, select a file and right click it. Select ‘Edit with > Smultron’.
Cyberduck monitors the file that you just opened in Smultron. If you save it, it will be automatically uploaded to the server, just like you where editing a local file.

And, of course, both Cyberduck and Smultron are Free and Open Souce ;-)
Neat!!

Wireless setup

Tuesday, December 26th, 2006

For some reason, I couldn’t get my wireless card (Linksys WMP54G pci) working under Ubuntu 6.10. Another attempt today. First without encryption: Hey! it works!. Then WEP ‘encryption’: no luck. WPA: on my access point (asus wl530g) it’s called WPA-PSK with TKIP encryption. OS X calls it “WPA personal”. Under Linux, adapting the /etc/networking/interfaces file was sufficient:

$ cat /etc/network/interfaces
auto lo
iface lo inet loopback

iface ra0 inet dhcp
pre-up iwconfig ra0 essid default
pre-up iwconfig ra0 mode managed
pre-up iwconfig ra0 channel 1
pre-up iwpriv ra0 set AuthMode=WPAPSK
pre-up iwpriv ra0 set EncrypType=TKIP
pre-up iwpriv ra0 set WPAPSK="mysecretpassphrase"

auto ra0

So, no additional drivers / modules, just choosing the right encryption was the trick to get this card working. This was one of the posts that where very helpful.

www.hiddenspiral.net/node/23

Monday, December 18th, 2006

This is a comment that I would have posted on this blog entry, if the author was willing to receive it without me signing up. It’s about retrieving the keys and values of an enum field in CakePHP:

This version returns the original mysql key values and returns false if the enum is not found:

function generateEnumArray($enum)
{
  if (!is_string($enum)) {
    return false;
  }

  foreach($this->_tableInfo->value as $field)
  {
    // found matching field, check for type enum and field name
    if(substr($field['type'], 0 ,4) == 'enum' && $field['name'] == $enum)
    {
      $enum_array = array();
      foreach(split("','", substr($field['type'], 6, -2)) as $key => $value)
      {
        $enum_array[$key]=$value;
      }
      return $enum_array;
    }
  }

  // enum not found
  return false;
}

Batch conversion of images

Friday, December 15th, 2006

For batch image conversion, file renaming, etc, I usually use these kind of one-liners:

$ for i in `ls *.bmp` ; do echo convert $i ${i%.*}.png ;done
convert screendump_01.bmp screendump_01.png
convert screendump_02.bmp screendump_02.png
convert screendump_03.bmp screendump_03.png

When you’re satisfied with the result, have it executed by the shell:

$ for i in `ls *.bmp` ; do echo convert $i ${i%.*}.png ;done | sh