Archive for the ‘Uncategorized’ Category.
17th June 2011, 02:32 pm
As I have been trying to figure out how to remove a specific string and not leave a blank line in a file, perl has really saved my day.
perl -ni -e 'print unless/mydomain.com/' virtualdomains
Back to developing scripts now
Hope this helps someone too.
27th March 2011, 08:39 pm
If you have more than 100 spam comments to delete, you might need to spend quite a fair bit of time to delete. Time is precious. Here is a quick way to mass delete all the comments.
DELETE swcomments, swcommentdata FROM swcomments, swcommentdata WHERE swcomments.commentid = swcommentdata.commentdataid AND swcomments.isapproved = '0';
I am not responsible for any damage caused in your system, please DO backup before you execute any SQL query.
Hope this helps!
10th October 2010, 07:15 am
This is a quick command to get it installed.
/usr/bin/perl -MCPAN -e 'install "DBD::mysql"'
Hope this helps!
19th September 2010, 05:16 am
I was about to head to bed when I receive a disturbing email from my BlackBerry phone.
A email from weekly cron.d send me this:
WARNING: mismatch_cnt is not 0 on /dev/md0
A quick command shows that the RAID array (md0) is the number of
unsynchronized blocks in the raid.
As you can see below, md0 is having 128 count of unsynchronized blocks.
[svr4:/root]# cat /sys/block/md0/md/mismatch_cnt
128
[svr4:/root]# cat /sys/block/md1/md/mismatch_cnt
0
Let’s attempt to fix it.
Continue reading ‘WARNING: mismatch_cnt is not 0 on /dev/md0’ »
17th September 2010, 11:46 pm
In order to do a fsck on your disk on the next reboot, I prefer the following command:
-F: Force fsck on reboot.
-r: reboot after shutdown.
The next option that you can choose to use is as following:
touch /forcefsck
shutdown -r now
Enjoy!!
9th September 2010, 02:28 pm
As I notice that one of my box is having slight issues with the 3ware controller, it has been doing soft reset of the controller for the past week. One of the test I am running is smartctl, as the disk is behind a hardware raid controller, I need to invoke differently.
smartctl -d 3ware,0 -a /dev/twa0
3ware,0 means disk 0
twa0 is the controller number
Looks like both my disk is fine, moving on to do other tests.
Hope this helps.
22nd August 2010, 05:37 pm
In order to configure Acronis SnapDeploy with Microsoft DHCP, you need to modify two options so that when DHCP issue the IP address, the client know who to contact for the PXE Boot Images.
options 66 (hostname startserver = 192.168.X.X)
options 67 (name of startfile = bootwiz.sys)
Make sure that you restart the Acronis File Server and PXE Server after you modify the options.
This has being tested with Acronis 9 and Windows 2003 Edition.
Hope this helps
30th April 2010, 03:49 am
Performing backup of your logical volume is pretty easy and fast. It is the safest way to backup any “open” files/databases.
1) Creating a snapshot of your current LVM
[root@svr2 ~]# lvcreate -L1000M -s -n volbackup /dev/VolGroup00/datavol
Rounding up size to full physical extent 1.00 GB
Logical volume "volbackup" created
2) You should see lvdisplay stating the snapshot LVM.
[root@svr2 ~]# lvdisplay /dev/VolGroup00/volbackup
--- Logical volume ---
LV Name /dev/VolGroup00/volbackup
VG Name VolGroup00
LV UUID H1s7bn-TKCu-sdfE-Xi0M-oZNA-ixvq-xsWvZj
LV Write Access read/write
LV snapshot status active destination for /dev/VolGroup00/datavol
LV Status available
# open 0
LV Size 100.00 GB
Current LE 3200
COW-table size 1.00 GB
COW-table LE 32
Allocated to snapshot 0.00%
Snapshot chunk size 4.00 KB
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:4
3) Create a folder for it to do a proper mount.
[root@svr2 ~]# mkdir /backupvol
[root@svr2 ~]# mount /dev/VolGroup00/volbackup /backupvol
4) Do the backup now.
[root@svr2 ~]# tar -cf /root/datavol.tar.gz /backupvol
5) Umount, remove folder and delete the snapshot LVM
umount /backupvol
rm -rfv /backupvol
lvremove /dev/VolGroup00/volbackup
Hope this helps someone out there…
29th April 2010, 12:20 am
I order a USA VPS to play around with today, just for fun. No serious stuff on it. Decided to run Unixbench but hit with some minor problem.
./src/ubgears.c:641: warning: implicit declaration of function âevent_loopâ
./src/ubgears.c:643: warning: implicit declaration of function âglXDestroyContextâ
./src/ubgears.c:645: warning: implicit declaration of function âXDestroyWindowâ
./src/ubgears.c:646: warning: implicit declaration of function âXCloseDisplayâ
make: *** [pgms/ubgears] Error 1
**********************************************
Run: "make all" failed; aborting
This is due to some development tools not installed.
Solution:
yum install -y SDL-devel mesa-libGL-devel
Hope this helps someone out there …
28th April 2010, 09:38 pm
After using Internet Download Manager for close to 48 hours, I face this problem after a restart
Problem:
C:\Users\Tan>ping 4.2.2.2
Pinging 4.2.2.2 with 32 bytes of data:
PING: transmit failed, error code 1232.
PING: transmit failed, error code 1232.
PING: transmit failed, error code 1232.
PING: transmit failed, error code 1232.
Solution:
Microsoft Windows [Version 6.0.6000]
Copyright (c) 2006 Microsoft Corporation. All rights reserved.
C:\Users\Tan>netsh winsock reset
After which, just do a restart and your network will be back to normal.
Hope this helps someone out there…