Wednesday, August 5, 2009

emacs commands to remember

to re-indent:

1. select the region (ctrl+h selects the entire buffer)
2. ctrl+alt backslash

Tuesday, August 5, 2008

Fedora + Ruby + Rails

  • yum install httpd mysql-server mysql mysql-devel
  • yum install ruby ruby-devel ruby-irb ruby-libs ruby-rdoc ruby-ri
  • download gem and install from source
  • gem install rails mongrel mechanize newgem
  • gem install -y mysql -- --with-mysql-config=/usr/bin/mysql_config

Monday, August 4, 2008

Parse XML with ruby

Use Hpricot:

# @my_xml contains my xml in a String object

doc = Hpricot::XML(@my_xml)

Now you can do regular Hpricot to extract the xml content. E.g.(doc/"//entry/title/text()")

Monday, July 28, 2008

Misc Handy Linux Commands

Create a new nic with the following IP. The netmask will restrict access to that subnet.
ifconfig eth0:0 172.16.41.13 netmask 255.255.255.0

Disable Firewall
iptables -F

Tuesday, May 27, 2008

HO-MADE PIES - YUM!


My boss went turkey hunting, and sent me this picture. He said he claims it is a real sign, and he even bought a t-shirt from them. He also mentioned waiters are only female.

Wednesday, May 7, 2008

Ruby + Rails + Debian

I tried a million different tutorials, and they all sucked, then my friend showed me the way.

  1. comment or delete the lines currently in /etc/apt/sources.list
  2. add the follow lines to /etc/apt/sources.list
    deb http://ftp.debian.org/debian/ etch main

    deb-src http://ftp.debian.org/debian/ etch main

    deb http://security.debian.org/ etch/updates main contrib

    deb-src http://security.debian.org/ etch/updates main contrib

    deb http://ftp.debian.org/debian/ testing main

    deb-src http://ftp.debian.org/debian/ testing main

    deb http://security.debian.org/ testing/updates main contrib

    deb-src http://security.debian.org/ testing/updates main contrib

  3. Run the follow command:
    apt-get update

  4. /etc/apt/apt.conf should contain:
    APT::Default-Release "stable";
    APT::Cache-Limit "16777216";

  5. run:
    apt-get -t testing install ruby1.8
    apt-get -t testing install ruby1.8-dev
    apt-get -t testing install ri1.8
    apt-get -t testing install rubygems
    ln -s /usr/bin/ruby1.8 /usr/bin/ruby
    ln -s /usr/bin/ri1.8 /usr/bin/ri

  6. install all the gems you want and use them!

All DONE!

Monday, May 5, 2008

run snmpd with perl or c modules

Make sure you run snmpd like so, when extending it with either perl or C modules:
snmpd -f -L -DnstAgentPluginObject,dlmod