Category: GNU Linux

Richard Stallman Sings The Free Software Song

YouTube Preview Image

RMS came to Vancouver recently for a series of talks about Free Software. At the Vancouver Maritime Centre on Feb 6, he joined the opening , Creaking Planks, to sing the Free Software song.

KDE4 Killing the Linux Desktop

KDE is a desktop system, used on a few flavors of linux such as in SUSE and Ubuntu, especially the kde4 flavored release of Ubuntu, known as Kubuntu for the new release, 8.10, Intrepid Ibex. I was just stunned at its lack of services and I dont understand the choices they are making in developing this. I think somebody has really jumped the gun in releasing this software way before its time. I was loving kde 3.5 it had all I needed. But KDE4 is a clusterFxxk. Its the Vista of Linux Desktop now. But I am just left wondering why they ever would have done this to all the loyal Linux Desktop fans out there.

  • Dolphin file manager sucks, has fewer features than Konqueror, and has a wierd click and select to open default which is just mysterious.
  • Simple problems copying files in from a thumb drive or even from one directory or another
  • no screen savers
  • no desktop backgrounds supplied bas
  • cant have separate backgrounds for desktops
  • no intuitive way to place application icons on the application bar
  • no way to tweak terminal or not very much
  • plasma widgets act weird
  • kde4 claims to be a bit more efficent on memory, but maybe its because there are fewer features. Actually, it runs pretty leaky.
  • advanced effects killed my display pretty quickly
  • makes my nvidia card driver flicker ever 10 seconds – envyNG fixed that…

Its just a real shame to take a community of the most loyal software users out there and kick them in head.

from a quick web search, there are lots of folks who are really frustrated and not a lot that are wow about it. Im going back to GNOME. At least it had features. And ah aint goin’ back until its got stuff I use. Like moving files from one folder to another successfully the first time.

If we are going to be your beta testers, then tell us ahead of time, please guys?

Edit a line in all php files in a directory with find and sed

Here is about the simplest example I could come up with, to change a reference to a new include directory location in a codebase.

You can of course do fancier things should you wish to dump your results to a directory before overwriting your files.

#!/bin/sh
for files in `find *.php`
do
sed ‘s/..\/..\/adminincl/includes/g’ $files > ‘temp’.$files && mv ‘temp’.$files $files
done

Essential Cheat Sheet of Shell Commands

Though I would add a list of shell commands I keep using as a guide to myself and others.

svn
make svn code directory, call it codebase. Put a trunk, branches, and tags directory below it. Import all that codebase under trunk. That means, the whole site. Also, make a directory for your db, and put a db dump in there. If you are running a cron, make a directory called cron, put your cron scripts in there and a text file copy of your crontab. Don’t store passwords in subversion, as in the top level file that your site uses. Make a version of the file without the passwords, call it something like config.orig.php or whatever, and check that in instead. Also, you may need the equivalent of the CVS ignore command called svn propset and make use of it.
#svnadmin create repository_directory

#svn import codebase file:///home/user/pathtorepositorydir/repository_directory -m “initial import”
check out your remote repository into your local machine at the command line:
#svn checkout svn+ssh://user@domain.com/home/user/repository_directory/trunk .
local:
#svn checkout file:///home/user/pathtorepository/repository_directory html/

now you are checked in and out, you can delete codebase directory.

svn export works in a similar way. It pulls out the files from the repository sans .svn directories.
#svn export svn+ssh://user@domain.com/home/user/repository_directory/trunk

grep
find instance and string in and below current directory, pipe it to less.
#grep -r “string” * | less

find
find all those old CVS or .svn directories, and kill them:
to look:
#find . -type d -name “.svn”
to dump to a file
#find . -type d -name “.svn” > dump.txt
when you are ready:
#find . -type d -name “.svn” -exec rm -rf {} \;

Another way to wipe out everything:
#find . -name ‘*’ -print0 | xargs -0 rm
this means find here, the name of all, dont print it to stdout, then redirect the output to as an argument that the rm command will execute on.

scp
push a file
#scp localfile.txt user@domain.com:pathtofile/remotefile.txt
grab a file
#scp user@domain.com:pathtofile/remotefile.txt localfile.txt

rsync
get all those image files
#rsync -avz user@domain.com:/home/pathtofiles/ .
ah yes, but I will get a complaint  from subversion about my directory being out of sync because what I just did was downloaded the .svn file from the server over that directory. They arent the same, so your svn update now crashes. What do do?
# rsync -avz –exclude=.svn  …….then everything else after that. More options in the man pages.

mysql
Export a db
#mysqldump -uuser -ppassword -hlocalhost dbname > db.sql
Import a db
#mysql -uuser -ppassword -hlocalhost dbname < db.sql

crontab
A crontab line should point to a .sh script. The .sh script can then execute the shell script. This enables you to use either the sleep funciton or looping constructs to run the script a multiple of times if you like, and  keeps your command to one line inside the cron.
Look at your crontab with #crontab -l edit it with #crontab -e
Crontab time examples:|
1 */3 * * *  every 3 hours, one minute after the hour. Where possible, dont run a crontab exactly on the hour, because that is when everybody else does it on a shared host. Set it for a minute after when the cpu isnt likely to be so taxed.
1 0,12 * * * every 12 hours, one minute after the hour.
*/1 * * 3/6 every minute on every third and sixth day of the week

wget
use wget to grab that tarball directly, for when you are grabbing such things off sourceforge or wherever.
# wget http://domain.com/pathtofile.tar.gz

tar
good old tape archive.
To extract:
#tar -xvvf filename.tar.gz
To archive:
# tar -czvf tarballname.tar.gz directory

screen
Got a shell connection to a dodgy host that keeps giving you the boot? after you login, run screen:
#screen -DD -R

You will still get booted, but at least you can get right back to where you were when you reconnect by replaying the above command.

mysql
you probably know mysql command line access if you are on this page. You have to know how to work with this because a database can exceed the size allowable for transfer over http, making into phpMyAdmin impossible. But a goodie that I found is that case when you want to wipe out all the tables in a db, but not the db itself, in order to preserve all the privleges, and access credentials. The following line can save a step:
#mysqldump -uuser -ppassword –add-drop-table –no-data dbname | grep ^DROP | mysql -uuser -ppassword dbname

Dansette