Archive for the ‘Linux’ Category

Uninstalling KDE or Gnome from Gentoo

Wednesday, January 13th, 2010

Using ‘eix’ it becomes quite easy to construct a search command listing all the packages currently installed for a given category.

In my case, I wanted to unmerge (remove) all KDE and Gnome desktop packages from my Gentoo system, as I’ve been using it only as server for several years now.


# generate a list of gnome-base packages you have installed
eix -C gnome-base --only-names --installed

#send it to emerge once  you've got it
sudo emerge --ask -C `eix -C gnome-base --only-names --installed`

The ‘-C’ flag is the category base (ie: gnome-base or kde-base) — the other arguments should be obvious. You can always type ‘man eix’ for the specifics.

It’s a good idea to run ‘revdep-rebuild’ after removing packages as well.


sudo revdep-rebuild
VN:F [1.8.4_1055]
Rating: 10.0/10 (1 vote cast)
VN:F [1.8.4_1055]
Rating: 0 (from 0 votes)

Logging IRSSI and Rotating them with Logrotate

Tuesday, September 8th, 2009

I’ve often wanted to look back at chat logs. Below are a few simple steps you can take to enable logging in IRSSI and add the log files to the logrotate daemon.

Make irssi log all chat windows:


# Create the directory
$ sudo mkdir /var/log/irclogs
$ sudo chown username:users /var/log/irclogs

#in IRSSI window
/SET autolog ON
/SET autolog_path /var/log/irclogs/$tag/$0.log
/save #answer 'yes'

#verify chats are logged (grouped by hostname)
$ ls /var/log/irclogs
freenode

Tell logrotate to auto-rotate them:


$ sudo vi /etc/logrotate.d/irssi

#paste into editor
/var/log/irclogs/*/*.log {
  copytruncate
  compress
  notifempty
  missingok
}

Test that log rotation works for a channel (ie: #xml on freenode):


$ sudo /usr/sbin/logrotate -d /etc/logrotate.conf
$ sudo /usr/sbin/logrotate -f /etc/logrotate.conf
$ cd /var/log/irclogs
$ ls -R
./freenode:
#xml.log  #xml.log.1.gz
VN:F [1.8.4_1055]
Rating: 4.0/10 (2 votes cast)
VN:F [1.8.4_1055]
Rating: 0 (from 0 votes)

Useful Debian Command Tip

Monday, June 29th, 2009

I learned a few new commands that I haven’t used before:

To find a list of possible locations for a given application (in this case I choose “apt” which isn’t really a binary by itself, but rather a directory name used by “apt-get”.


$ whereis apt
apt: /etc/apt /usr/lib/apt /usr/share/apt /usr/share/man/man8/apt.8.gz

$ whereis apt-get
apt-get: /usr/bin/apt-get /usr/X11R6/bin/apt-get /usr/bin/X11/apt-get /usr/share/man/man8/apt-get.8.gz

Very cool for finding things quickly. If you didn't catch what the output is, it is a simple space-delimited list of matches following the application name.

VN:F [1.8.4_1055]
Rating: 0.0/10 (0 votes cast)
VN:F [1.8.4_1055]
Rating: 0 (from 0 votes)