Shell script parameter check

To check if your script was given any command like parameters when run use scripts similar to the following, in BASH use: if [ $# -ne 2 ] then echo "Error in $0 - Invalid Argument Count" echo "Syntax: $0 input_file output_file" exit fi is CSH use: if( $#argv < 2 ) then echo "Usage: pltrps filename start_rpnum [ rpnum_inc END_rpnum]" exit 1 endif
Tags:

Connecting to MySQL

At your shell prompt type # mysql -u <username> --password=<password> Where <username> and <password> are the username and password you entered when first setting up MySQL. You may also be able to login as root like this, # mysql -u root without using a password, depending on how your system was setup.
Tags:

Removing monitored folders from VMC

I have managed to remove all the folders I don't want from Vista Media Centre (VMC). STEPS: 1: Delete ALL video files from Windows Media Player (WMP) Library. 2: Remove or ignore ALL folders in WMP watched folders except "recorded tv" 3: Remove ALL Folders from VMC except "recorded tv" 4: Delete ALL video files, folders and shortcuts from the folder \USERS\PUBLIC\PUBLIC VIDEOS 5: Delete Shortcut to Sample videos from \USERS\PUBLIC\RECORDED TV 6: Delete ALL video files, folders and shortcuts from the folder \USERS\\VIDEOS 7: REBOOT!!!!!!!!!!!! 8: Add a folder/shortcut heirarchy to the folder \U
Tags:

How to create ISO image in Solaris

Data To CD To create ISO image: mkisofs -o xxx.iso -J -R /full-path-to-data/ CD to CD Capture an ISO image file of the CD by typing (at root prompt): # dd if=/dev/dsk/c0t6d0s2 of=/root/64bit_disk3.iso You may have to disable volume management first, by running: # svcadm disable volfs You may also have to run both commands as root Burn ISO To burn the CD: cdrw -i /full-path/xxx.iso
Tags:

Resizing the root partition in Solaris

Backup the root filesystem (preferably in single user mode) # ufsdump 0f /mnt/backup.dmp / To restore the root filesystem Boot from the CD-ROM to single user mode OK> boot cdrom -s Resize the root partition using format Mount the HDD to be restored to: # mount -o rw -F ufs /dev/dsk/ /root_disk Restore from the root backup location # cd /root_disk # ufsrestore rf /backup/backup.dmp # cd / # umount /root_disk Check the disk # fsck -y /dev/dsk/ If necessary install a boot block on the partition # installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdks/ Reboot # init 6

Using 3rd party themes in Windows

It is possible to 'hack' Windows XP so that you can use third party themes. You first need to download and run the Uxtheme Multi-patcher, from somewhere like www.softpedia.com. Then download some visual sytles from www.deviantart.com Also look for a program called 'Serious Samurize' that can add Vista style sidebar to your desktop.
Tags:

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer