Archive

Author Archive

apt-get and dpkg log – undo changes

June 4th, 2007 3 comments

Sometimes you just run a command people on websites ask you to. Well, you actually won’t do something like “rm -Rf /”, but you will  follow some apt-gets for example. I did this today, and ended up with a system that did not play any video (the site was explaining to me how to convert FLV to AVI – I can’t do that yet). So, I messed it up. But how to undo the changes?

Fortunatelly, DPKG (wich apt-get uses under the hood) mantains a log of it’s works. It’s right there at /var/log/dpkg.log

Good lines to look at are those wich the first word after date/time is INSTALL. It says that you (or apt-get) requested to install that particular package.

I’m trying to undo my mess here!

Powered by ScribeFire.

Categories: Uncategorized Tags:

Rails 1.2 routes and the dot “.”

May 22nd, 2007 2 comments

Rails 1.2 came with great new features. One of them was the REST able applications. Other was the ability to serve results based on how the request was made. So you could send different results for controller/action.html, controller/action.xml or contoller/action.rss, for example. This one came with a price though: If you had any routes on your site that uses a dot (“.”), it will not work on rails 1.2.

Why is that? Well, the dot “.” is now a route separator, just like the slash “/”. But, of course, there’s a way to work around it if you don’t plan to use the dot for specific actions. Just place a :requirements => {:yourparam => /.*/} to your routes.rb. Here is an example:

Before:

# Here I could use an username like “john.smith” or “lys.cohen”, but not on Rails 1.2
map.connect “books/feed/:username”, {:controller => :book, :action => :book_feed}
After Rails 1.2:

# Now it works on Rails 1.2
map.connect “books/feed/:username”, {:controller => :book, :action => :book_feed, :requirements => { :username => /.*/}}

It worked great for me. And, best of all, it does not break the functionality, so you can use dots as they are intended to be used on other controllers and even actions on the same controller.

This tip was extracted from TextDrive Forums

Categories: Uncategorized Tags:

Moving and using Firefox Plugins on Swiftfox

May 21st, 2007 1 comment

So, have you ever heard of Swiftfox? If you are coming from google, probably yes. It is just like Firefox (the same source code) but it is compiled with optimizators for the major CPUs avaiable. So, it will perform better on your machine. It’s like having Firefox on Steroids. So, since it has the same source code, you can use your existing extensions (and install new ones) as well as use your plugins. There’s an platform independent installer on the website, but if it does not import the plugins for you, or, for some reason, you have installed it using another method (like Automatix, or tarball), you can create soft links from your existing plugins to use them on swift fox.

1. Go to /usr/lib/firefox/plugins

2. Do a ‘ls -l’ so that you can see where the link points to

3. Now, create links on /opt/swiftfox/plugins to the original files

Tip: ln receives the target and then the name for the link (I always misplace them)

Example:

Giving ls -l you find out that the java plugin (firefox-javaplugin.so) is in /etc/alternatives/firefox-javaplugin.so. So you do a

ln -s /etc/alternatives/firefox-javaplugin.so /opt/swiftfox/plugins/

Swiftfox will automatically use the new plugins.

Categories: firefox, howto, web Tags:

ruby on rails reference cheat sheet

March 7th, 2007 No comments

This website has an excelent Ruby on Rails resource for those in need (like most of us). It features lot’s of command line options, code snippets, and stuff like that. Very handfull! This is the link to the blog entry, and this one points to the text itself. Take a look!

Categories: programming, rails, ruby Tags:

ruby on rails ide comparison

March 7th, 2007 No comments

Sébastien from The Nameless One, did a very impressive job comparing three of the main Ruby on Rails IDE avaiable. His extensive post includes a feature chart with each IDE’s most important features side-by-side, using colors to show how good or bad implemented that feature is on a particular IDE. It’s more than worth looking, and the link is here.

BTW, I’ll stay with Netbeans Development Edition. Even being unstable (I believe it’s not even Alpha yet) it’s quite usable, and I’m doing most of my work on it. Just missing a few test features. But that should come on the next milestones!

Thanks Sébastien, for the great job!

Categories: netbeans, programming, rails, ruby Tags:

how to install ruby on rails and lighttpd on ubuntu

March 6th, 2007 4 comments

Hey folks. It’s interesting how difficult it was for me to get Rails up and running on Lighttpd. I’ve tried lot’s and lot’s of tutorials, but none of them seemed fit to me. I came up with this solution, wich is actually a merge of lot’s tips. Feel free to contribute, and I hope that this helps you out.

1) First, include UNIVERSE on your sources.list. It is located on /etc/apt/sources.list. If you are unsure, take a look at this web-site. It may help you out. Remember to sudo, or be root to do everything Read more…

Categories: howto, rails, ruby, ubuntu Tags:

making webpages with great colors

February 27th, 2007 No comments

I’m just a programmer. Period. I work alone, so I have to build both code and web page layout for my software, but I’m no designer. To top it all, I’m color blind. So, I choose the colors, they look great to me, but everyone else with a normal vision will protect their eyes from such a terrible color scheme!

Maybe you’re not a color blind person, but you may have faced trouble choosing colors for your web site. You try two, three, ten times and it just can’t get right. Your designer friend though, can do that in 35 seconds, of which 30 are spent opening Dreamweaver.

There’s a tool on the web that intents to help people like us. It’s called Color Scheme Online v 2.0.  It helped me big time. You go to their website, and click on a color (or type the color code on one of the inputs on the left). The site will then show you 12 colors that match with the one you provided. Along with their codes in RGB and Hex.

Great value tool! Try it out.  There’s also a desktop software download there, but I haven’t tried that out yet.

Categories: programming, web Tags:

netbeans and UTF8 encoding

February 26th, 2007 11 comments

[digg=http://www.digg.com/programming/Netbeans_and_UTF8_encoding]
When I started using Netbeans as my Ruby on Rails IDE, I noticed that, at least on my build, it did not use UTF 8 on files by default. If you speak english that usually is not a problem, but for me, who write software in portuguese, it is very important.
But, Mr. Google gave me a tip, and I’ll place it here so you don’t have to bother him again with this same question.
Theres a file, inside the /etc folder of netbeans directory, called netbeans.conf. I don’t know if it stays elsewhere in Linux, I’ll only know later today, but anyway, you should place this option inside the quotes of netbeans_default_options:
-J-Dfile.encoding=UTF-8
That’s it. Worked perfectly for me.
Best

Categories: netbeans, programming, rails, ruby Tags:

netbeans and ruby on rails

February 26th, 2007 3 comments

Tor Norbye is doing a great job integrating a Ruby module on the development version of Netbeans. Since I’m still on the look for my definitive Ruby IDE, I decided to take a look at it, and all I can say is that I liked it very, very much. Never had any experience with Netbeans before (I don’t speak Java), but it’s a great software. The Ruby integration is, as far as I can tell, quite good, only a few bugs showed up on 3 days of work.

You can download it from the Netbeans CVS, the standard module. This post from Tor shows how to get and compile it. It took me long 36 hours to checkout the whole source. Don’t know if it was my Internet connection (yes, Telemar, it’s your fault, not mine, DSL provider from hell), or a busy server, but it was long, and I had to restart the process lot’s of times (around 7 times. But you don’t loose your job, it continues from where it stopped).

Give it a try! And, Tor, thank you very much for the great job!

Best!

Categories: programming, rails Tags:

publishing code online

February 25th, 2007 No comments

If you ever needed to publish a few lines of code online, you probably noticed that it is quite difficult to do on the major blogging platforms. I found a good way to workaround this functionality lack, using a third site to host the code, called Pastie. It allows you to post code there, and even split the same post on different sections, meaning whater you want: separate parts of the same file, different files, you name it.

Categories: programming Tags: