content top

Bash configuration notes

vi .bashrc

is for current user only.

sudo vi /etc/bash.bashrc

is for all users – hence the sudo.

in .bashrc, add:

export PS1=”\e[0;34m[\u@\h \W]\$ \e[m”

to permanently change the bash prompt color.

List of Color codes:

  • Black 0;30
  • Blue 0;34
  • Green 0;32
  • Cyan 0;36
  • Red 0;31
  • Purple 0;35
  • Brown 0;33
  • Blue 0;34
  • Green 0;32
  • Cyan 0;36
  • Red 0;31
  • Purple 0;35
  • Brown 0;33

Replace digit 0 with 1 to get light color version.

Read More

Beginner Rails: Heroku

Heroku is pretty cool: a free host for your rails apps that also works really well with git/github. Since my current hosting has some pretty odd hosting for rails, I’ll be using heroku to host my demo apps. While adding a demo app, I received this error:

heroku keys:add …/custom_require.rb:36:in `require’: no such file to load — readline (LoadError)

According to dirk.net, this error is due to missing libraries after installing ruby from source.

The provided fix worked just fine for me:

sudo apt-get install libncurses5-dev
sudo apt-get install libreadline5-dev

After that, I cd to where I unpacked the Ruby source and ran:

ruby extconf.rb
make
sudo make install

heroku keys:add worked fine from there. Thanks to dirk.net for the fix.

Read More

Beginner Rails: Ruby on Rails on Ubuntu 10.04

In my quest to get ruby on rails up and running on all three OSes tat live in my house (windows, mac OSX leopard, linux), I ran into a snag in the install process on Ubuntu 10.04.

Ruby v 1.8.7 was alive and well, however, following the steps at rubyonrails.org, when I tried to update gem:
sudo gem install rails
OR
sudo gem update –system
I received this error:

/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require’:
no such file to load — zlib (LoadError)

Oddly enough, I received the same error when trying to create a rails app or start the rails server – even though rails *seemed* to be installed. Mysterious!
I had previously installed ruby via the synaptic package manager, gotten the same message, then tried again via sudo apt-get install ruby-full build-essential, none of which had relieved the issue.
So, searching the googlenet, I came across this post:
http://thoughtsincomputation.com/posts/ubuntu-and-ruby-191-zlib-missing
He had run into the same issue, and noted that the actual missing library was called zlib1g. I checked synaptic, and I had that installed – but, he noted that he had compiled Ruby from source, which I hadn’t tried. So, following his instructions:
sudo apt-get install zlib1g-dev

I then went to http://www.ruby-lang.org/en/downloads/ and got the source for version 1.9.2 (since this was the version I’m currently running on windows). I compiled ruby1.9.2 from source, and the problem was resolved.

Read More

The User Controls The OS, Not The Other Way Around

I am not a Koan!

Read More

Getting Wireless Adapter Working in Ubuntu 9.10 With RTL8192SE Linux driver

If you have a Toshiba laptop, there’s a good chance it has a Realtek RTL8191SE Wireless LAN 802.11n PCI-E NIC or some minor variation of same. Realtek apparently doesn’t make it very easy to find drivers for linux for this card – the person who posted the driver said he got it from Realtek, and I don’t have any real reason to doubt that. It works for me, in any case. Here are the steps I took to be able to use WiFi on my Toshiba Satellite P505. YMMV, so feel free to give a thorough read of the problem and solutions available at the Ubuntu help/bug forums. The driver tarball is available to download from that thread. rtl8192se_linux_2.6.0010.1012.2009.tar.gz (1.3 MiB, application/x-tar)

only load the driver module to kernel and start up nic.
1. Build up the drivers from the source code
make
2. Copy firmware to /lib/firmware/ or /lib/firmware/(KERNEL_VERSION)/
cp -rf firmware/RTL8192SE /lib/firmware
or
cp -rf firmware/RTL8192SE /lib/firmware/(KERNEL_VERSION)
Note: This depends on whether (KERNEL_VERSION) subdirectory exists under /lib/firmware

3. Load driver module to kernel and start up nic.
./wlan0up

And now back to writing.

Read More
content top