If you've got a lot of zip files and need to test it, here's a one liner that can be used to quickly validate the archives:
for x in `ls` ; do zip -T $x ; done | tee /tmp/archive_test.log
BlogsTesting zipped archivesSubmitted by sandip on Fri, 03/27/2009 - 08:52If you've got a lot of zip files and need to test it, here's a one liner that can be used to quickly validate the archives: for x in `ls` ; do zip -T $x ; done | tee /tmp/archive_test.log »
comparing files line by lineSubmitted by sandip on Thu, 03/26/2009 - 22:48Here's a way to compare two files that have common lines in both files: sort file1.txt > file1_sorted.txt Note: files need to be sorted first prior to comparing. »
cofigure phplist spellcheck for firefoxSubmitted by sandip on Thu, 03/05/2009 - 11:54PHPList comes with FCKeditor as the gui default editor. However, by default it is setup so that the spellcheck is only available to IE users. To enable for other browsers such as Firefox, follow the below directions:
Replace all instances of: FCKConfig.SpellChecker = 'ieSpell' ; with: FCKConfig.SpellChecker = 'SpellerPages' ; If this is a linux box, then make sure aspell is installed. Edit "admin/FCKeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.php" and update the aspell program path: $aspell_prog = '/usr/bin/aspell'; That should do it. »
Pictures from the Computer History MuseumSubmitted by philiph on Thu, 02/05/2009 - 14:23Here's a set of photos I took at the Computer History Museum. If you like switches and indicator lamps you will love these pics. Not strictly linux-related I know but the Linux lineage can be traced back to many of these systems! Some samples after the break. »
Backup, restore and cloning of partition tableSubmitted by sandip on Tue, 02/03/2009 - 16:34To backup partition table: sfdisk -d /dev/sda > sda.table To restore the partition table: sfdisk /dev/sda < sda.table To clone partition table: sfdisk -d /dev/sda | sfdisk /dev/sdb »
set_loginuid failed opening loginuidSubmitted by sandip on Tue, 02/03/2009 - 10:51If this file doesn't exist: /proc/<pid of crond>/loginuid It's because the kernel doesn't have AUDIT enabled. So you get a bunch of errors in "/var/log/secure" with "set_loginuid failed opening loginuid". Recompile kernel with audit support: CONFIG_AUDIT=y If recompiling of kernel is not an option then: Comment the below lines from all pam.d files. session required pam_loginuid.so Find files via: # grep -l pam_loginuid.so /etc/pam.d/* Loss in network connectivity on OpenVZ hostSubmitted by sandip on Thu, 01/29/2009 - 16:30I was seeing loss in network connectivity when an OpenVZ container is stopped and noticed that the bridge mac address was taking the mac address of an existing containers virtual network interface instead of the physical interface. The solution was to set the bridge mac address to the physical interface: /sbin/ifconfig br0 hw ether $(ifconfig eth0 | awk '{print $5; exit}') Here is what my "/etc/sysconfig/vz-scripts/vps.umount" looks like which is used to remove routes to container with veth-bridge from bridge. »
Weekly backups of all OpenVZ containerSubmitted by sandip on Thu, 01/08/2009 - 17:56Here's is a simple shell script to run a weekly lvm snapshot dump of all OpenVZ containers using the vzdump utility: #!/bin/bash Week of MonthSubmitted by sandip on Thu, 01/08/2009 - 10:24Here is a simple one liner to get the week of month via awk from a `cal` output: $ cal | awk -v date="`date +%d`" '{ for( i=1; i <= NF ; i++ ) if ($i==date) { print FNR-2} }' Verifying SSH Key FingerprintSubmitted by sandip on Thu, 01/01/2009 - 21:02If you've been given a public ssh host key and want to verify it before adding it permanently to your ssh known_hosts file: Get the public ssh key: $ ssh-keyscan -p 22 -t rsa,dsa {remote_host} > /tmp/ssh_host_rsa_dsa_key.pub Get the ssh key fingerprint: $ ssh-keygen -l -f /tmp/ssh_host_rsa_dsa_key.pub |
User loginRecent blog posts
Who's onlineThere are currently 0 users and 5 guests online.
|