PCLinuxOS distro hopper stopper, 2009 Beta 1 is out
I stopped distro hopping over 2 years ago since I found PCLinuxOS, I’ve hopped from Ubuntu and it’s variants – Kubuntu and Xubuntu, I’ve also tried openSUSE, Mint, Mandriva, Dreamlinux, Debian, Sabayon and many other flavors I downloaded, burned and installed.
The first thing that drew me to the linux community was pretty embarrassing – the 3D desktop effects! My focus back then was eye-candy and the bragging rights to say "I use Linux, can your PC do this?". PCLinuxOS had the best 3D desktop effects that ran out of the box. After a few months, my focus changed to stability, power and ease of use. Still hopping around, I kept coming back to PCLinuxOS. Hardware detection was superb, I was doing everything in PCLinuxOS – office documents, browsing, image editing, programming, etc., even Ruby was installed by default! Everything just works.
It’s been quite a while since PCLinuxOS has made a major release because it’s a rolling distro, you get the latest version just by upgrading everything from synaptic. Initially I was excited to try out and even install the 2009 beta 1 release. I downloaded the iso from http://distrowatch.com and tried it using VirtualBox.

After a few minutes of playing around and trying to find bugs I realized there was no need to jump into this release, after all it’s a beta. I figured I wasn’t missing much features from my current PCLinuxOS 2007 installation. Everything seemed so familiar, the only noticeable change was the Mandriva inspired graphics. I’m looking forward to the next beta release, try to find a bug and hopefully contribute to a more solid PCLinuxOS 2009 final release.
tags: PCLinuxOS category: linux distro Comments (0) Create CommentDaemonize Your Gems in PCLinuxOS
I found Mikel Lindsaar’s tip on how to daemonize gems
http://lindsaar.net/2008/4/12/tip-2-daemonize-y…
Tip #2 – Daemonize Your Gems!
His instructions are targetted at Mac users. This is how I accomplished the same thing in my PCLinuxOS installation. Even though PCLinuxOS has a /etc/rc.local directory which Mikel had to create, I opted only to modify files in my home "~" folder. Since PCLinuxOS uses KDE, this means that anything inside the directory ~/.kde/Autostart/ will be run, it can be a soft link or a shell script. I already have a simple script.sh to run conky on start-up, so all I had to do is add the "gem server" command:
#!/bin/bash conky -a top_right gem server --daemon
If you don’t have an existing script file, just created a new one in ~/.kde/Autostart/ and name it any_thing_you_like.sh and remember to place #!/bin/bash on the very first line of the code:
#!/bin/bash gem server --daemon
The next time your PCLinuxOS starts, gem server is automatically started! Just browse to http://localhost:8808/.
Hope this helps someone.
tags: PCLinuxOS category: tips Comments (0) Create CommentI was playing around the tk library as an intro to ruby gui programming when I ran into this error:
>> require 'tk'
RuntimeError: Can't find a usable init.tcl in the following directories:
/usr/lib/tcl8.4 /usr/lib/tcl8.4 /lib/tcl8.4 /usr/library /library /tcl8.4.13/library /usr/lib/tcl8.4
This probably means that Tcl wasn't installed properly.
from /usr/lib/ruby/1.8/tk.rb:1102:in `initialize'
from /usr/lib/ruby/1.8/tk.rb:1102:in `new'
from /usr/lib/ruby/1.8/tk.rb:1102
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
from (irb):1
This is solved by installing Tcl from synaptic, in PCLinuxOS Tcl isn’t installed by default. After the download is finished, just like that, you can now use use tk for gui programming.
>> require 'tk' /usr/lib/ruby/1.8/tk.rb:29: warning: already initialized constant WidgetClassNames /usr/lib/ruby/1.8/tk.rb:30: warning: already initialized constant TkExtlibAutoloadModule /usr/lib/ruby/1.8/tk.rb:40: warning: already initialized constant Tk_IDs /usr/lib/ruby/1.8/tk.rb:43: warning: already initialized constant Tk_CMDTBL /usr/lib/ruby/1.8/tk.rb:48: warning: already initialized constant Tk_WINDOWS => truetags: Ruby category: programming Comments (0) Create Comment
1. How to add multiline text entries
Here’s the first working solution that came to mind, this would be very hard to maintain:
body: "
Hi this is the about section \n
My name is andro \n
this shoule be multiline \n
"
Until I found http://railsforum.com/viewtopic.php?id=3722, this is probably the best solution I’ve found so far – just use a pipe!
body: |
Hi this is the about section
My name is andro
this shoule be multiline
2. How to change created_at to a previous date
Since Ruby on Rails 2.x created_at and updated_at are no longer needed. It takes the current timestamp upon loading the fixtures with the command
rake db:fixtures:load
This poses a problem since I wanted to have created_at dates that are past dates.
So i tried the old way of doing it:
created_at: <%= Time.now - 5.months %>
which doesn’t work. The new way of doing it is:
created_at: <%= 5.months.ago.to_s(:db) %>tags: RubyonRails category: tips Comments (0) Create Comment
Failed to build gem native extention in PCLinuxOS
I can’t install gems after I did a fresh install of PCLinuxOS:
[root@localhost andoy]# gem install RedCloth
Building native extensions. This could take a while...
ERROR: Error installing RedCloth:
ERROR: Failed to build gem native extension.
/usr/bin/ruby extconf.rb install RedCloth
can't find header files for ruby.
To solve this, just install the development package for ruby, while I’m at it, I’ll also install the documentation.
In synaptic:
- search for ruby-devel and ruby-doc
- right-click ‘Mark for installtion’
- Apply
Or from konsole as root:
apt-get install ruby-devel ruby-doc
I just waited until the download finished and voila!
[root@localhost andoy]# gem install RedCloth Building native extensions. This could take a while... Successfully installed RedCloth-4.0.3 1 gem installed Installing ri documentation for RedCloth-4.0.3... Installing RDoc documentation for RedCloth-4.0.3...
Hope this helps someone.
tags: PCLinuxOS category: tips Comments (0) Create CommentHow to hide all backup files, my ruby noob version
I love using Kate (KDE Advance text editor), I use it to type my emails when I have no network access, it’s where I open and study all sorts of source code (ruby, python, php, java). By default, saving or editing in Kate creates a visible backup file (with the suffix "~"). Which I think is totally annoying! I didn’t want to see these backup files.
If you’re a noob like me, you probably haven’t changed the default setting for Kate to hide backups (it must have a prefix "." to be hidden). Thanks to devnet in IRC freenode #pclinuxos-support, I found out it’s just a minor configuration:
Settings > Configure Kate > Open/Save > Backup on Save > Prefix should be "." (without the quotes).
Now every time I save, backup files should now be hidden. What about the old and visible backup files? Well.. there are a lot of shell scripts out there to do mass renaming. But I wanted to try my ruby skill on this. Here is my code:
require 'find'
if ARGV.size < 1
puts "USAGE: ruby hide_backup_files.rb <DIR>\n<DIR>: The directory tree to traverse. Ex. /home/user"
exit
end
dir = ARGV[0]
unless FileTest.directory?(dir)
puts 'Please use a valid directory.'
exit
end
Find.find(dir) do |path|
name = File.basename(path)
next if name[0] == ?. # skip it if it's already hidden
if FileTest.file?(path)
# if it's a backup file (with suffix ~ ), rename it as a hidden file
if name =~ /~\z/
dir = File.dirname(path)
puts "done hidding => #{path}" if File.rename("#{dir}/#{name}", "#{dir}/.#{name}")
end
end
end
tags: Linux
category: programming
Comments (0)
Create Comment
Necessary access to logs and documentation
tail -f log/development.log
The tail command is very helpful. It is very important for a newbie like me to view and understand logs.
If I want to save the logs for later viewing starting from the time I tailed, I redirect the output to a text file:
tail -f log/development.log > ~/Desktop/some_file_name.txt
Tail is not available in windoze but one can install software to do just this. In my personal experience, the logs tells a lot about what your doing wrong, instead of relying on the online tutorials or screencasts that are usually outdated. It is through looking at the logs that I was able to find out why the tutorial wasn’t working the way I wanted it. You see I usually have several resources and try to mix them up together. Even though the tutorial has a warning that, this will not work in rails 2.x, still my curiosity wanted to make it work.
Sure I could googlize, but sometimes I see it as an advantage to be offline than being online, as this forces me to understand the inner workings of rails and really get on reading the documentation. There’s this feature of NetBeans IDE I appreciate, it makes documentation accessible. I actually found this out by accident, I just have to press Ctrl + Shift then click on the method i would like to find out how to use, and a window will open to show a nice looking docu.
tags: RubyonRails category: tips Comments (0) Create CommentRoughly Rolling with Ruby on Rails - the newbie perspective
I have been following the Ruby on Rails community for a while but haven’t really committed time to invest hard hours on learning Ruby on Rails. I was in the hype! Yeah… but not really coding until now.
Ofcourse meaning to jump into learning Ruby on Rails isn’t enough. Being recently unemployed became a blessing in disguise – it gave me the opportunity to get started on it. A goal has been set. This would be my first time to invest in learning rails. To achieve this, I set out to build this blog. There are a lot of resources out there that allows a newbie like me to get started, here are my personal favorites:
http://www.learningruby.com
http://www.buildingwebapps.com
http://www.tutorialspoint.com
I believe one must be comfortable with coding basic Ruby to start on Rails. It’s a good thing I’m not entirely new to Ruby. I have been using Ruby in my previous employment ranging with the following Ruby gems – WATIR, Selenium, Capistrano and SOAP4r. But there are still so much to learn and love in Ruby.
The first question that popped in my head – should I jump right in rails 1.x or 2.x? Well, I went ahead with rails 2.1 although learning 1.x would be advantageous when maintaining old code, I figured every RoR developer’s goal would be to migrate from 1.x to 2.x, simply because it is better.
The second question. What IDE should I use? Coming from an industry where Java is the norm, I thought an IDE is a neccessity. Aptana/Radrails is great, so is Netbeans. But for my journey, I’m breaking away from depending on the IDE and stick with my favorite text editor – Kate (KDE Advance Text Editor). For Gnome fans, I tried Gedit and it proves to be a great alternative. I just prefer Kate over Gedit even thought Gedit can be installed in KDE.
tags: RubyonRails category: programming Comments (0) Create Comment



