Welcome
 

Making volume labels

Monday, May 12th, 2008 Comments Off

I always forget how to make a volume label. Here is a page that rounds up various methods for different filesystems:

www.debuntu.org/device-partition-labeling

The part on labeling FAT filesystems is not quite right. It works, but there is a better way. First make sure you have the debian package “mtools” installed:

To see if there is a label already there:
sudo mlabel -i /dev/device -s ::

To write a new label:
sudo mlabel -i /dev/device ::newlabel

In the place of “/dev/device” you should use something like “/dev/sdd1″.

 

netcat tricks

Monday, August 13th, 2007 Write a Comment

I have always liked netcat, but I never really use it at work. But I always feel like I should. Here is a wonderful list of things you may be able to use netcat for:

useful-netcat-tricks

Looking at the comments of that blog I saw another cool thing to do involving network transfer of files. It introduces a utility I didn’t know about before called lzop. It goes something like this:

On the sending computer…

dd if=/home/me/my_file | lzop | nc 192.168.0.1 9000

On the receiving computer…

nc -l -p 9000 | lzop -d |dd of=/someplace/my_file

So, the sending computer uses dd to pipe the file to lzop (which compresses it) then pipes it to netcat. The receiving computer gets the file via netcat, pipes it to “lzop -d” to decompress it, and finally dd gets it and writes it to disk. With lzop providing compression the transfer should go pretty quick. If the file compresses easily. Lzop is preferred in this case because it is supposed to much quicker than gzip, so it doesn’t get in the way while doing its thing.

A potential downside to sending huge files is that you have no progress meter. I suppose you can do a ls from time to time to judge when the file transfer will be done.

I have not tried any of this yet…

Killing web sites with JMeter

Tuesday, May 15th, 2007 Write a Comment

This looks like something we can use here:

Apache JMeter may be used to test performance both on static and dynamic resources (files, Servlets, Perl scripts, Java Objects, Data Bases and Queries, FTP Servers and more). It can be used to simulate a heavy load on a server, network or object to test its strength or to analyze overall performance under different load types. You can use it to make a graphical analysis of performance or to test your server/script/object behavior under heavy concurrent load.

Debian Linux VLAN musings

Thursday, May 10th, 2007 Write a Comment

I am getting a network monitoring server ready. This server will need a direct connection to all of our subnets. This is not too hard because I can use multiple VLANs within one physical interface.

What was hard was finding authoritative documentation for VLANs on Debian. Maybe I was looking in the wrong places (google), I don’t know. It turns out it is a simple procedure. Finding the info and experimenting took all the effort.

First you install the “vlan” package so you will have the utilities needed to manipulate VLANs:

apt-get install vlan

Then you define your VLAN interfaces in /etc/network/interfaces like so:
auto vlan2
iface vlan2 inet static
vlan_raw_device eth0
address 192.168.22.20
netmask 255.255.255.0
network 192.168.22.0
broadcast 192.168.22.255
gateway 192.168.22.1

UPDATE:
Well that project crashed and burned. It turns out that I am limited by the switch. It is necessary to use port mirroring on the switch so that the monitoring server will get all the network traffic from the other servers. With the switch I have (HP 4104gl) you can only mirror ports that are on the same module as the monitoring port. The switch has four modules, with servers populating all four. So that restricts things quite a bit. Too much to make it worth it in fact.

At least I figured out that I don’t need to use VLANs for monitoring (it was a good learning experience though).

HP/Proliant Installer Compatibility Table

Wednesday, May 9th, 2007 Write a Comment

This is a really cool thing:

HP/Proliant Installer Compatibility Table

It lists what Debian works on what HP servers. This should save a lot tears and moaning.

Update: Holy crap, HP has a page for Debian compatibility too!

HP and Debian GNU/Linux

Blade servers are a go. Freaking cool.

This model works great with Etch, apparently:

installation-report: HP ProLiant DL145 G3

Making SSL certificates with Debian Etch

Wednesday, May 9th, 2007 2 Comments

Debian Etch has a nice wrapper script for creating certificates with openssl. Is is called make-ssl-cert and has a syntax like so:

make-ssl-cert template output-certificate [--force-overwrite]

An example of a SSL template can be found here:

/usr/share/ssl-cert/ssleay.cnf

I got this from reading a blog entry here: SSL + Apache2.2 + VirtualHost + Debian with automatically HTTPS forwarding

Bash Shell Keyboard Shortcuts

Monday, April 2nd, 2007 Write a Comment

This was surprisingly useful. There are a hell of a lot of keyboard shortcuts available for bash. I only knew a few of them!

Bash Shell Keyboard Shortcuts

The meat of the actual article after the jump…
Read the rest of this entry…

Exporting a MySQL table to a CSV file

Tuesday, March 20th, 2007 Write a Comment

A little trick I found on the net. The example I found was wrong, so I will show the working version. First the original web page:

http://www.debianadmin.com/…

Now the meat:
mysql database -e "SELECT * FROM table" | sed 's/\t/","/g;s/^/"/;s/$/"/' > yourfile.csv

A little explanation. When you use “-e” with mysql there is an implicit “-B”. That means your output is delimited with tabs. Then sed does these things:

  1. Change all the tabs to “,”
  2. Add a ” to the beginning of each line
  3. Add a ” to the end of each line

Voila! You have a CSV file. Have a ball.