The iproute2
package offers the ip
utility, which is a modern replacments for tools such as ifconfig
, route
, arp
and more. It allows to configure addresses, links route and arp tables. The only problem is that its documentation can be quite confusing. This post is intended to be a task-oriented guide to this utility, it’s far from complete and I intend to update it from time to time.
Continue reading iproute2
Cheatsheet
Category: Tips
Kernel Configuration and nvidia-drivers
This is more of a note to myself, as I keep forgetting this. The propriety NVIDIA drivers, provided by the x11-drivers/nvidia-drivers
dislikes alternatives. It will refuse to build against a kernel with the rivafb
(CONFIG_FB_RIVA
) and nvidiafb
(CONFIG_FB_NVIDIA
) built in or built as modules. Both can be found (and unset) under:
Device Drivers
-> Graphics support
-> nVidia Framebuffer Support
-> nVidia Riva support
sudo
for X Programs
By default (at least on my machine), it wasn’t possible to open X applications using sudo
. For example sudo
ing xclock
resulted in the following error:
$ sudo xclock
No protocol specified
Error: Can't open display: :0.0
The same error appeared even when I executed xclock
after running sudo su
.
Continue reading sudo
for X Programs
Eject Your Kindle and Reconnect under Linux
I am Your User suggested a method to eject your Kindle in Linux. While his method works, you don’t need to specify the partition number. E.g.
$ sudo eject /dev/sdd
where /dev/sdd
is the device file of the Kindle.
But what if you want to reconnect it back without plugging in and out the usb cable? You can add the -t
switch.
$ sudo eject -t /dev/sdd
Even though it prints the following error:
eject: CD-ROM tray close command failed: Input/output error
it works, and the Kindle reappears in KDE.
Deleting Comments from Tickets in Trac
Spammers apparently love Trac. After trying to fighting spam tickets and later installing the SpamFilter plugin, I’ve managed to control spam tickets in the Open Yahtzee Trac site.. But now spammers started spamming in the ticket comments. The bad news is that Trac (at least in version 0.11) doesn’t have built-in facilities to completely remove ticket comments.
URL-Safe Timestamps using Base64
Passing around timestamps in URLs is a common task. We usually want our URLs to be as shortest as possible. I’ve found using Base64 to result in the shortest URL-safe representation, just 6 chars. This compares with the 12 chars of the naive way, and 8 chars when using hex representation.
The following Python functions allow you to build and read these 6 chars URL-safe timestamps:
Continue reading URL-Safe Timestamps using Base64
Using MusicBrainz when Ripping CDs in KDE
I guess this tip is Gentoo specific. By default KDE uses FreeDB for getting CD info when ripping CDs. If you want to use MusicBrainz native service (not via their FreeDB proxy), there are several steps you’ll need to take.
Continue reading Using MusicBrainz when Ripping CDs in KDE
Disable Touchpad Tapping in Kubuntu
In Ubuntu (gnome) there is an easy graphical way to disable tapping on the touchpad. However, KDE lacks such thing. But lacking graphical configuration doesn’t mean this should be difficult. All you need is the gsynaptics
package. The package provides a small utility called synclient
. Now you can disable tapping by doing
synclient TapButton1=0
To disable the tapping permanently you should use the following to run the command at the start of every KDE session.
echo "synclient TapButton1=0" > ~/.kde/env/disable-tapping.sh
Using Duplicity and Amazon S3 – Notes and Examples
Up until now I’ve been doing my backups to Amazon S3 using my s3backup
script. While it’s simple and does what I needed at the time, I’ve decided to cut some of the costs by switching to incremental backups.
Continue reading Using Duplicity and Amazon S3 – Notes and Examples
Blocking IP Range using UFW
Uncomplicated Firewall (ufw
) is one of the greatest frontends to IPTables I’ve encountered. It is very simple to use and I just wish it was also available for Gentoo. Up until recently everything went smoothly for me and ufw
, but we hit some rough waters when I’ve tried to block an IP range.
To block an IP or IP range in ufw you should do
sudo ufw deny from 188.162.67.197/21