Tuning Swap Usage with Linux

No Comments

Those of you with lots of RAM could benefit from this tweak. There is a value controlled by sysctl called “vm.swappiness”. This is a value from 0-100 which tells the system how aggressively to use the swap space on your system.

Setting this value to 0 will tell the system to avoid writing anything to swap if at all possible, and a value of 100 will have your system almost immediately write out your memory to a swap file.

The default on Ubuntu and most other Linux systems is 60. If you don’t have more than 1GB of RAM I would not recommend altering this value. On my workstations with 2GB of RAM or more I usually go 10 or 0.

To set the swappiness value:

sudo sysctl vm.swappiness=10

To make the change stick after reboots, edit /etc/sysctl.conf with your favorite editor, and add the line “vm.swappiness=10″ if it does not already exist.

Dear Adobe

No Comments

Please make a version of your flash player for Linux that doesn’t totally blow. Thank you, that is all.

Since we’re on the subject, could we also move a little faster with the HTML5 + Ogg video?

Quick and Dirty IP Scan

No Comments

Here’s a quick, dirty, and not 100% reliable command to tell you which IPs in a range are in use:

nmap -sP 192.168.1.1-254

The above example will scan the range of 192.168.1.1 – 192.168.1.254, and will give you a result something like this:

Host (192.168.1.1) appears to be up.
Host (192.168.1.2) appears to be up.
Host (192.168.1.14) appears to be up.

Corrupt InnoDB Fix

No Comments

If MySQL won’t start due to corrupt InnoDB tables, you can add
[mysqld]
innodb_force_recovery = 4

to the /etc/my.cnf file, and restart MySQL. This will allow MySQL to start even with the corrupt InnoDB tables. I’m not quite sure if this fixes the tables or merely allows MySQL to run despite the warnings.

More Info

List Installed Packages w/ Ubuntu

No Comments

This trick comes in real handy if you need to reinstall your Ubuntu/Debian system, or install your preferred software automatically with a fresh install.

From the system with your desired software:

    dpkg --get-selections > mysoftwarelist.txt

To the reinstalled or fresh system:

    dpkg --set-selections mysoftwarelist.txt
    sudo dselect

Laser Plugs?

No Comments

Apparently Ford is testing a new system where instead of standard spark plugs for ignition in automotive engines, they use frickin’ laser beams. I’m not sure how effective this system would be after time due to gunk building up no the laser lens, but still a pretty cool idea.

Link

Block a single IP address

No Comments

As super user:

iptables -I INPUT -s 1.2.3.4 -j DROP

Boxee Media Center

No Comments

There’s a new media center software called Boxee, which is based upon the XBMC platform, and is being actively developed, and supported by Mozilla.

I have been playing around with it, and at this early stage, pretty impressed. The amount of plugins to pull content from various internet sources is impressive, and they are generally high quality. Looks good on my HDTV as well, with readable text from typical distances.

Oh, and it’s cross platform too. Check it out.

http://boxee.tv

Blocking Failed Login Attempts

No Comments

If you ever take a look at your server logs, you know there are tens of thousands of consecutive failed login attempts from various IP addresses. Even though the chances of success of these brute force login attempts is rather low, why gamble?

A quick and easy way to address this problem is BlockHosts. It is a simple Python script which will scan logs and block IPs based on a configurable number of failed login attempts and time thresholds. Cron the script to your taste.

http://www.aczoom.com/cms/blockhosts

Fix Exim “Error while creating mbox spool file”

No Comments

Sometimes the files and directores in /var/spool/exim/scan do not get purged, which leads to the inability of the system to create new files and directories in this location.

  1. Stop Exim
  2. Move to /var/spool/exim/scan
  3. Delete all files in above directory- ‘ls -l | xargs rm -rf’
  4. Start Exim

Problem solved.

Newer Entries