Jaunty Jackalope is On

Yesterday Jaunty is really released. Now let's try it on and get the fastest Ubuntu boot with ext4.

welcome to utux-utux

The place where you can get any news, tipsn and tutorials about linux. I'cant explain any further informations about this site. Just open the tux image on the left side. ^_^

Showing posts with label Bash Script. Show all posts
Showing posts with label Bash Script. Show all posts

DeepFreeze for Linux (Advance)

I have writen bout DeepFreeze for Linux before. But here, this script more compleks with Graphical Interface. Then, Let's Freeze your Linux.

Make a bash script named deepfreeze with this content first.

#!/bin/bash
# Deepfreeze a la Linux
# Backup before use, Use At Your Own Risk
# Copyleft 2007 by A. Hardiena
# Translated by fortmunir

Xdialog --title "Deepfreeze ala Linux" \
--menubox " Welcome to Deepfreeze ala Linux." 17 65 3 \
"Install" "Install Deepfreeze" \
"Remove" "Remove Deepfreeze"
"Abort" "Abort Installer" 2>/tmp/checklist.tmp.$$

choice=`cat /tmp/checklist.tmp.$$
rm -f /tmp/checklist.tmp.$$

case $choice in
"Install"

ask=`mktemp -q /tmp/menu.XXXXXX`
header="Deepfreeze ala Linux"
size="9 60"
content="Home folder you want to protect."
Xdialog --title "$header" --inputbox "$content" $size 2> $ask
if [ ! $?= 0 ]; then exit 0
fi

directory=`cat $ask`
check=`cat /etc//rc.d/rc.local | grep `# Deepfreeze System'`
temporary=" Deepfreeze System"

if [ "$check" == "$temporary" ]; then
sed -i "/# Deepfreeze/d" /etc/rc.d/rc.local
rm /home/$directory.tar.gz
fi
# Processing Deepfreeze and put to /etc/rc.d/rc.local
cd /home/
rm $directory.tar.gz
tar -cf $directory.tar $directory
gzip --best $directory.tar
cat << EOF >> /etc/rc.d/rc.local
# Deepfreeze System
cd /home/ # Deepfreeze do not manual editing this line
rm -f /home/$directory # Deepfreeze do not manual editing this line
# Deepfreeze has ended here
EOF
# Check if autorecovery has errorr
if [ $? = 0 ]; then
content="Deepfreeze home $directory success."
else
content="Deepfreeze home $directory failed."
fi

Xdialog --title "Header" --magbox "$content" $size
;;
Remove)
ask=`mktemp -q /tmp/menu.XXXXXX`
header="Deepfreeze ala Linux"
size="9 60"
content="Home folder you want to protect."
Xdialog --title "$header" --inputbox "$content" $size 2> $ask

if [ ! $? = 0 ]; then
exit 0
fi

directory=`cat $ask`


If your distro doesn't use rc.d but init.d, You should change position of rc.local from /etc/rc.d/ to the right directory.

The last step is change the mode
chmod +x deepfreeze

Just double cliks it to activate. Or type in your console sh deepfreeze.

DeepFreeze for Linux

So anoyying that your computer setting immediately changed, especially in public area such as a computer cafe etc. In windows we are all familiar with deepfreeze to anticipate this case. But in Linux? Let's make it by ourself. It's just a simple bash script to make your computer setting's get frozen.
We must copy entire of /home/userfolder to /var/userfolde.backup. In this case my username is internet. So I've copied /home/internet to /var/internet.backup.
Then, save this script below in file /root/freeze.sh.
!#/bin/bash
cp -R /var/internet.backup /home/internet
chown -R internet.internet /home/internet

The next step is put this to /etc/rc.local
//root/freeze.sh

Finish!!
 

different paths

college campus lawn

wires in front of sky

aerial perspective

clouds

clouds over the highway

The Poultney Inn

apartment for rent