poor mans watch, watch for solaris
Here is a simple script that you can use as watch in Solaris as well.
watch() { #Poor man's watch while (true) do clear $* sleep 2; done }
Here is a simple script that you can use as watch in Solaris as well.
watch() { #Poor man's watch while (true) do clear $* sleep 2; done }
If you have a lot of CPU power and working on battery. If you do not need that much of power and would like to rather save some battery power by disabling some cpus then you can use the below script. This script disables cpus from 4 to 7. You can change the number in the for loop. You would need the sudo to be setup or remove sudo and run the script as root. The script will show you the currently active cpu’s before and after disabling the CPU’s.
Continue readingFor those of you, who have not heard about powertop, it is a tool to monitor the power consumption on your system. It has a tab which shows the tuneable parameters. Doing the changes suggested in those would improve the life to quite an extent. Here is the description of powertop:
PowerTOP is a tool that finds the software component(s) that makeyour computer use more power than necessary while it is idle.
Continue reading
I was working on something and the data was very critical and needed backup. I wrote a bash script to back up the data every 5 hours with cron and bash script. Thought I will share that with you. Here is the script.
#!/bin/bash - #=============================================================================== # # FILE: backup.sh # # USAGE: ./backup.sh # # DESCRIPTION: Backup all the current files. # # OPTIONS: --- # REQUIREMENTS: --- # BUGS: --- # NOTES: --- # AUTHOR: Amit Agarwal (aka), amit.agarwal@roamware.com # COMPANY: Roamware India Pvt Ltd # CREATED: 08/19/2011 02:43:32 PM IST # REVISION: --- #=============================================================================== backupf=( a b c d) #Here you need to specify the directory you need to backup. bkupdir="/tmp/backup/$(date +%Y)/$(date +%m)/$(date +%d)" #Here you can change the basedir for the backups mkdir -p $bkupdir sudo tar cvfz $bkupdir/bkup_$(date "+%Y%m%d_%H%M").tgz $backupf[*] #Remove sudo if you do not need it. echo "Backup created in dir $dir"
And then just add it to cron as “00 */5 * * * /home//bin/backup.sh”. Change the path if it does not match what is given here.
Continue readingLast couple of years, I just used to disable iptables on my system, this time I decided not to disable it and keep it enabled.
So far so good, now comes the tricky part, I have http server enabled on my system and since this is on local network with already firewall and other security in place so I can allow all incoming to my system and similarly I need to enable XDMCP outgoing. So, I can add the rules like this :
Continue readingHave spent some time today to speed up the blog today and made some improvements.
Today I finally managed to get some time to update my site and change theme. I also made some changes that should decrease the page loading time. Have updated the “Sitemap” page and also the contact me page. There are couple of other changes that should make your experience a lot more better.
XDMCP is protocol that allows remote connections and provides you with a working Display Manager like KDE, GNome, et al. Its a remote connection protocol that is mostly enabled on Solaris and disabled on most Linux boxes. If you need to have a remote session where you need the X Display to open some GUI applications then you can have a connection with the remote server with XDMCP.
Continue reading