Showing posts with label config files. Show all posts
Showing posts with label config files. Show all posts

Tuesday, May 13, 2008

Installing ruby gems in your home directory

I found it hard to find good instructions for installing ruby gems as a non-root user without installing the gem package locally as well. Here's what I figured out; hopefully this will save someone else some time in the future:

Make a directory for gem installation:

$> mkdir ~/.gems

Set up your .gemrc for gem install-time configuration:

$> cat << EOF > ~/.gemrc
gemhome: $HOME/gems
gempath:
- $HOME/gems
- /usr/lib/ruby/gems/1.8
EOF


Set up some environment variables for run-time:

$> cat << EOF >> ~/.bashrc
export GEM_HOME=$HOME/gems
export GEM_PATH=$HOME/gems:/usr/lib/ruby/gems/1.8/
export PATH=$PATH:$HOME/gems/bin
EOF


Source your bashrc and you're all set.

UPDATE (Apr 18, 2009): gem seems to do this on its own now, so just adding
export PATH=$PATH:$HOME/.gem/ruby/1.8/bin

to your .bash_profile should be enough.

Monday, June 4, 2007

xterm-like fonts for gnome-terminal in Fedora 7

I like using gnome-terminal, but I find the default fonts hard on my eyes. So I don't forget (and for anyone who is interested), here are the steps to use xterm's default font in gnome-terminal:

  1. As root, run `yum -y install bitmap-fonts`

  2. As root, run `ln -s /etc/fonts/conf.avail/70-yes-bitmaps.conf /etc/fonts/conf.d/`.

  3. Close all open gnome-terminal windows.

  4. Launch gnome-terminal and edit the current profile.

  5. Uncheck 'Use the system fixed width font' and click on the font button.

  6. Select 'MiscFixed' and set the font size to 10.

  7. Your terminals now look crispy in the dark.

Saturday, December 9, 2006

Using OpenDNS with Fedora Core 6

DNS lookups at home were extremely slow for me. For instance, while doing some profiling of yum this afternoon, 10 out of 15 seconds were taken up resolving the IP of download.fedora.redhat.com. Replacing Road Runner's DNS servers with OpenDNS took this down to 5 seconds. Putting OpenDNS before my router's DNS server makes the time negligible.

Anyways, the details:

  • Copy /usr/share/doc/dhclient-$VERSION/dhclient.conf.sample to /etc/dhclient.conf

  • Edit /etc/dhclient, removing everything before the 'prepend domain-name...' line, and everything after the 'initial-interval 2;' line.

  • On the 'prepend domain-name-servers' line, replace '127.0.0.1' with
    '208.67.222.222 208.67.220.220'.

  • Take down and bring back up your network connection. /etc/resolv.conf should now start with the two 208... IP addresses.


The important part I believe is to keep the 'request' and 'require' bits in dhclient.conf. This setup will play nicely with NetworkManager, too. Mad props to Orangebat for pointing out OpenDNS.

Here's a sample dhclient.conf, to make it easy:

prepend domain-name-servers 208.67.222.222, 208.67.220.220;
request subnet-mask, broadcast-address, time-offset, routers,
domain-name, domain-name-servers, host-name;
require subnet-mask, domain-name-servers;
timeout 60;
retry 60;
reboot 10;
select-timeout 5;
initial-interval 2;
© 2012 James Bowes. Icons by glyphicons. Powered by Blogger.