Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Monday, December 28, 2009

commands #2 feat. Windows

Let me continue the series

1]  scare your friends
this displays weird symbols, and no command line. clear won't work either
cat /dev/random
yes, ^C will quit the program but play with your friends with some innovative ideas
like, display the contents of /dev/random in 5 terminals at once. macabre feelings !!

2] save your packages
knew about this from rikil shah. save all your codecs and packages as an .iso file
APTonCD
try installing it
sudo apt-get install aptoncd
really helpful if you have to reinstall your whole linux again. you dont have to install your necessities all over again

3] backup your whole system
this is somewhat i have virtually tried. i tried remastersys, it took my 4 hours, but finally it said the file is too large. though i provided me some personal benefits, i would rather recommend  sbackup
click here, if you want to try remastersys
else try sbackup
credit: rikil

4] windows

I fear my friends won't read this post just because they love windows. So its for them
Wonderful 25 Windows Tricks
Greatest Windows Tips of All Time

Sunday, December 20, 2009

commands #1

i thought it would be nice if i put some commands that i have come across and have liked

1] cat and tac
you might have known by now, cat displays the file content.
tac ?
it displays in reverse

say a "file" has
a
b
c

then cat file prints
a
b
c

while tac file prints
c
b
a

2] uniq
it deletes the multiple entries. this is just a glimpse into this command. suppose you have a list of entries and you sort it. there can be more than one entry for the same value and you want to delete such multiple entries

echo filename|sort -n|uniq #sort -n sorts by name

3] rename
this is by far a very useful command. go for it. i just want to give a small trailer.
say, you are near your final assignment and you have notes [ya, digital notes] from all your friends. but you want to organize all these files into one directory with the name of person who gave you the files in the front

suppose i have you 7 files, logic1.pdf, logic2.pdf ..logic7.pdf
then you want it as
punj_logic1.pdf....punj_logic7.pdf
then in the directory which has only these files, the command is

rename 's/^/punj_/' *
^ means to append punj_ in the front
s means to substitute
it has numerous applications. just have a try

Saturday, November 21, 2009

virtual FM tuner using shell scripting

this is the virtual fm tuner.
simple shell scripting
but, be connected to the internet
till now, i have just added Nepali FMS.
and, obviously thanks to Satyendra Raj Pandey for this FM idea.

to download the file click here

else, the code is here

#! /bin/sh
commonCommand()
{
common1='[playlist]'
common2='NumberOfEntries=1'
}
quit ()
{
clear
echo "*************************"
printf "SIMPLE FM TUNER V1.0\nDeveloped by\nPUNJ POKHAREL\npunj33@gmail.com\npunj33.blogspot.com\n*************************\n\n"
printf "\nPlease feel free to edit, distribute and contribute. Its totally open source\n\n"
printf "It can be made a whole lot better. So, share your ideas\n\n"
echo "THANK YOU FOR USING SIMPLE FM TUNER V1.0"
printf "\n\n"
echo "Press any Enter to exit"
read nothing
# i tried to kill extracting PID but kill the whole totem seems easy
# a=`ps -ef|grep 'totem fm.log'|grep -v 'grep'`
# b=`echo $a|awk '{print $3}'
# kill -9 totem

if [ $counter -ge 1 ]
then
killall vlc 2> /dev/null
else
killall totem 2> /dev/null
fi
clear
break;
}
choose()
{
case $choice in
1)fm='File1=http://67.202.67.18:8208/;stream.mp3ls';;
2)fm='File1=mms://64.62.166.162/hitsfm';;
3)fm='File1=mms://64.62.166.162/ujyaalofm';;
4)fm='File1=mms://64.62.166.162/sagarmatha_fm' ;;
5)fm='File1=mms://64.62.166.162/nepalfm' ;;
6)fm='File1=mms://64.62.166.162/maitrifm';;
7)quit ;;
esac
}
tune()
{
printf "$common1\n$common2\n$fm" > fm.log
counter=`whatis cvlc|grep 1|wc -l`
if [ $counter -ge 1 ]
then
killall vlc 2> /dev/null &
cvlc fm.log 2> /dev/null &
else
totem fm.log 2> /dev/null &
fi
printf "TUNING "
for i in 1 2 3 4 5
do
printf "."
sleep 0.255
done
echo
}
while [ 0 ]
do
clear
printf "********Welcome to a SIMPLE FM TUNER V1.0*********\n\n"
echo "Please enter your FM station. Press its symbol no. correctly \n"
printf "1. Kantipur FM \n2. Hits FM\n3. Ujjyalo FM\n4. Sagarmatha FM\n5. Nepal FM \n6. Maitri FM\n7. Quit\n\n"

read choice
if [ $choice -ge 8 ]
then
echo "WRONG CHOICE YOU MORON"
echo "Press any key to continue"
read nothing123
else

commonCommand
choose
tune
fi
done