Archive for June, 2008

niceshaper class file generator

Because I found rather impossible to write almost 100 entries into my class.ns file (form niceshaper 0.6), I did really easy oneliner to to this :)… proof of concept, but you can easly use it.

for i in `seq 10 100`; do echo -e “class download eth1 computer$i \n match dstip 192.168.2.$i \n htb prio 2 \nclass upload eth0 computer$i \n match srcip 192.168.2.$i \n htb prio 2 \n”; done >> class.nc

and the output simple output looks like this (one entry)

class download eth1 computer11
match dstip 192.168.2.11
htb prio 2
class upload eth0 computer11
match srcip 192.168.2.11
htb prio 2

you need explanation? OK…

seq x y - make sequential output from x to y, so if your IP class is from 22 to 38 change it to seq 22 38

everything else is based at number generated from seq so the computerXX identifier is same as its end of IP address, which for me is not a big problem, but there is no problem to take an entries form cat users.txt

Tags: , ,

Wednesday, June 18th, 2008 Linux, Tips, cribs 3 Comments

sync mount flag # UPDATED

I have an usb disk, quite quick, because it is WD MyBook… I mounted it with sync flag, because I want to have every data synced in case of power down or sth, but it was extremally slow!

# dd if=/root/plik of=/mnt/usb-disk/test.plik
1503+0 records in
1503+0 records out
769536 bytes (770 kB) copied, 20.2588 s, 38.0 kB/s

without sync flag:

# dd if=/root/plik of=/mnt/usb-disk/test.plik
3420160+0 records in
3420160+0 records out
1751121920 bytes (1.8 GB) copied, 59.4326 s, 29.5 MB/s

so i added a sync to the end of my backup script and it is really faster!

— UPDATE :)

OK… because I was not exact in my tests… and it was quite unprofessional…

two test files (to be sure that nothing has been cached in ram):

# dd if=/dev/urandom of=/root/file.test bs=1M count=200
200+0 records in
200+0 records out
209715200 bytes (210 MB) copied, 61.2699 s, 3.4 MB/s

# dd if=/dev/urandom of=/root/file2.test bs=1M count=200
200+0 records in
200+0 records out
209715200 bytes (210 MB) copied, 61.3002 s, 3.4 MB/s

one drive:

Vendor: WD Model: 7500AAC External

formated with ext3 FS,

TEST 1:
/dev/sde1 on /mnt/usb-disk type ext3 (rw)

mounted without sync flag… so the test will be:

# time dd if=/root/file.test of=/mnt/usb-disk/file1; sync
409600+0 records in
409600+0 records out
209715200 bytes (210 MB) copied, 4.13321 s, 50.7 MB/s

real 0m8.887s
user 0m0.184s
sys 0m3.536s

TEST 2:
/dev/sde1 on /mnt/usb-disk type ext3 (rw,sync)

now the test with sync flag
I know that it is quite not full… but I give up after 18 minutes…

# time dd if=/root/file2.test of=/mnt/usb-disk/file2
94360+0 records in
94360+0 records out
48312320 bytes (48 MB) copied, 1127.69 s, 42.8 kB/s

real 18m48.073s
user 0m0.000s
sys 0m0.192s

Tags:

Wednesday, June 18th, 2008 Tips, considers No Comments

simple password generator

My own oneliner… a password generator:

tr -cd a-zA-Z0-9 < /dev/urandom | head -c 8

generates the random output and in this example show first 8 signs

example:

$ tr -cd a-zA-Z0-9 < /dev/urandom | head -c 8
GVGlkDw3

Tags:

Monday, June 16th, 2008 Tips, cribs No Comments

security model in polish companies

how security model looks in polish conditions, God save but sometimes like this:

security model

By Clay Bennett

and how simple it should be:

true security model

by White Gold Solutions

Tags:

Sunday, June 15th, 2008 Security, considers No Comments

litany :)

litany

never ever :)

Tags:

Friday, June 13th, 2008 Personal No Comments

my new bootsplash

How do you find my new bootsplash? It is based on u-fingerprint …

u-fingerprint usplash

It’s looks really eye-catching :)

Tags: ,

Wednesday, June 11th, 2008 Linux, Tips No Comments

problem with brocade4Gb web tools

I have some problem with starting a Web Tools from Brocade 4Gb SAN Switch Module (for IBM BladeCenter). Every time i tried to start, I got a message:

Brocade 4Gb error Web Tools

Initializing switch details …

This problem can be overcome by change the regional settings for the operating system to English and re-load Web Tools. Other supported language are: English, Brazilian, Portuguese, French, German, Italian, Japanese, Korean, Traditional Chinese, Simplified Chinese or Spanish. Enjoy!

Tags: , ,

Wednesday, June 11th, 2008 IBM, Tips No Comments

Unknown blade type

In IBM BladeCenter management module (MM) I found imposible to power on the blades, WHY?

The info was like this:

Unknown blade type. Blade 1 is not ready for management.

The answer is that I have 8853 TYPE Blade Servers and rather old MM firmware

Tags: ,

Monday, June 9th, 2008 IBM, Tips No Comments

make a picture index from your photo gallery

You have a lot of photos, and you would like to make a photo index, but you don’t have any professional photo program. But you have console and imagemagick… It couldn’t be easier ;)

So I have 6 photos (all 1024×768):

and i want to make one jpg with all of them in mini size, just execute in dir that contains this jpgs:

montage -trim -tile 3×2 -background black -geometry 400×320+0+0 *.jpg out_%d.jpg

and here is the effect:

tile - how much rows and colums you need

geometry - one miniature size

%d - mean that if you have more than 40 miniatures than it will make next file starting from 0 to… infinity ;)

Tags:

Sunday, June 8th, 2008 cribs No Comments

adding text to photos from commandline

Imagemagick is kind of stuff that everybody knows from name, but almost nobody know how to use. If you want to generate some text at your photos, change size, add watermark or whatever you want to do with picture (with no need to see this picture), or make some script that automaticaly add something to picture you have to use imagemagick :)

One of my ideas is to make a scripts which add a date to picture, like this:

montage -geometry +0+0 -background gray -label “`date`” source.jpg destination.jpg

power 6

more can be found here

Tags: ,

Sunday, June 8th, 2008 Tips, cribs No Comments