chsh is great when you need to change default login shell for a lot of users.
for f in $(grep home /etc/passwd | grep -v ftp | cut -d':' -f1) ; do chsh -s /bin/sh $f ; done
You would of course have to refine the grep line to sort out accounts you don’t want to change default login shell for .
I’m optimizing some scripts that split our apache logs each night. I gotta admit Apache’s ‘split-logfile’ script written in perl is a LOT faster than doing it via f.example bash . But splitting up a log file with more than 2000 vhosts resluted in the script crashing. I had to up my ‘open files’ limit with :
# ulimit -n 4096 #
Upon testing the performance of a raid 6 array with 13 disks i wanted to check read/write performance, an easy way to do this fast on Linux (Debian) is simply using ‘time’ and ‘dd’:
bakis:/var/raid6volume# time dd if=/dev/zero of=./testingtransfer bs=16k count=16k 16384+0 records in 16384+0 records out 268435456 bytes (268 MB) copied, 1.48474 s, 181 MB/s real 0m1.513s user 0m0.008s sys 0m1.456s bakis:/var/raid6volume# time dd if=./testingtransfer of=/dev/null bs=16k 16384+0 records in 16384+0 records out 268435456 bytes (268 MB) copied, 0.156663 s, 1.7 GB/s real 0m0.159s user 0m0.004s sys 0m0.160s bakis:/var/raid6volume#
The ‘read’ test above isn’t real since the file has been cached . But a rsync is working in the background so I couldn’t umount /var/raid6volume for this example.
Initially I was doing this to test performance over nfs for the same array, one has to umount / mount the share between each test to make sure nothings in the cache.
Working with nfs, tuning wsize and rsize on the client side also gives a lot better performance (at least in my case), see the link bellow for more info.
I got these hints from debianhelp.co.uk
Nice command to find how much ram my graphics card has. Use ‘lspci’ to get the pci id and throw it back to lspci like this:
joar@juno:~$ lspci | grep VGA 00:02.0 VGA compatible controller: Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller (rev 09) joar@juno:~$ lspci -v -s 00:02.0 00:02.0 VGA compatible controller: Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller (rev 09) Subsystem: Lenovo Device 3a02 Flags: bus master, fast devsel, latency 0, IRQ 30 Memory at f4000000 (64-bit, non-prefetchable) [size=4M] Memory at d0000000 (64-bit, prefetchable) [size=256M] I/O ports at 1800 [size=8] Capabilities: <access denied> Kernel driver in use: i915 Kernel modules: i915 joar@juno:~$