rm * Argument list too long

Linux No Comments »

To delete all files in the current directory, you run the extremely dangerous 

rm *

and

rm -rf *

to recursively remove all files and directories.

However, the command has a 128K buffer limitation in the Linux Kernel. As a workaround you can pipe each file to rm like so:

find . -name '*' | xargs rm

See this article for details.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

“Could not connect to the server” with Rails 2.2 and Netbeans

Netbeans, Ruby on Rails No Comments »

If you get the “Could not connect to the server” error running you project from Netbeans while script/server works fine, first make sure you have the correct Rails version set for your project, it should show “Installed version: 2.2.2”:

Rubygems_update2

If you still get:

Rails requires RubyGems >= 1.3.1 (you have 1.2.0). Please `gem update –system` and try again.

But the suggested

gem update —system

often fails to update your gem to the new version so try

sudo gem install rubygems-update

and then run:

sudo gem install rubygems-update

and check with

gem -v

where it should show 1.3.1 at the time of writing.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Cleanliness and Morality

Unspecific Ramblings No Comments »

This Economist article discusses recent research which suggests that a clean body might lead to a more morally questionable behaviour in the individual. Is the extreme emphasis on corporal cleanliness the reason why we see the famous laissez faire attitude in Thailand known as “mai pen rain (it doesn’t matter)” , which often also extends to matters of morality and ethics? Does this help to explain Thailand’s short-cut mentality and ubiquitous petty corruption? Might this explain the sexual deviance found in Japan? And the prudery in the untidier parts of the world?

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

The Quest for a Linux Blog Editor

Blogging Software, Linux No Comments »

Many have tried, all have failed (at least to meet some or most of their expectations); in the quest to find a decent and feature-rich native Linux desktop blog editor, anything that can match the outstanding and free Windows Live Writer. The latter of course won’t run on Linux via Wine, unlike another option: After a long and arduous install/try/remove cycle with most Linux blog editors, I have to agree with this article: in the end you’ll end up with BlogJet and install it this way:

As first suggested here for Zoundry, it works with BlogJet as well and is endorsed by its creator: Get IEs4Linux and from WITHIN IE go to File>Open [All Files] and run the downloaded BlogJet installer:

Blogjet_linux

 Not sure if you’ll need the mfc42.dll file as suggested in the Zoundry article. After a quick install you’ll have a fast and well-designed blog editor on your Linux system which is almost as good as Windows Live Writer at most everyday blogging tasks.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Gitosis and Capistrano: unable to chdir or not a git archive

Capistrano, Git, Ruby on Rails 1 Comment »

First and foremost, read this document and follow it meticulously. If you get this error:

unable to chdir or not a git archive
fatal: The remote end hung up unexpectedly

after running

cap deploy:cold

you might have to add the public key of the deploy user you set up with

set :user, “deploy”

in your capistrano deploy.rb file, to the /home/git/.ssh/authorized_keys on the REMOTE server.

Of course gitosis has a special process managing the keys and users from the LOCAL machine in the ~/gitosis/gitosis-admin directory, so you to have copy the public key you generated for the deploy user on your REMOTE server via

ssh-keygen -t rsa

to your LOCAL machine (via scp or cut and paste into a new deploy.pub file from the ssh shell for example) and then proceed as outlined here (under “Adding Users”):

cd ~/gitosis/gitosis-admin
cp ~/deploy.pub keydir/
git add keydir/deploy.pub

Add the user credentials to the gitosis.conf file:

[group myrailsteam]
writable = myrailsapp
members = deploy

Finally run

git commit -a -m “Granted deploy user access rights to myrailsapp”
git push

Now the cap deploy:cold should work (with one fewer errors that is ).

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]