howto

24th February
2008
written by Nick Anderson

This is more or less going to be an addendum to my last post as well as an update to my previous screenrc post. About 5 minutes after posting I realized that my additions to my prompt broke some new additions to new screenrc settings.
(more…)

24th February
2008
written by Nick Anderson

I spend a lot of my time sitting in front of terminals if you have not yet guessed. When dealing with different user accounts across different systems and a plethora of terminals open its nice to have a bit of information about who you are, and where you are. I also like to be able to easily differentiate output from different commands. If your interested read on.
(more…)

12th February
2008
written by Nick Anderson

I generally don’t have any issues knowing someone might be snooping on a bit of my traffic. However there are times you may want your traffic to be a bit more private. For example if your boss is a raging tyrant and your looking for a new job, and you know the sky would fall if he found out you emailed or happened to be on Career Builder or for that matter had even the slightest idea of abandoning him. Yes I am recounting something from my past, hey at least its distant past :). So if you find yourself in that situation read on for how to use tsocks and ssh as a simple proxy.
(more…)

11th February
2008
written by Nick Anderson

SSH is a powerful tool. When combined with ssh keys, it becomes easy to automate remote procedures like backups. However leaving key access wide open can be a bad idea. It is possible to use restrict ssh keys to specific commands, even coming from specific hosts. There is this nice little perl script called Authprogs that makes this somewhat easier. Ill show you how to use authprogs for an automated rsync over ssh.
(more…)

10th February
2008
written by Nick Anderson

This guide will walk you through installing Zabbix 1.4.4 from source on debian etch. 1.4.4 has many improvements over what is currently available in apt, and its not hard so you might as well do it this way. *Note: this walkthrough assumes that you will be running the zabbix database on the same machine as the frontend. You dont have to obviously, just do the mysql setup on whatever db server you are using and point the necessary things to it.
(more…)

9th February
2008
written by Nick Anderson

Have you ever forgotten the root password on one of your MySQL servers? No? Well maybe I’m not as perfect as you. This is a quick h00tow (how to) reset your MySQL root password. It does require root access on your server. If you have forgotten that password wait for another article.
(more…)

7th February
2008
written by Nick Anderson

Printing is a pain. I hate printers, I hate paper, but I also hate a bagillion book marks to places and things that may change over time. Its handy to have PDFs around as they are easily searchable, they preserve original layout and they print correctly when you want to print something. So for most of my printing I am printing to PDF and if I need a paper copy later I can always print out that PDF. True many applications can print or export to pdf currently. However using cups-pdf allows you to print to pdf anywhere you can print. Its great when combined with RDP too. For example at one point a freind of mine had to use GreatPlains for parts and order accounting in a production enviornment. GreatPlains allows you to print to screen in only some windows. However with cups-pdf he could print any screen he wished to pdf and view it on his screen.
(more…)

Tags: , ,
7th February
2008
written by Nick Anderson

If you have ever had an issue with vmware or if you have been afraid of using vmware for fear that if something goes horribly wrong you may not be able to extract the information from your vmware image then this information should help you.
(more…)

Tags: ,
20th July
2007
written by Nick Anderson

Yes its been a while since I have checked in. Sorry I’ve just been too busy. But I have a great tip this time. Recently I had the need to do automatic session logging. A 3rd party was going to be logging into one of my servers to check out some software glitches that were happening. I love using GNU Screen for many shell tasks so using it for monitoring was logical. Screen is great for several reasons. First you can detach from it so you can leave the office, go home and re-attach and not have lost your place. Second, you can share another screen. It can be shared input or you can just watch what someone else is doing. Finally screen can do native logging. I wanted to automattically launch a screen session when somone logged in so if I happened to be on the server I could monitor them in real time. I also wanted a log of the session in case I wanted to look over it later or if I was not able to monitor the session live.
(more…)

4th September
2006
written by Nick Anderson

I am in the process of setting up one of my new servers. Yes my old dual pIII machines are going to retire. They are going to live in a “retirement community” :P. Any way This time around I am going to use a mirror to protect my data. I never experienced a hardware failure before but I figure better safe than sorry right? So I am going to outline the steps needed to boot from a RAID0.

 

modprobe raid1
mknod /dev/md1 b 9 1
mknod /dev/md2 b 9 2
mknod /dev/md3 b 9 3

Now setup your /boot swap and / partitions on your first disk (I will assume sda). After you have created your partitions we need to make the second drive partition table match. (I assume your drives are the same size)

 

sfdisk -d /dev/sda | sfdisk /dev/sdb

Now we need to create the raids using mdadm

 

mdadm --create --verbose /dev/md1 --level=1 \
--raid-devices=2 /dev/sda1 /dev/sdb1
mdadm --create --verbose /dev/md2 --level=1 \
--raid-devices=2 /dev/sda2 /dev/sdb2
mdadm --create --verbose /dev/md3 --level=1 \
--raid-devices=2 /dev/sda3 /dev/sdb3

Or if you are lazy like me

 

for i in `seq 1 3`; do mknod /dev/md$i b 9 $i;\
mdadm --create /dev/md$i --level=1 --raid-devices=2\
/dev/sda$i /dev/sdb$i; done

Backup your raid config

 

mdadm --detail --scan >> /etc/mdadm.conf

You can monitor the status of your raids via /proc/mdstat

 

watch -n .1 "cat /proc/mdstat"

Once the raid is done syncing you need to create your file systems on your md devices and proceed with the normal install routine. You need to do a bit of extra work when installing grub to make sure its installed on both devices, as well as allows you extra options in case of raid failure.

 

grub>device (hd0) /dev/sda
grub>root (hd0,0)
grub>setup (hd0)
grub>device (hd0) /dev/sdb
grub>root (hd0,0)
grub>setup (hd0)

grub.conf

default 0
timeout 30
splashimage=(hd0,0)/boot/grub/splash.xpm.gz  

title=Gentoo (2.6.17-gentoo-r7)
        root (hd0,0)
        kernel /boot/vmlinuz-2.6.17-gentoo-r7 root=/dev/md3  

title=Gentoo (2.6.17-gentoo-r7) [mirror recovery]
        root (hd1,0)
        kernel /boot/vmlinuz-2.6.17-gentoo-r7 root=/dev/md3

 
 
 [backdated from old website]

Tags: ,
Next