dufault.info

Ramblings of a phone weenie, Linux sysadmin, and other things geeky

18  08 2008

Transit directions now available via Google Maps on Windows Mobile

Apparently this was released without much fanfare, but Google Maps Mobile v2.2.0.16 for your Windows Mobile smartphone / pocketpc has been released, which means it now provides transit directions on the go.

This makes me extremely happy, but annoyed as well, as it was released quietly — I’m even subscribed to the Google Latlong blog

Give it a try, and enjoy it if you live in a supported city.


18  08 2008

Updated Android SDK released

08 2008

Billix

I  wanted to mention that I’ve been looking for something like for this a bit — a USB key that comes with a way to install multiple Linux distributions.  While at work, we primarily use Gentoo, we still have a Ubuntu server or CentOS install to do occasionally, and it would be nice to have a non-CD way of doing it.

Billix to the rescue!

This little 110MB download includes netinstalls for all of these distros: three Ubuntu installs (Feisty, Edgy, Dapper; both desktop and server editions), Debian Sarge and Edgy, Centos 5.1 and 4.6, Fedora Core 8.  It also includes memtest86+, ntpwd, and DSL (Damn Small Linux.)

Give it a try if you have a use for it!


08 2008

A Script to Optimize Fragmented Tables in MySQL

I wrote a BASH script that will run “optimize table” on any table fragmented. it’s pretty tidy, and you can supply usernames and passwords, and even run it against remote MySQL databases.

Here’s an example of it’s output:
root@lit [~]# mysqlFragFinder
MySQL fragmentation finder (and fixer) v0.7.2, written by Phil Dufault ( http://www.dufault.info/ )
Found 59 databases
Checking someforum_forum … found 1 fragmented table.
Optimizing log_online … done
Checking dufault_blog … found 2 fragmented tables.
Optimizing wp_comments … done
Optimizing wp_options … done
3 tables were fragmented, and were optimized.

I find this a great script — maybe a feature to add later is a way to prevent it from optimizing really large tables.

Here’s a link to the source:
mysqlFragFinder

Any other features you’d like to see in it? Comment!


08 2008

MySQL Tuner

I’ve been using this for the past two weeks:
MySQL Tuner

I’ve used on servers running on MySQL 4.0, or 5.1 lately to tweak their preformances.  Itt’s an awesome script, and I recommend using it on any MySQL server you can find. :)


08 2008

Making SSH connections to your frequent remote hosts faster with ControlMaster

I recently learned of a newish OpenSSH feature, a feature that let’s you reuse existing SSH connections.

If you want to enable this functionality on a per-host basis, then you can setup your ~/.ssh/config file like this:
Host *
ControlMaster no
ControlPath ~/.ssh/master-%l-%h-%p-%r.sock
Host someserver
Compression yes
ControlMaster yes

To enable it:
ssh -f -N someserver

After that, just ssh in like you would normally:
ssh someserver

Combining this with SSH keys and keychain — that’s some fast SSHing. Enjoy!

Source for this article: http://www.revsys.com/writings/quicktips/ssh-faster-connections.html


08 2008

Hotswap a SCSI, SAS, or SATA drive in Linux

There seems to be not a lot of information on Google about this, thus, I post.

At my work, the majority of our servers have hot-swappable drive bays — however, Linux doesn’t usually automatically notice the drive is gone. Worse, sometimes it doesn’t even notice new drives hooked up.

Now, SCSI and SAS both support hot-plugging on a protocol level, and SATA II does as well. If your chassis is equipped with a hotswap drive bays, then that’s all you really need. I haven’t noticed any problems with SATA I hotswaps, but they appear to be less successful.

A common task I need to do is either:

  • upgrade a drive in a server
  • replace a dying drive with a new one

If the drive is in a RAID, or if it’s a separate sized drive for a disk upgrade, it’s a good idea to trigger the kernel driver to rescan information about the new disk.

In /sys/bus/scsi/devices, you’ll find a number of numbers that’ll correspond to your disk drives:
server devices # ls -1
0:0:0:0@
1:0:0:0@
2:0:0:0@

You can determine more information about the drive by cat’ing it’s model file:
server devices # cat "0:0:0:0/model"
ST3250410AS

Now, to cause the kernel to rescan the drive attached to the port, do this:
echo > "0:0:0:0/rescan"

Check dmesg now:
server devices # dmesg
---snip---
SCSI device sda: 488397168 512-byte hdwr sectors (250059 MB)
sda: Write Protect is off
sda: Mode Sense: 00 3a 00 00
SCSI device sda: drive cache: write back

Now, that’s pretty exciting, as this can be used to skip a reboot.  If you switch the drive, and trigger the rescan, it’ll update the drive information including the partition layout.  Make sure you don’t swap out your main system drive, otherwise your computer will freeze, and there will be data loss and possibly corruption.

Sometimes, this strategy fails to work, and I don’t know why (and resort to rebooting.)  I’m currently researching how to do this a bit better, I have a buggy script that I use to improve this method, but it’s not ready for public release yet. Does anyone have a better method?  Please comment!


31  07 2008

Typespeed

It came up in IRC today that there was a typing game called typespeed — one of the categories is “Unix Commands.”  Better yet, this supports head to head networking mode, so you can play against people in your office, I didn’t even need to edit my firewall configuration on Ubuntu.

Playing your coworkers is good fun, give it a try!


26  07 2008

Installing libtidy in PHP5 on a CentOS cPanel server

To install libtidy in PHP5, it’s really quite easy.

Make sure your /tmp directory doesn’t have something like noexec set on it, otherwise this would be more difficult.

Here’s the install command:
pecl install http://pecl.php.net/get/tidy-1.2.tgz

Find where your main php.ini file is:
root@server [~]# php -i|grep php.ini
Configuration File (php.ini) Path => /usr/local/lib
Loaded Configuration File => /usr/local/lib/php.ini

Add the module to your php.ini:
$EDITOR /usr/local/lib/php.ini

You’ll need to scroll down to the extensions area, I just keep searching for extension till I find it.
Add this line:
extension=tidy.so

Save, and restart your Apache web service:
service httpd restart

Test via phpinfo(); to make sure it’s working.


25  07 2008

Sysadmin day

Today is the annual Sysadmin Day, so take the time and honour your hard working local sysadmins that keep things running.

http://www.sysadminday.com/

Update: My boss bought me lunch as a present.  Hooray!


Next Page »