Category Archives: Ubuntu

Enable transmission-daemon logging to file

If you use transmission-daemon on your Raspberry Pi and want to have logs to a file, you can follow a few simple steps to accomplish this:

Edit the service file:

sudo vim /lib/systemd/system/transmission-daemon.service

Change the ExecStart line to look like this:

ExecStart=/usr/bin/transmission-daemon -f --log-debug --logfile /var/log/transmission.log

You can choose between these options:

--log-error
Show error messages
 
--log-info
Show error and info messages
 
--log-debug
Show error, info, and debug messages

systemctl will complain that the service file was changed. Run:

sudo systemctl daemon-reload

to reload units.

Create the log file and assign the correct ownership and permissions:

sudo touch /var/log/transmission.log
sudo chown debian-transmission /var/log/transmission.log
sudo chmod 644 /var/log/transmission.log

Restart the service:

sudo service transmission-daemon restart

Have fun!

Add syntax color to crontab editor

You might be wondering why you don’t have syntax coloring when you are editing crontab entries.
This can be solved very simply by specifying your editor before starting crontab:

export EDITOR=vim

The change can be made persistent across the whole system if you add that line on the /etc/bashrc file.
You you only need this change for certain users only, add the line to their local ~/.bashrc files.

Set default gnome terminal size in Lucid Lynx

Use these commands to change the default gnome terminal size:

gconftool-2 --set /apps/gnome-terminal/profiles/Default/default_size_columns \
--type integer 160
gconftool-2 --set /apps/gnome-terminal/profiles/Default/default_size_rows \
--type integer 50

XMLStarlet: command line XML toolkit

XMLStarlet is a set of command line utilities (tools) which can be used to transform, query, validate, and edit XML documents and files using simple set of shell commands in similar way it is done for plain text files using UNIX grep, sed, awk, diff, patch, join, etc commands.

This set of command line utilities can be used by those who deal with many XML documents on UNIX shell command prompt as well as for automated XML processing with shell scripts.
Ubuntu allready has it in the repos, so issue the following command in your terminal to install it:

sudo aptitude install xmlstarlet

Vacuum your Firefox 3

This tip will hopefully speed up your Firefox 3 by optimizing it’s database.
Firefox stores your browsing data using SQLite – self contained, small footprint database.
Having database store your browsing data has one drawback, you have to optimize the database from time to time to get rid of old, deleted data, re-index the columns etc.
Otherwise you keep all the junk data mixed in with your real data.
In SQLite is the statement to do this called VACUUM. So here’s how to vacuum your Firefox:

1. Download sqlite command line client for your platform. In Ubuntu, go to yout terminal and issue the following command:

sudo aptitude install sqlite3

2. Turn off your Firefox
3. Go to your profile folder
4. Issue the command:
* For Linux

for i in *.sqlite; do echo "VACUUM;" | sqlite3 $i ; done

* For Windows

for %i in (*.sqlite) do @echo VACUUM; | sqlite3 %i

Enjoy!

Turn off or limit the Recent Documents feature in Ubuntu

If you want to turn off the Recent Documents feature in Ubuntu, all you have to do is create a .gtkrc file in your home directory.

touch $HOME/.gtkrc-2.0

Then add gtk-recent-files-max-age=0 to this file.

echo 'gtk-recent-files-max-age=0' | tee -a $HOME/.gtkrc-2.0

This is documented here.
This will also work in any other linux distribution running Gnome.
Enjoy!

Ubuntu One coming to Windows

At PyCon 2010, Ubuntu One development team will focus on helping Ubuntu users who also use a Windows box. This is great news!
Source.

Disable splash screen in Ubuntu 9.10 Karmic Koala

You can disable the splash screen and instead view details about your boot process by following the next steps:
1. Edit grub

sudo vi /etc/default/grub

2. Locate the following line

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

and remove quiet and splash.
After that, the line should look like this:

GRUB_CMDLINE_LINUX_DEFAULT=""

3. Save and exit.

:wq

4. Now update the grub:

sudo update-grub

That’s it!

Karmic Koala Beta on ThinkPad T61 (continued)

After the latest updates, enabling touchpad on/off key (fn-f8) is now working. There are some annoying gdm random restarts without a trace in the logs. I suspect it’s the nvidia proprietary driver and I hope it will be fixed soon.
Here is a better approach to enable the Active Protection System in your ThinkPad:

# Install HDAPS - IBM Active Protection System Linux Driver
sudo cp /etc/modules /etc/modules_backup
sudo aptitude install tp-smapi-source
sudo module-assistant prepare tp-smapi
sudo module-assistant auto-install tp-smapi
sudo modprobe tp-smapi
sudo aptitude install hdapsd
echo 'tp-smapi' | sudo tee -a /etc/modules

Search and remove duplicate files

Here a small piece of code which will search for the duplicates in the path you supply. It will generate a new file which contains the commands for deleting those duplicates.
Make sure you double check the resulting file!
The script requires that you have fdupes installed.
Install it in Ubuntu/Debian by running the following command in your terminal:

sudo aptitude install fdupes
#!/bin/bash
 
OUTF='rm-dups.sh'
echo "#!/bin/bash" > $OUTF
fdupes -r -f $1 | sed -r 's#(.+)#rm '\"'\1'\"'#' >> $OUTF
chmod +x $OUTF

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close