summaryrefslogtreecommitdiffstats
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rwxr-xr-xbldins11
-rwxr-xr-xbrowser3
-rwxr-xr-xcmodprobe (renamed from modprobe)5
-rwxr-xr-xdmenu_run2
-rwxr-xr-xflplay6
-rw-r--r--functions28
-rwxr-xr-xmailboxes4
-rwxr-xr-xmplayer6
-rwxr-xr-xpytrends.py2
-rwxr-xr-xssh-expect2
-rwxr-xr-xtomit66
-rwxr-xr-xvolchange2
-rwxr-xr-xwsync8
13 files changed, 121 insertions, 24 deletions
diff --git a/bldins b/bldins
index 34d1fb8..4f9c2fd 100755
--- a/bldins
+++ b/bldins
@@ -51,7 +51,6 @@ if [[ $install == 0 ]];then
make localyesconfig || exit 1
else
#cp ~/config/kconfig/config .config
- KCFLAGS=" -march=native -O2 -pipe "
make menuconfig || exit 1
make modules_prepare || exit 1
@@ -62,7 +61,7 @@ if [[ $install == 0 ]];then
echo "Building bzImage!"
#/usr/bin/time -p $=BUILDCMD | tee $LOGFILE || exit 1
- (/usr/bin/time -p $=BUILDCMD || exit 1) | tee $LOGFILE
+ (/usr/bin/time -p $=BUILDCMD || exit 1) |& tee $LOGFILE
ver=${kernver[(ws:-:)-1]}
kernelname=${1:-$ver}
@@ -110,15 +109,15 @@ fallback_image=\"/boot/kernel26-fallback${kernelname}.img\"
fallback_options=\"-S autodetect\"
" | sudo tee /etc/mkinitcpio.d/kernel26${kernelname}.preset
-pread "Verify mkinitcpio.conf and others"
-pread "Installing modules to /lib/modules/$kernver"
+echo "Verify mkinitcpio.conf and others"
+echo "Installing modules to /lib/modules/$kernver"
sudo make modules_install
-pread "Installing firmware"
+echo "Installing firmware"
sudo make firmware_install
-pread "Time for headers..hmmm"
+echo "Time for headers..hmmm"
sudo install -D -m644 Makefile /usr/src/linux-${kernver}/Makefile
sudo install -D -m644 kernel/Makefile /usr/src/linux-${kernver}/kernel/Makefile
diff --git a/browser b/browser
index 2364ba8..ed1a7a1 100755
--- a/browser
+++ b/browser
@@ -18,7 +18,8 @@ if [[ $URL == *youtube.com/watch* ]];then
#DFILE=
#trap 'rm $DFILE;kill $$' TERM
#trap '~/bin/mplayeraux stop' INT
- tubeplay $URL
+ #tubeplay $URL
+ cvlc "$URL"
#sleep 2
#DFILE=$(ls -Acr |tail -1)
#export DFILE
diff --git a/modprobe b/cmodprobe
index 60fee0a..4ff7864 100755
--- a/modprobe
+++ b/cmodprobe
@@ -1,4 +1,5 @@
#!/bin/zsh
+exec &>>~/logs/cmod.log
export HHOME="/home/raghavendra"
modname=$1
mprobe="/sbin/modprobe"
@@ -24,13 +25,13 @@ if [[ $? != 0 ]];then
export PATH="/usr/bin/vendor_perl:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/lib/perl5/vendor_perl/bin:/usr/bin/core_perl:/opt/plan9/bin"
# Optional
#unset CFLAGS CXXFLAGS LDFLAGS
- export EXTRA_LDFLAGS=" -s "
+ #export EXTRA_LDFLAGS=" -s "
pushd $prefix || exit 1
for key in ${(k)module_table};do
if [[ $modname == *$key* ]];then
file=$module_table[$key]
if [[ -n $file ]];then
- ./$file &>>|$HHOME/logs/cmod.log
+ ./$file
/sbin/depmod
$mprobe $file
else
diff --git a/dmenu_run b/dmenu_run
index 3313680..353fedb 100755
--- a/dmenu_run
+++ b/dmenu_run
@@ -1,4 +1,4 @@
#!/bin/zsh
-PATH="/home/raghavendra/bin:/opt/wine/bin:/bin:/usr/bin:/sbin:/usr/sbin"
+#PATH="/home/raghavendra/bin:/opt/wine/bin:/bin:/usr/bin:/sbin:/usr/sbin"
#exe=`dmenu_path_c | dmenu -i -fa 'xft:Bitstream:pixelsize=14' -nb black -nf white -p : ${1+"[email protected]"}` && exec ${=exe}
exe=`dmenu_path | yeganesh -f -- -i -fn 'xft:Bitstream:pixelsize=19' -m 1 -sb aquamarine4 -nb grey2 -nf grey50 -p : ` && exec ${=exe}
diff --git a/flplay b/flplay
index da33d22..5cb4594 100755
--- a/flplay
+++ b/flplay
@@ -3,6 +3,12 @@ fpid=$(pidof plugin-container)
fd=$(lsof | grep $fpid | /bin/grep '(deleted)' | /bin/grep FlashX | /bin/grep -o '[0-9]*u ' | head -1)
+
+if [[ -z $fd ]];then
+ fpid=$(pidof firefox-bin)
+ fd=$(lsof | grep $fpid | /bin/grep "media_cache" | /bin/grep -o '[0-9]*u ' | head -1)
+fi
+
fd=$fd[1,-3]
print /proc/$fpid/fd/$fd
diff --git a/functions b/functions
index 26ead44..99aa69d 100644
--- a/functions
+++ b/functions
@@ -23,7 +23,7 @@ $HOME/bin/mplayer "[email protected]"
function etym(){
-/usr/bin/w3m -dump "http://www.etymonline.com/index.php?search=$word&searchmode=none"
+/usr/bin/w3m -dump "http://www.etymonline.com/index.php?search=$word&searchmode=none" | sed -n -e "/^$word/,/^$/p"
}
function getmovie (){
@@ -58,7 +58,7 @@ mountole(){
echo "Failed :( "
return 1
fi
- ssh-expect
+ ssh-expect
}
@@ -68,8 +68,8 @@ bbcradio() { local s;echo "Select a station:";select s in 1 1x 2 3 4 5 6 7 "Asia
function def(){
- wn $1 -over
- if [ $? != "0" ];then echo $1 >> ~/wordlist;fi
+ wn "[email protected]" -over
+ if [ $? != "0" ];then echo "[email protected]" >> ~/wordlist;fi
}
@@ -115,12 +115,28 @@ for i in $pkg
do
for j in `pacman -Ql $i | cut -d " " -f 2`
do
- grep -l -i $term $j
+ =grep -l $term $j
done
done
#set +x
}
+function gdb(){
+/usr/bin/gdb --quiet
+}
+
+function genscope(){
+ /usr/bin/cscope -b -R -q
+}
+function cscope(){
+ #/usr/bin/cscope -d -f $(readlink -f (../)#cscope.out) [email protected]
+ file=$(readlink -f (../)#cscope.out)
+ [[ $? != 0 ]] && return 1
+ pushd $file:h
+ /usr/bin/cscope -d [email protected]
+ popd
+}
+
function cscore()
{
curl -s -e "http://www.google.com" -A "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1" "http://livechat.rediff.com:80/sports/score/score.txt"
@@ -528,7 +544,7 @@ function {news,mutt,ncm,weechat,weechat-curses,newsbeuter,ncmpcpp,atop,rtorrent,
: ${(AA)appMap:=${(z)WSETS}}
- if [[ -z $1 ]];then
+ if pgrep $app;then
sess=$(tux takeme $app)
tmux switch-client -t $sess
return
diff --git a/mailboxes b/mailboxes
index 6eb48bd..61e612d 100755
--- a/mailboxes
+++ b/mailboxes
@@ -34,11 +34,13 @@ echo "~/Mail/Kronos/Today \
$(find ~/Mail/ -type d -name new -printf '%d:%[email protected]:%h \n' \
| sort -t : -k 1,2 -r \
| cut -d : -f 3 \
- | /bin/grep -v -E '(Chro|Old|Junk|Kro|INBOX|Search|Dyne|Wnohang|Yahoo|Sent|Me|Archive|Important|Todo)' \
+ | /bin/grep -v -E '(Chro|Old|Junk|Kro|INBOX|Search|Dyne|Wnohang|Yahoo|Sent|Me|Archive|Important|Todo|KVM)' \
| tr '\n' ' ' \
| tr -s ' ') \
~/Mail/Important/ \
~/Mail/Todo/ \
+ ~/Mail/Archive/NITK/ \
+ ~/Mail/Archive/Msoft/ \
~/Mail/Archive/eBackup/"
diff --git a/mplayer b/mplayer
index 0b744d0..0925a4f 100755
--- a/mplayer
+++ b/mplayer
@@ -181,9 +181,11 @@ preplay
[[ $firstime == 1 ]] && sleep 3
if [[ $stdin == 1 ]];then
- pecho "loadfile /dev/fd/0" /tmp/mplayer.fif
+ #pecho "loadfile /dev/fd/0" /tmp/mplayer.fif
+ /usr/bin/mplayer -
+ exit 110
else
- pecho "loadfile \"$FILE\" 2" /tmp/mplayer.fif
+ pecho "loadfile \"$FILE\" 2" $MPSOCKET
fi
check_status
diff --git a/pytrends.py b/pytrends.py
index 94cfb4d..479c285 100755
--- a/pytrends.py
+++ b/pytrends.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python2
import cjson
import urllib2
from contextlib import closing
diff --git a/ssh-expect b/ssh-expect
index c0e4efc..10477f7 100755
--- a/ssh-expect
+++ b/ssh-expect
@@ -2,5 +2,5 @@
ssh-add -L | =grep -iq id_rsa || ssh-add
if ! mount | =grep -iq sate;then
- sshfs -p 17281 -C [email protected]:/ /sate -o uid=1000,gid=101,intr || exit 1
+ (sshfs -p 17281 -C [email protected]:/ /sate -o uid=1000,gid=101,intr || exit 1) &
fi
diff --git a/tomit b/tomit
new file mode 100755
index 0000000..429f89d
--- a/dev/null
+++ b/tomit
@@ -0,0 +1,66 @@
+#!/usr/bin/python2
+import signal
+import time, sys
+import subprocess, shlex
+import daemon
+import atexit
+
+import setproctitle as setp
+
+from Xlib.display import Display
+from Xlib import X
+from Xlib.protocol import request
+from Xlib.protocol import request,rq
+
+class Tomit(object):
+ def __init__(self,daemonize):
+ setp.setproctitle("tomit")
+ self.disp = Display()
+ self.mask = X.PointerMotionMask | X.PointerMotionHintMask | X.LeaveWindowMask | X.EnterWindowMask
+ self.root = self.disp.screen().root
+ self.root.change_attributes(event_mask = self.mask)
+ self.root.grab_pointer(1,self.mask,X.GrabModeSync,X.GrabModeAsync,X.NONE,X.NONE,X.CurrentTime)
+
+ self.xin='xinput set-prop "PIXART USB OPTICAL MOUSE" "Device Enabled"'
+ signal.signal(signal.SIGUSR1,self.renable)
+ atexit.register(self.cleanup)
+ if (daemonize == 1):
+ with daemon.DaemonContext():
+ self.loop()
+ else:
+ self.loop()
+
+ def cleanup(self):
+ proc = \
+ subprocess.Popen(shlex.split(self.xin+' "1"'))
+ proc.communicate()
+ return proc.returncode
+
+ def loop(self):
+ while True:
+ subprocess.Popen(shlex.split(self.xin+' "0"'))
+ ev = self.disp.next_event()
+ print repr(ev)
+ time.sleep(100)
+
+ def renable(self,signum,frame):
+ subprocess.Popen(shlex.split(self.xin+' "1"'))
+ self.disp.ungrab_pointer(X.CurrentTime)
+ while True:
+ proc = subprocess.Popen(shlex.split("inotifywait -t 60 \
+ /dev/input/by-id/usb-PIXART_USB_OPTICAL_MOUSE-event-mouse"))
+ proc.communicate()
+ if (proc.returncode == 2):
+ print "Re-disabling pointer"
+ subprocess.Popen(shlex.split(self.xin+' "0"'))
+ self.root.grab_pointer(1,self.mask,X.GrabModeSync,X.GrabModeAsync,X.NONE,X.NONE,X.CurrentTime)
+ break
+ else:
+ time.sleep(20)
+
+
+if __name__ == "__main__":
+ daemonize = 1
+ if len(sys.argv)>1:
+ daemonize = int(sys.argv[1])
+ sys.exit(Tomit(daemonize))
diff --git a/volchange b/volchange
index d94f935..e056f30 100755
--- a/volchange
+++ b/volchange
@@ -21,7 +21,7 @@ else
if [[ $1 = '1' ]];then curvol="10%+" ;fi
if [[ $1 = '2' ]];then curvol="10%-";fi
if [[ $1 = 'mute' ]];then
- amixer sset Master playback mute
+ amixer sset Master playback toggle
exit
fi
amixer sset Master playback $curvol
diff --git a/wsync b/wsync
index 9db4aad..a868a8b 100755
--- a/wsync
+++ b/wsync
@@ -20,11 +20,13 @@ projdir="/home/raghavendra/Arch/Projects"
remotedir="/sate/gitole"
if [[ -n $sproj ]];then
+ proj=$sproj
pread "Syncing $proj"
pushd $proj
if /bin/grep -q "Unnamed repo" .git/description;then
echo "Enter one line description"
>| .git/description
+ cp .git/description $remotedir/$proj:t/
fi
if [[ ! -d $remotedir/$projname.git ]];then
git clone --mirror -v $proj /tmp/wsync/$projname.git
@@ -35,7 +37,8 @@ if [[ -n $sproj ]];then
print "Dirty repo"
pread "Commit $proj and then continue"
done
- git push --mirror -v $remotedir/$proj:t
+ #git push --mirror -v $remotedir/$projname.git
+ git push --mirror -v ssh://[email protected]/$remotedir:t/$projname.git
fi
popd
echo "$proj done"
@@ -50,6 +53,7 @@ do
if /bin/grep -q "Unnamed repo" .git/description;then
echo "Enter one line description"
>| .git/description
+ cp .git/description $remotedir/$proj:t/
fi
if [[ ! -d $remotedir/$projname.git ]];then
git clone --mirror -v $proj /tmp/wsync/$projname.git
@@ -60,7 +64,7 @@ do
print "Dirty repo"
pread "Commit $proj and then continue"
fi
- git push --mirror -v $remotedir/$proj:t
+ git push --mirror -v ssh://[email protected]/$remotedir:t/$projname.git
fi
popd
echo "$proj done"