summaryrefslogtreecommitdiffstats
authorRaghavendra D Prabhu <[email protected]>2011-07-16 17:41:17 (GMT)
committer Raghavendra D Prabhu <[email protected]>2011-07-16 17:41:17 (GMT)
commit56d848c248199f02521e293f0568dbeac5185097 (patch) (side-by-side diff)
tree430b777dfe67dc31647f0d1cf186a98017a49278
parent806e6210978606d89e3af70eb10d90351b3ea488 (diff)
downloadScripts-56d848c248199f02521e293f0568dbeac5185097.zip
Scripts-56d848c248199f02521e293f0568dbeac5185097.tar.gz
Scripts-56d848c248199f02521e293f0568dbeac5185097.tar.bz2
Scripts update
Diffstat (more/less context) (ignore whitespace changes)
-rwxr-xr-xarchievm15
l---------[-rwxr-xr-x]aria8
-rwxr-xr-xautochangie57
-rwxr-xr-xbackends/base.py11
-rw-r--r--backends/base.pycbin0 -> 679 bytes
-rwxr-xr-xbackends/pdf.py44
-rwxr-xr-xbackit66
-rwxr-xr-xbldins1
-rwxr-xr-xbooktwit1
-rwxr-xr-xbrowser11
-rwxr-xr-xbuildfox23
-rwxr-xr-xcorer1
-rwxr-xr-xcurrent13
-rwxr-xr-xdmenu_run3
-rwxr-xr-xdown3
-rwxr-xr-xdownload19
-rw-r--r--functions72
-rwxr-xr-xgencov10
-rwxr-xr-xgetimap3
-rwxr-xr-xgitscope49
-rwxr-xr-xifstatus8
-rwxr-xr-xisurl8
-rwxr-xr-xmailboxes2
-rwxr-xr-xmark-yank-urls23
-rwxr-xr-xmpdStats2
-rwxr-xr-xmplayer5
-rw-r--r--mplayer.fns6
-rwxr-xr-xnotify-send9
-rwxr-xr-xpdfspider63
-rwxr-xr-xpdfspider286
-rwxr-xr-xreminder2
-rwxr-xr-xshaper19
-rwxr-xr-xshotrss4
-rwxr-xr-xspeeddial5
-rwxr-xr-xsuz5
-rwxr-xr-xtmux-url8
-rwxr-xr-xvacuum3
-rwxr-xr-xvolchange9
-rwxr-xr-xw3m5
-rwxr-xr-xwsync13
40 files changed, 541 insertions, 154 deletions
diff --git a/archievm b/archievm
index f03d89f..1a4d3a6 100755
--- a/archievm
+++ b/archievm
@@ -3,6 +3,7 @@
#[[ ! $(whoami) == 'root' ]] && exit 1
#sudo modprobe -a -v kvm kvm_intel virtio virtio_pci virtio_balloon virtio_blk virtio_net virtio_console virtio_rng 9pnet_virtio
+#sudo modprobe -a -v kvm kvm_intel nbd
sudo modprobe -a -v kvm kvm_intel
debugk=0
@@ -60,7 +61,8 @@ fi
if [[ $huge == 1 ]];then
echo 296 | sudo tee /proc/sys/vm/nr_hugepages
- hugearg=" -mem-path /media/hugepages -mem-prealloc "
+ #hugearg=" -mem-path /media/hugepages -mem-prealloc "
+ hugearg=" -mem-path /media/hugepages "
#hugearg=" -mem-path /media/hugepages "
fi
@@ -81,10 +83,11 @@ fi
# -balloon virtio
cmdline="qemu-kvm -name Archie -enable-kvm -s -monitor unix:$DIR/archie.sock,server,nowait \
- -m 512 $hugearg $snap \
+ -m 512 $hugearg $snap -smp 2,cores=2 -balloon virtio \
-net nic,model=virtio,vlan=1 -net user,vlan=1,hostfwd=tcp:127.0.0.1:2222-:22 $=graph \
- -virtfs local,path=$DIR/share,security_model=passthrough,mount_tag=share \
- -virtfs local,path=/var/cache/pacman/pkg,security_model=passthrough,mount_tag=pacman \
+ -virtfs local,path=$DIR/share,security_model=none,mount_tag=share \
+ -virtfs local,path=/var/cache/pacman/pkg,security_model=none,mount_tag=pacman \
+ -virtfs local,path=/media/Corona/bldit/.gcov,security_model=none,mount_tag=gcov \
$external -runas $runas $=EARGS"
#echo "$cmdline"
@@ -94,7 +97,9 @@ eval $=cmdline
if [[ $ksm == 1 ]];then
echo 1 | sudo tee /sys/kernel/mm/ksm/run
fi
-echo "sudo -u $runas sshfs -p 2222 [email protected]:/ /mnt-qemu" | xclip -i
+sleep 10
+#sudo -u $runas sshfs -p 2222 [email protected]:/ /mnt-qemu
+sshfs -p 2222 [email protected]:/home/raghu/gcov /media/Corona/bldit/.gcov
#rlwrap -pgreen socat - $DIR/archie.sock
rlwrap socat - $DIR/archie.sock
#qemu-kvm -name Archie -enable-kvm -m 512 -snapshot -drive file=/media/Inkq/Virt/Archie.img,if=virtio -vga std -kernel ~/Arch/qemu/kvmImage -initrd /boot/kernel26.img -append root=/dev/vda3
diff --git a/aria b/aria
index e4793c7..5a26941 100755..120000
--- a/aria
+++ b/aria
@@ -1,7 +1 @@
-#!/bin/zsh
-if ! ~/bin/downloadStats 1;then
- shellrun download "[email protected]"
-else
- echo "shellrun download [email protected]" >> ~/.dque
-fi
-
+/home/raghavendra/bin/download \ No newline at end of file
diff --git a/autochangie b/autochangie
new file mode 100755
index 0000000..0d49f35
--- a/dev/null
+++ b/autochangie
@@ -0,0 +1,57 @@
+#! perl
+# To dynamically change font size of your current font.
+# Bind a key like --> URxvt.keysym.M-3: perl:changefont:toggle
+#
+# Define font size range like
+# URxvt.frange: 10,13
+# Your current font size is automatically added to it
+
+sub on_start {
+ my ($term) = @_;
+ $term->{'sizearr'} = [];
+ my @tmp = split /,/, $term->x_resource ("frange") || qw(13);
+ my $font = $term->resource('font');
+ my $xsize = (split(/-/,(split(/:/, $font))[1]))[1];
+ push @tmp, $xsize;
+ $term->{'origindex'} = $#tmp;
+ $term->{'sizearr'} = \@tmp;
+}
+
+sub on_user_command {
+ my ($term, $cmd) = @_;
+ if ($cmd eq 'changie:toggle-down') {
+ toggle($term,-1);
+ }
+ else {
+ toggle($term,+1);
+ }
+ ()
+}
+
+sub toggle {
+ my ($self,$inc) = @_;
+ my $index = $self->{'origindex'};
+ my $font = $self->resource('font');
+ my @tmp = @{$self->{'sizearr'}};
+ $index = $index + (1 * $inc);
+ $index %= @tmp;
+ $font =~ s/(?<=-)[0-9]+(?=:)/$tmp[$index]/;
+ $self->overlay_simple (0, -1, "Size set to $tmp[$index]");
+ $self->cmd_parse("\033]710;$font\007");
+ $self->{'origindex'} = $index;
+ ()
+}
+
+sub on_map_notifyxxx {
+ my ($term) = @_;
+ my $autochange = $term->x_resource ("autotoggle") || 1;
+ if ($autochange == 1){
+ my $str = `tail -2 /tmp/xmonad.log | grep Xye | awk -F ' . ' '{ print $3 }'`;
+ if ($str =~ m{/([0-9]):.*/.*<([0-9]).*>}) {
+ if ($1 < $3) {
+ toggle($term,+1);
+ }
+ }
+ }
+ ()
+}
diff --git a/backends/base.py b/backends/base.py
new file mode 100755
index 0000000..1474fd3
--- a/dev/null
+++ b/backends/base.py
@@ -0,0 +1,11 @@
+#!/usr/bin/env python2
+
+class Backend(Object):
+ def __init__(self):
+ self.values = {}
+ self.terms = {}
+ def process(self,pfile,document,indexer):
+ pass
+ def filter(self,matches):
+ pass
+
diff --git a/backends/base.pyc b/backends/base.pyc
new file mode 100644
index 0000000..ab256ec
--- a/dev/null
+++ b/backends/base.pyc
Binary files differ
diff --git a/backends/pdf.py b/backends/pdf.py
new file mode 100755
index 0000000..a5fdd9c
--- a/dev/null
+++ b/backends/pdf.py
@@ -0,0 +1,44 @@
+#!/usr/bin/env python2
+import string
+from base import Backend
+import os.path as P
+from pyPdf import PdfFileReader
+
+
+class PdfBackend(Backend):
+
+ def __init__(self):
+ self.values = { }
+ self.terms = { 'T' : 'title',
+ 'A' : 'author',
+ 'P' : 'pagenum',
+ 'N' : 'pfile' }
+ self.iprocessor = None
+ self.oprocessor = 'mupdf '
+
+ def process(self,pfile,document,indexer):
+ with PdfFileReader(file(pfile,"rb")) as pdf:
+ for pagenum in range(pdf.getNumPages()):
+ data = pdf.getPage(pagenum).extractText()
+ try:
+ title = pdf.getDocumentInfo().title
+ except:
+ title = P.basename(pfile)
+ try:
+ author = pdf.getDocumentInfo().author
+ except:
+ author = "Anon"
+ #doc.set_data(str(title))
+ document.set_data()
+
+ #document.add_value(self.values[filename],pfile)
+ #document.add_value(self.values[pagenum],str(i))
+ for term,val in self.terms:
+ document.add_term(self.term + eval(self.val))
+ indexer.set_document(doc)
+ indexer.index_text(data)
+
+
+ def filter(self,matches):
+ pass
+
diff --git a/backit b/backit
new file mode 100755
index 0000000..f2aa973
--- a/dev/null
+++ b/backit
@@ -0,0 +1,66 @@
+#!/bin/zsh
+
+typeset -a files
+SNAPID=$(date +%s)
+SRCFILE="$HOME/config/backup.lst"
+SNAPDIR="$HOME/.Backup/Snaps"
+REMOTE="/media/Xel/Backup/Snaps"
+
+add(){
+ for line in ${(f)"$(< $SRCFILE)"};do
+ case "$line" in
+ @*)
+ files+=($~line[2,-1])
+ ;;
+ \#*)
+ continue
+ ;;
+ *)
+ files+=($line)
+ esac
+ done
+
+ #print -l $files
+ #exit
+ #print $SRCFILE >> $OFILE
+
+ echo "Syncing"
+ sync
+
+ print -l $files $SRCFILE | tar -T - -czf $SNAPDIR/snap-$SNAPID.tar.gz
+}
+
+cleanup(){
+ pushd $SNAPDIR
+ files=(*.tar.gz)
+ num=$(( $#files / 2 ))
+ toclean=( *(Om[1,$num]) )
+ lrzip -l -o - < *(Om[1,$num]) | /usr/bin/gpg2 -c -o msnap-$SNAPID.ark
+ if [[ $? == 0 ]];then
+ for file in $toclean;do
+ rm $file
+ done
+ else
+ echo "Failed: not proceeding: status :$?"
+ fi
+ echo "Syncing msnap-$SNAPID.ark"
+ cp -v msnap-$SNAPID.ark $REMOTE/
+ #for file in $toclean;do
+ #tar -cv -f - * | lrzip -l -o - | gpg -c
+ #done
+ popd
+}
+
+while getopts 'ac' opt;do
+ case $opt in
+ a)
+ add
+ ;;
+ c)
+ cleanup
+ ;;
+ *)
+ echo "$0 [-a] [-c]"
+ exit 1
+ esac
+done
diff --git a/bldins b/bldins
index 27b8ece..bd7650a 100755
--- a/bldins
+++ b/bldins
@@ -21,6 +21,7 @@ clean=${CLEAN:-1}
conf=${CONF:-1}
MAKEFLAGS=${MAKEFLAGS:--j8}
ccache=${CCACHE:-1}
+xen={XEN:-0}
export ARCH=x86_64
export LOCALVERSION=
export INSTALL_FW_PATH=/lib/firmware
diff --git a/booktwit b/booktwit
index d88c6a4..5ec673e 100755
--- a/booktwit
+++ b/booktwit
@@ -2,7 +2,6 @@
# vim: ft=sh et:
user=emptyvacuum
pass=$(cat $HOME/.booktwit)
-source bin/functions
if [[ $1 == "search" ]];then
~/bin/searchtwit.py "" $pass
diff --git a/browser b/browser
index 57ed719..87c50c1 100755
--- a/browser
+++ b/browser
@@ -13,13 +13,18 @@ if [[ $URL == (#i)(*.jpg|*.png|*.jpeg) ]];then
exit
fi
-if [[ $URL == *youtube.com/watch* ]];then
- notify-send "Browser" "youtube for $URL"
+if [[ $URL == *youtube.com/watch* || $URL == *vimeo.com* ]];then
+ notify-send "Browser" "youtube/vimeo for $URL"
#DFILE=
#trap 'rm $DFILE;kill $$' TERM
#trap '~/bin/mplayeraux stop' INT
#tubeplay $URL
- cvlc "$URL"
+ #cvlc "$URL" &! &>/dev/null
+ if [[ -t 0 ]];then
+ quvi --exec "/usr/bin/mplayer %u" $URL
+ else
+ quvi --exec "/usr/bin/mplayer %u" $URL &!
+ fi
#sleep 2
#DFILE=$(ls -Acr |tail -1)
#export DFILE
diff --git a/buildfox b/buildfox
new file mode 100755
index 0000000..366ccbe
--- a/dev/null
+++ b/buildfox
@@ -0,0 +1,23 @@
+#!/bin/zsh
+
+unset CFLAGS CXXFLAGS LDFLAGS CC CXX
+dest="/home/raghavendra/Arch/firefox"
+cd $dest
+buildir=$dest
+export LDFLAGS=" -Wl,-rpath,$dest/usr/lib/firefox-hg -Wl,--hash-style=gnu "
+cd /media/Yak/Repo/mozilla-central
+hg pull -u
+cp $buildir/mozconfig .mozconfig
+
+#patch -Np1 -i "$buildir/mozilla-firefox-1.0-lang.patch"
+#patch -Np1 -i "$buildir/linux3.patch"
+#patch -Np1 -i "$buildir/libstdc++.patch"
+
+#patch -Np1 -i "$buildir/flash-78414-3.patch" || exit 1
+
+
+autoconf-2.13
+
+
+make -j8 -f client.mk build
+make -j8 -f client.mk DESTDIR="$dest" install
diff --git a/corer b/corer
index 3c0eba9..d80b9a3 100755
--- a/corer
+++ b/corer
@@ -12,6 +12,7 @@ temp=($CORE_DIR/*)
if [[ $#temp > 20 ]];then
echo "No core file for now. Space isn't infinite" >>| $LOGF
+ exit
else
>| $CORE_DIR/$args.core
fi
diff --git a/current b/current
index 3811d29..4d21bd3 100755
--- a/current
+++ b/current
@@ -1,17 +1,16 @@
#!/bin/zsh
+[[ -z $1 ]] && exit 1
+typeset -A choice
+choice=(current ~/.current url ~/urls all "$HOME/.current $HOME/urls")
setopt shwordsplit
-isurl () {
- curl -I -s "$url" &>/dev/null || return 1
- return 0
- }
export yprofile="current"
while :;do
- object=$(paste ~/.current ~/note | tac | awk 'NF>0 { print $0 }' | ${DMENU} )
+ object=$(tac $=choice[$1] | awk 'NF>0 { print $0 }' | ${DMENU} )
[[ -z $object ]] && break
object=${(Q)object}
- if isurl $object;then firefox -new-tab $object; continue ;fi
+ URL=$(perl -MRegexp::Common=URI -lne 'm{$RE{URI}{HTTP}{-scheme => qr/https?/}{-keep}} && print $1' <<< $object)
+ if isurl $URL;then firefox -new-tab $URL; continue ;fi
xclip -i <<< "$object"
if =$object;then $object &!;fi
done
diff --git a/dmenu_run b/dmenu_run
index ed14020..9940fa7 100755
--- a/dmenu_run
+++ b/dmenu_run
@@ -1,4 +1,5 @@
#!/bin/zsh
#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=14' -m 0 -sb aquamarine4 -nb grey2 -nf grey50 -p : ` && exec ${=exe}
+#exe=`dmenu_path | yeganesh -f -- -i -fn 'xft:Bitstream:pixelsize=14' -m 0 -sb aquamarine4 -nb grey2 -nf grey50 -p : ` && exec ${=exe}
+exe=`dmenu_path | dmenu -i -fn 'xft:Bitstream:pixelsize=14' -m 0 -sb aquamarine4 -nb grey2 -nf grey50 -p : ` && exec ${=exe}
diff --git a/down b/down
index 94280b7..5d5eef4 100755
--- a/down
+++ b/down
@@ -8,6 +8,9 @@ exit 1
#mount | grep loop | grep -v pacman && sudo umount /mnt*
#unmount-removables || failed
+while pidof getmail;do
+ echo "Sleeping while fetching"
+done
killall -w getmail
pidof tmux && ~/bin/tux killall force
sync
diff --git a/download b/download
index 88e8392..d630332 100755
--- a/download
+++ b/download
@@ -11,8 +11,21 @@ then
mv "$URL" ~/.torrents/
else
- gid=$(aria2rpc addUri "$URL")
- notify-send "Aria" "Download started for $gid"
- echo "$gid:$URL >===============< $(date)" >>| $histfile
+ while pgrep plowdown;do
+ echo "plowing in progress"
+ sleep 5
+ done
+ if aria2mon | /bin/grep -v Download;then
+ echo "download $URL" >>| ~/.dque
+ else
+ if [[ $URL == *megaupload* ]];then
+ URL=$(plowdown --download-info-only=%url $URL |& tail -1)
+ fi
+ if [[ $? == 0 ]];then
+ gid=$(aria2rpc addUri "$URL")
+ notify-send "Aria" "Download started for $gid"
+ echo "$gid:$URL >===============< $(date)" >>| $histfile
+ fi
+ fi
fi
#vim set ts=4 sw=4 foldmethod=marker tw=80 noet:
diff --git a/functions b/functions
index 8e66f39..ed4904d 100644
--- a/functions
+++ b/functions
@@ -55,9 +55,16 @@ curl -s http://bash.org/?random1|grep -oE "<p class=\"quote\">.*</p>.*</p>"|grep
function ifind(){
find . -iname "*[email protected]*"
}
+sx(){
+ bfs=$(dmesg | /bin/grep BFS)
+ if [[ -n $bfs ]];then
+ schedtool -I -e /usr/bin/startx -- [email protected] &>|~/logs/X.log
+ else
+ /usr/bin/startx -- [email protected] &>|~/logs/X.log
+ fi
+}
mountole(){
-
keyctl list @u | grep -q b8d || ecryptfs-add-passphrase #&>/dev/null
keyctl list @u | grep -q b8d && mount | grep yie | grep -v grep || mount -i /home/raghavendra/wormole
#sudo sed -i -e '/.*ecryptfs.*/s|^/\(.*\)$|#&|g' /etc/fstab 1>/dev/null
@@ -68,6 +75,7 @@ mountole(){
return 1
fi
ssh-expect
+ [[ -z $1 ]] && sx
}
@@ -136,7 +144,12 @@ done
#}
function genscope(){
- /usr/bin/cscope -b -R -q -k
+ #/usr/bin/cscope -b -R -q -k
+ gitscope
+}
+function fize(){
+ #stat -c "%n %s %y %z" [email protected]
+ /bin/du -sh --time [email protected]
}
function cscope(){
#/usr/bin/cscope -d -f $(readlink -f (../)#cscope.out) [email protected]
@@ -185,14 +198,23 @@ function max(){
function rsize() {
wget --spider "[email protected]" -o /tmp/wget_tmp; grep -i Length /tmp/wget_tmp; rm /tmp/wget_tmp
}
+# http://unix.stackexchange.com/questions/6338/how-do-i-get-my-shell-functions-to-make-use-of-existing-autocompletion-in-zsh
+function compdefas () {
+ local a
+ a="$1"
+ shift
+ compdef "$_comps[$a]" "${(@)*}=$a"
+}
-function buildabs()
+function babs()
{
ABDIR="$HOME/Arch/repo"
abpath=$(find -O3 $ABDIR -maxdepth 2 -name "[email protected]" -type d | head -1)
[[ -z $abpath ]] && return 1
cp -R $abpath /dev/shm/ || return 1
- pushd /dev/shm/$1/repos/*-x86_64
+ #pushd /dev/shm/$1/repos/*-x86_64
+ #dirs=(*~*i686)
+ cd /dev/shm/$1/repos/
#clear
}
@@ -208,11 +230,14 @@ elif [[ $1 == http:* ]];then
url=${1#*=} # for urls like http://docs.google.com/viewer?url=<pdfurl>
dest="$HOME/Documents/${1##*/}"
wget -O - -q $url > $dest
- detach $VIEWER -r 143 $dest
+ detach $VIEWER $=VIEWER_OPTS $dest
else
- detach $VIEWER -r 143 "[email protected]"
+ detach $VIEWER $=VIEWER_OPTS "[email protected]"
fi
}
+function histsearch() {
+ grep "[email protected]" ~/.zsh/.histold/*
+}
function rcstop(){
for d in [email protected];do
@@ -259,7 +284,7 @@ function fdz() { ls -lth | egrep "[0-9](M|G)" | sort -k 5 -n | cut -d " " -f 5,
function dz() { find . -maxdepth $1 -type d -exec du {} \; | sort -n | awk '{ print $2,"\t",$1/1024,"MB" }' | uniq; }
function psp() { ps auxww | /bin/grep -i "[email protected]"; }
function svim() { sudo vim "[email protected]";}
-
+function svimdiff() { sudo vimdiff "[email protected]";}
define() {
@@ -310,11 +335,11 @@ webman(){
/usr/bin/w3m -dump -T text $url > ~/.helpers/man/man$manum/$term.$manum
}
-man(){
- if [[ ! -z $2 || -z $TMUX ]];then /usr/bin/man "[email protected]" ; return; fi
- /usr/bin/man -w [email protected] &>/dev/null || return $?
- tmux split-window -p 90 "LC_ALL=C LANG=C exec /usr/bin/man [email protected]"
-}
+#man(){
+ #if [[ ! -z $2 || -z $TMUX ]];then /usr/bin/man "[email protected]" ; return; fi
+ #/usr/bin/man -w [email protected] &>/dev/null || return $?
+ #tmux split-window -p 90 "LC_ALL=C LANG=C exec /usr/bin/man [email protected]"
+#}
append(){
@@ -380,12 +405,11 @@ loopit(){
fi
}
-isurl(){
- curl -I -s "$url" &>/dev/null || return 1
- return 0
+secho() {
+ echo $1 | sudo tee $2
}
+
mecho(){
#detect if being invoked through dmenu or terminal - use zenity or stdout
#based on that
@@ -504,16 +528,16 @@ search(){
surfraw google "[email protected]"
}
-ins(){
+function {ins,inss} {
if [[ $1 == *xz || $1 == *pkg.tar ]];then
sudo pacman -U $1
else
- sudo pacman -S "[email protected]"
+ sudo pacman -S "[email protected]"
fi
}
-extract() {
+xtract() {
if [[ -z "$1" ]] ; then
print -P "usage: \e[1;36mextract\e[1;0m < filename >"
print -P " Extract the file specified based on the extension"
@@ -632,14 +656,6 @@ function {reboot,sdown} {
eval "$=map[$command]"
fi
}
-startx(){
- bfs=$(dmesg | /bin/grep BFS)
- if [[ -n $bfs ]];then
- schedtool -I -e /usr/bin/startx -- [email protected] &>|~/logs/X.log
- else
- /usr/bin/startx -- [email protected] &>|~/logs/X.log
- fi
-}
viewjson(){
python -mjson.tool < $1
@@ -649,7 +665,7 @@ pacsync(){
sudo pacman -Sy
}
-update(){
+pacupdate(){
sudo pacman -Su
}
diff --git a/gencov b/gencov
new file mode 100755
index 0000000..f8f642d
--- a/dev/null
+++ b/gencov
@@ -0,0 +1,10 @@
+#!/bin/zsh
+arg=$1
+kerneldir="/media/Corona/bldit"
+pidof qemu-kvm || exit 1
+cd $kerneldir
+mkdir .lcov
+ssh -t -p 2222 [email protected] sudo /usr/bin/gcovmake
+geninfo -b $kerneldir -o application.info .gcov/$arg || exit 1
+genhtml -s -o .lcov/ --highlight --legend application.info
+
diff --git a/getimap b/getimap
index ae57fbb..cb87ec0 100755
--- a/getimap
+++ b/getimap
@@ -1,4 +1,5 @@
#!/bin/bash
+pidof X || exit 13
export DISPLAY=":0"
echo "#########################`date`####################" >> ~/logs/getmail.log
if ! mount | grep -q wormole;then
@@ -27,5 +28,5 @@ DURATION=6 notify-send "Mailman" "....Fetching mails."
/usr/sbin/setlock -X -n /tmp/locks/getmail getmail -n -v --rcfile=getmailrc.gmail --rcfile=getmailrc.yahoo --rcfile=getmailrc.wnohang --rcfile=getmailrc.gmail2
exitcode=$?
echo "Fetch : Exit code: $exitcode #########################`date`#################### Done" >> ~/logs/getmail.log
-
+sync
[[ $exitcode == 0 ]] && notify-send "Mailman" ".. Done "
diff --git a/gitscope b/gitscope
index f1d7fae..250a7a0 100755
--- a/gitscope
+++ b/gitscope
@@ -1,9 +1,46 @@
#!/bin/zsh
+[[ -n $NOHOOK ]] && exit 12
+#while pidof cscope;do
+ #echo "Cscope already running"
+ #exit
+#done
+isgit=0
+genfile=0
+[[ -d .git ]] && isgit=1
+if [[ $SHLVL -gt 6 ]];then
+ echo "Not required here"
+ exit
+fi
+if [[ ( -n $1 && $1 == $2) || $3 = 0 ]];then
+ exit
+fi
+#if [[ isgit = 1 && ((! $1 =~ [0]{40} && $1 != $2) || ! -f cscope.files) ]];then
+if [[ $isgit = 1 ]];then
+ if [[ ( -f cscope.files && $1 != $2 ) || ! -f cscope.files ]];then
+ genfile=1
+ fi
+fi
# post-merge too ?
-if [[ $1 =~ [0]{40} ]];then
- /usr/bin/cscope -b -R -q
- exit
+#if [[ $1 =~ [0]{40} ]];then
+# Kernel mode
+if [[ -f Kconfig ]];then
+ epattern="arm|alpha|avr32|blackfin|cris|frv|h8300|ia64|m32r|m68k|microblaze|mips|mn10300|parisc|powerpc|s390|score|sh|sparc|tile|unicore32|xtensa"
+ #make ARCH=x86 cscope
+ if [[ $genfile = 1 ]];then
+ #git ls-files | /bin/grep -v -E "^arch/($epattern)|^Documentation|^drivers" | /bin/grep -E '\.[chS]$' >| cscope.files
+ git ls-files | /bin/grep -v -E "^arch/($epattern)|^Documentation" | /bin/grep -E '\.[chS]$' >| cscope.files
+ fi
+ /usr/bin/cscope -b -q -k
+else
+ if [[ $genfile = 1 ]];then
+ git ls-files >| cscope.files
+ /usr/bin/cscope -b -q
+ else
+ /usr/bin/cscope -b -R -q
+ fi
fi
-scopefile="/tmp/gitscope.$$"
-git --no-pager diff --diff-filter=AMRC --name-only $1 $2 >| $scopefile && \
- (cscope -b -q -i $scopefile && rm $scopefile) &!
+ #exit
+#fi
+#scopefile="/tmp/gitscope.$$"
+#git --no-pager diff --diff-filter=AMRC --name-only $1 $2 >| $scopefile && \
+ #(cscope -b -q -R && rm $scopefile) &!
diff --git a/ifstatus b/ifstatus
new file mode 100755
index 0000000..f76fa5c
--- a/dev/null
+++ b/ifstatus
@@ -0,0 +1,8 @@
+#!/bin/zsh
+ipaddr=$(upnpc -s | /bin/grep -i --color External | cut -d "=" -f 2)
+if fping google.com &>/dev/null;then
+ print "$ipaddr ⬆⬆"
+else
+ print "⬇⬇"
+fi
+
diff --git a/isurl b/isurl
new file mode 100755
index 0000000..5b029de
--- a/dev/null
+++ b/isurl
@@ -0,0 +1,8 @@
+#!/usr/bin/perl
+use Data::Validate::URI qw(is_uri);
+$ret = is_uri($ARGV[0]);
+if ($ret) {
+ exit(0);
+} else {
+ exit(1);
+}
diff --git a/mailboxes b/mailboxes
index db7c2de..6c64581 100755
--- a/mailboxes
+++ b/mailboxes
@@ -36,7 +36,7 @@ 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|KVM)' \
+ | /bin/grep -v -E '(Chro|Old|Junk|Kro|INBOX|Search|Dyne|Wnohang|Yahoo|Sent|Me|Archive|Important|Todo)' \
| tr '\n' ' ' \
| tr -s ' ') \
~/Mail/Important/ \
diff --git a/mark-yank-urls b/mark-yank-urls
index d6cc743..25bfdb6 100755
--- a/mark-yank-urls
+++ b/mark-yank-urls
@@ -21,13 +21,13 @@ sub on_start {
import Clipboard;
}
- eval { require Regexp::Common::URI };
- require Regexp::Common;
- Regexp::Common->import('URI');
-
- $url_matcher = $Regexp::Common::RE{URI}{HTTP};
- }
+# eval { require Regexp::Common::URI };
+# require Regexp::Common;
+# Regexp::Common->import('URI');
+#
+# $url_matcher = $Regexp::Common::RE{URI}{HTTP};
+# }
$term->{browser} = $term->x_resource ("urlLauncher") || "x-www-browser";
$term->{browser2} = $term->x_resource ("launcher2") || "x-www-browser";
@@ -40,15 +40,13 @@ sub on_line_update {
# Fetch the line that has changed.
my $line = $term->line($row);
my $text = $line->t;
+
# Find and underline URLs.
while ($text =~ /($url_matcher)/g) {
my $url = $1;
my $rend = $line->r;
- # Also yank the url
- Clipboard->copy($url);
-
# Mark all characters as underlined. we _must_ not toggle underline, as
# we might get called on an already-marked URL.
my $underlineURLs = $term->x_resource ('underlineURLs') || 'false';
@@ -62,7 +60,8 @@ sub on_line_update {
$line->r($rend);
}
}
-
+# Clipboard->copy($url);
+# system("echo abcdefef | xclip -i");
()
}
@@ -132,8 +131,6 @@ sub do_scan_for_urls {
push @url_db, \%h;
}
}
-
- # 0 for none, positive count otherwise
return $#url_db + 1;
}
diff --git a/mpdStats b/mpdStats
index 7e3bec9..68d536b 100755
--- a/mpdStats
+++ b/mpdStats
@@ -1,4 +1,4 @@
#!/bin/zsh
#mpc status | tr '\n' '@' | perl -lne 'print substr($1,0,45).qq/ $2/ if m{^(.+)@\Q[\E.+(\d+:\d+/\d+:\d+)}'
-mpc status | tr '\n' '@' | perl -ne 'print "♬ ".substr($1,0,55).qq/ $2/." ♬" if m{^(.+)@\Q[\E.+(\d+:\d+/\d+:\d+)}'
+mpc status | tr '\n' '@' | perl -ne 'print "♬ ".substr($1,0,65).qq/ $2/." ♬" if m{^(.+)@\Q[\E.+(\d+:\d+/\d+:\d+)}'
diff --git a/mplayer b/mplayer
index 0517880..88d0da2 100755
--- a/mplayer
+++ b/mplayer
@@ -14,6 +14,9 @@ if [[ ! -e $MPSOCKET ]] ;then
ln -sf $MPSOCKET /tmp/mplayer.fif
notify-send "Mplayer" "mplayer starting up....."
fi
+#if [[ ! -t 0 ]];then
+# stdin=1
+#fi
[[ $start == 1 ]] && stdin=0
exec &>>|/tmp/mplayer.log
@@ -28,6 +31,8 @@ if [[ $stdin == 1 ]];then
${=LOCK}/mplayer.$randnum /usr/bin/mplayer -$vo_map[$fixedvo] -msglevel all=4 -slave -idle -input file=$MPSOCKET -input conf=$HOME/.mplayer/input.conf.mine &!
else
${=LOCK}/mplayer.$randnum /usr/bin/mplayer -$vo_map[$fixedvo] -msglevel all=4 -slave -idle -input file=$MPSOCKET -input conf=$HOME/.mplayer/input.conf.mine &!
+ #${=LOCK}/mplayer.$randnum $HOME/Arch/Hub/mplayer2/mplayer -$vo_map[$fixedvo] -msglevel all=4 -slave -idle -input file=$MPSOCKET -input conf=$HOME/.mplayer/input.conf.mine &!
+ #${=LOCK}/mplayer.$randnum $HOME/Arch/Hub/mplayer2/mplayer -noconfig user -$vo_map[$fixedvo] -msglevel all=4 -slave -idle -input file=$MPSOCKET -input conf=$HOME/.mplayer/input.conf.mine &!
fi
popd -q
[[ $start == 1 ]] && exit
diff --git a/mplayer.fns b/mplayer.fns
index ba9b040..3247f2c 100644
--- a/mplayer.fns
+++ b/mplayer.fns
@@ -21,12 +21,6 @@ pecho(){
echo < $file
}
-# curl for non-strict url parsing ;)
-isurl () {
- curl -I -s "$url" &>/dev/null || return 1
- return 0
-}
check_pattern(){
diff --git a/notify-send b/notify-send
index b46e0af..a8d507a 100755
--- a/notify-send
+++ b/notify-send
@@ -1,4 +1,5 @@
#!/bin/zsh
+pidof X &>/dev/null || exit 0
source ~/config/profile
duration=${DURATION:-5}
sdate=${SDATE:-1}
@@ -35,13 +36,17 @@ xnotify_exp(){
}
cnotify(){
- tmux display-message '[email protected]'
+ if pidof tmux;then
+ tmux display-message '[email protected]'
+ else
+ echo "[email protected]" | write raghavendra /dev/tty1
+ fi
}
num=$(pgrep dzen2 | wc -l)
num=$(( $num % (maximum+1) ))
if [[ $num > $maximum ]];then
- sleep $duration
+ sleep $(( duration*num ))
else
y=$(( y + num*displacement ))
sleep $num
diff --git a/pdfspider b/pdfspider
index e25d105..503025f 100755
--- a/pdfspider
+++ b/pdfspider
@@ -1,30 +1,10 @@
#!/usr/bin/env python2
-#
-# Index each paragraph of a text file as a Xapian document.
-#
-# Copyright (C) 2003 James Aylett
-# Copyright (C) 2004,2007 Olly Betts
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
-# USA
-
import sys
import xapian
import string
import subprocess
import shlex
+import os.path as P
from pyPdf import PdfFileReader
datadir="/dev/shm/pindex"
@@ -36,14 +16,14 @@ type = sys.argv[1] if len(sys.argv) > 1 else "query"
database = xapian.WritableDatabase(datadir, xapian.DB_CREATE_OR_OPEN)
if type == "add":
- try:
- datadir = sys.argv[2] if len(sys.argv) > 2 else "/dev/shm/pindex"
- limit = int(sys.argv[3]) if len(sys.argv) > 3 else 10
- # Open the database for update, creating a new database if necessary.
- indexer = xapian.TermGenerator()
- stemmer = xapian.Stem("english")
- indexer.set_stemmer(stemmer)
- for pfile in output.split('\n'):
+ datadir = sys.argv[2] if len(sys.argv) > 2 else "/dev/shm/pindex"
+ limit = int(sys.argv[3]) if len(sys.argv) > 3 else 10
+ # Open the database for update, creating a new database if necessary.
+ indexer = xapian.TermGenerator()
+ stemmer = xapian.Stem("english")
+ indexer.set_stemmer(stemmer)
+ for pfile in output.split('\n'):
+ try:
if (limit == 0):
break
print "Adding file %s" % pfile
@@ -51,19 +31,24 @@ if type == "add":
for i in range(pdf.getNumPages()):
data = pdf.getPage(i).extractText()
doc = xapian.Document()
- doc.set_data(str(pdf.getDocumentInfo().title))
+ try:
+ title = pdf.getDocumentInfo().title
+ except:
+ title = P.basename(pfile)
+ #doc.set_data(str(title))
+ doc.set_data(data)
doc.add_value(1,pfile)
doc.add_value(2,str(i))
- #doc.add_term("T"+pdf.getDocumentInfo().title)
+ doc.add_term("T"+title)
indexer.set_document(doc)
indexer.index_text(data)
database.add_document(doc)
limit = limit - 1
- except Exception as e:
- print >> sys.stderr, "Exception: %s" % str(e)
- sys.exit(1)
+ except Exception as e:
+ print >> sys.stderr, "Exception: %s" % str(e)
+ continue
elif type == "query" and len(sys.argv) > 2:
try:
@@ -71,9 +56,11 @@ elif type == "query" and len(sys.argv) > 2:
except Exception as e:
print "Exception: %s" % str(e)
sys.exit(1)
-
- query_string = " ".join(sys.argv[2].split(','))
- limit = int(sys.argv[3]) if len(sys.argv) > 3 else 10
+ #flags = xapian.Query.OP_OR
+ #if (sys.argv[2].find(',')):
+ #flags=
+ limit = int(sys.argv[2]) if len(sys.argv) > 2
+ query_string = sys.argv[3:]
qp = xapian.QueryParser()
stemmer = xapian.Stem("english")
qp.set_stemmer(stemmer)
@@ -91,7 +78,7 @@ elif type == "query" and len(sys.argv) > 2:
for m in matches:
print "%i: %i%% docid=%i [%s]" % (m.rank + 1, m.percent, m.docid, m.document.get_data())
for ter in m.document.values():
- print ter.value
+ print "%d : %s" %(ter.num,ter.value)
else:
print "Usage: %s query|add database|(term1,term2..) limit" % sys.argv[0]
sys.exit(1)
diff --git a/pdfspider2 b/pdfspider2
new file mode 100755
index 0000000..21f1fba
--- a/dev/null
+++ b/pdfspider2
@@ -0,0 +1,86 @@
+#!/usr/bin/env python2
+import sys
+import xapian
+import string
+import subprocess
+import shlex
+import os.path as P
+from pyPdf import PdfFileReader
+
+datadir="/dev/shm/pindex"
+sstring = "locate *.pdf"
+files = subprocess.Popen(shlex.split(sstring),stdout=subprocess.PIPE,stderr=subprocess.PIPE)
+output,err = files.communicate()
+
+type = sys.argv[1] if len(sys.argv) > 1 else "query"
+database = xapian.WritableDatabase(datadir, xapian.DB_CREATE_OR_OPEN)
+
+if type == "add":
+ datadir = sys.argv[2] if len(sys.argv) > 2 else "/dev/shm/pindex"
+ limit = int(sys.argv[3]) if len(sys.argv) > 3 else 10
+ # Open the database for update, creating a new database if necessary.
+ indexer = xapian.TermGenerator()
+ stemmer = xapian.Stem("english")
+ indexer.set_stemmer(stemmer)
+ for pfile in output.split('\n'):
+ try:
+ if (limit == 0):
+ break
+ print "Adding file %s" % pfile
+ pdf = PdfFileReader(file(pfile,"rb"))
+ for i in range(pdf.getNumPages()):
+ data = pdf.getPage(i).extractText()
+ doc = xapian.Document()
+ try:
+ title = pdf.getDocumentInfo().title
+ except:
+ title = P.basename(pfile)
+ #doc.set_data(str(title))
+ doc.set_data(data)
+
+ doc.add_value(1,pfile)
+ doc.add_value(2,str(i))
+ #doc.add_term("T"+pdf.getDocumentInfo().title)
+ indexer.set_document(doc)
+ indexer.index_text(data)
+
+ database.add_document(doc)
+ limit = limit - 1
+ except Exception as e:
+ print >> sys.stderr, "Exception: %s" % str(e)
+ continue
+
+elif type == "query" and len(sys.argv) > 2:
+ try:
+ enquire = xapian.Enquire(database)
+ except Exception as e:
+ print "Exception: %s" % str(e)
+ sys.exit(1)
+
+ #if (sys.argv[2].find(',')):
+ #flags=
+ query_string = " ".join(sys.argv[2].split(','))
+ limit = int(sys.argv[3]) if len(sys.argv) > 3 else 10
+ qp = xapian.QueryParser()
+ stemmer = xapian.Stem("english")
+ qp.set_stemmer(stemmer)
+ qp.set_database(database)
+ qp.set_stemming_strategy(xapian.QueryParser.STEM_SOME)
+ query = qp.parse_query(query_string)
+ print "Parsed query is: %s" % str(query)
+
+ enquire.set_query(query)
+ matches = enquire.get_mset(0,limit)
+ # Display the results.
+ print "%i results found." % matches.get_matches_estimated()
+ print "Results 1-%i:" % matches.size()
+
+ for m in matches:
+ print "%i: %i%% docid=%i [%s]" % (m.rank + 1, m.percent, m.docid, m.document.get_data())
+ for ter in m.document.values():
+ print "%d : %s" %(ter.num,ter.value)
+else:
+ print "Usage: %s query|add database|(term1,term2..) limit" % sys.argv[0]
+ sys.exit(1)
+#if __name__ == '__main__':
+# sys.exit(
diff --git a/reminder b/reminder
index 32f1c66..ae5c35a 100755
--- a/reminder
+++ b/reminder
@@ -10,7 +10,7 @@ cookie="$(fortune -n 200 -a -s | tr -d '<' | tr '>' ':')"
#<i>$(date -R)</i>
#----------------------
#$cookie"
-SDATE=0 DURATION=8 ~/bin/notify-send "Reminder" "^i(/home/raghavendra/.notify-icons/reminder.xpm)Tasks left:$tasks | $(date -R) | $cookie"
+SDATE=0 DURATION=15 ~/bin/notify-send "Reminder" "Tasks left:$tasks | $(date -R) | $cookie"
exit 0
#sleep 2
#mtasks="
diff --git a/shaper b/shaper
index 6600901..3338843 100755
--- a/shaper
+++ b/shaper
@@ -1,11 +1,14 @@
#!/bin/bash
-
+#exit
# The Ultimate Setup For Your Internet Connection At Home
+#tc qdisc add dev eth0 root handle 1: sfb
+#tc qdisc add dev eth0 handle 2: parent 1: prio
+# exit
#
#
# Set the following values to somewhat less than your actual download
# and uplink speed. In kilobits
-DOWNLINK=1920
+DOWNLINK=2400
UPLINK=490
DEV=eth0
@@ -36,8 +39,10 @@ tc class add dev $DEV parent 1:1 classid 1:20 htb rate $[9*$UPLINK/10]kbit \
burst 6k prio 2
# both get Stochastic Fairness:
-tc qdisc add dev $DEV parent 1:10 handle 10: sfq perturb 10
-tc qdisc add dev $DEV parent 1:20 handle 20: sfq perturb 10
+#tc qdisc add dev $DEV parent 1:10 handle 10: sfq perturb 10
+#tc qdisc add dev $DEV parent 1:20 handle 20: sfq perturb 10
+tc qdisc add dev $DEV parent 1:10 handle 10: sfb
+tc qdisc add dev $DEV parent 1:20 handle 20: sfb
# TOS Minimum Delay (ssh, NOT scp) in 1:10:
tc filter add dev $DEV parent 1:0 protocol ip prio 10 u32 \
@@ -68,10 +73,10 @@ tc filter add dev $DEV parent 1: protocol ip prio 10 u32 \
#
# attach ingress policer:
-tc qdisc add dev $DEV handle ffff: ingress
+#tc qdisc add dev $DEV handle ffff: ingress
# filter *everything* to it (0.0.0.0/0), drop everything that's
# coming in too fast:
-tc filter add dev $DEV parent ffff: protocol ip prio 50 u32 match ip src \
- 0.0.0.0/0 police rate ${DOWNLINK}kbit burst 10k drop flowid :1
+#tc filter add dev $DEV parent ffff: protocol ip prio 50 u32 match ip src \
+# 0.0.0.0/0 police rate ${DOWNLINK}kbit burst 10k drop flowid :1
diff --git a/shotrss b/shotrss
index 5ed3eb6..d0aa9ef 100755
--- a/shotrss
+++ b/shotrss
@@ -8,8 +8,8 @@ dbfile="$HOME/.local/share/newsbeuter/cache.db"
material=$(sqlite3 -separator ' # ' $dbfile "select title,url from rss_item where feedurl='$url' ORDER BY pubDate DESC LIMIT 5;" |\
sed -n -e $(( $RANDOM % 5 + 1 ))p)
-echo "$material[(ws:#:)2]"
-echo "$material" > ~/.current
+echo "$material[(ws:#:)1]"
+echo "$material" >> ~/.current
exec &>/dev/null
pidof w3m || exit 0
winum=$(~/bin/tux tnum w3m)
diff --git a/speeddial b/speeddial
index 7c3740b..68076f7 100755
--- a/speeddial
+++ b/speeddial
@@ -3,9 +3,10 @@ export yprofile="speed"
while :;do
- url=$(awk '{ print NR" "$0 }' ~/.speed | ${(e)=YDMENU} | awk '{ print $2 }')
+ url=$(awk '{ print NR" "$0 }' ~/.speed | ${(e)=DMENU} | awk '{ print $2 }')
+ #print $url
[[ -z $url ]] && exit
- ~/bin/browser "$url"
+ ~/bin/browser "$url" &
done
diff --git a/suz b/suz
index 14c6f05..277fba1 100755
--- a/suz
+++ b/suz
@@ -3,11 +3,6 @@
CBROWSER="luakit"
#exec &>/dev/null
-isurl () {
- curl -I -s "$url" &>/dev/null || return 1
- return 0
-}
if [[ -z $1 ]]
diff --git a/tmux-url b/tmux-url
index c2bcbab..ed0887b 100755
--- a/tmux-url
+++ b/tmux-url
@@ -8,21 +8,21 @@ tmux save-buffer /tmp/mux-buffer
typeset -A dispatcher
dispatcher=(
';' '/bin/true'
-':' 'ubrowser'
+':' '/bin/true'
)
while :;do
- LAST_URL=${$(/bin/grep -i -E 'http[s]?:.*' /tmp/mux-buffer | tac | $=DMENU ):?Empty input}
+ LAST_URL=${$(/bin/grep -i -E 'http[s]?:.*' /tmp/mux-buffer | tac | gawk 'BEGIN { RS="http[s]?:[[:graph:]]+"; } { print $1,RT }' | $=DMENU ):?Empty input}
echo "$LAST_URL" >>| ~/.current
method=$dispatcher[$LAST_URL[-1]]
if [[ -n $method ]];then
LAST_URL=$(perl -MRegexp::Common=URI -lne 'm{$RE{URI}{HTTP}{-scheme => qr/https?/}{-keep}} && print $1' <<< ${LAST_URL[1,-2]})
- $method $LAST_URL
+ $method $LAST_URL &
break
else
LAST_URL=$(perl -MRegexp::Common=URI -lne 'm{$RE{URI}{HTTP}{-scheme => qr/https?/}{-keep}} && print $1' <<< ${LAST_URL})
- browser $LAST_URL
+ browser $LAST_URL &
fi
done
xclip -i <<< $LAST_URL
diff --git a/vacuum b/vacuum
index cd9f6f8..da69bb0 100755
--- a/vacuum
+++ b/vacuum
@@ -1,3 +1,4 @@
#!/bin/zsh
cd ~/.mozilla/firefox
-print -l **/*.sqlite | xargs -I {} (sqlite3 {} vacuum; sqlite3 {} reindex)
+print -l **/*.sqlite | xargs -I {} sqlite3 {} vacuum
+print -l **/*.sqlite | xargs -I {} sqlite3 {} reindex
diff --git a/volchange b/volchange
index e056f30..88dc0e2 100755
--- a/volchange
+++ b/volchange
@@ -1,5 +1,5 @@
#!/bin/zsh
-if lsmod | =grep -q oss_hdaudio;then
+if =grep -q oss_hdaudio /proc/modules;then
type="vmix0-outvol"
max="25.0"
@@ -15,7 +15,12 @@ if lsmod | =grep -q oss_hdaudio;then
ossmix $type -- "$curvol"
else
if [[ $1 = 'cur' ]];then
- amixer get Master | =grep -o -E "[0-9]+%"
+ vol=$(amixer get Master | /bin/grep Mono:)
+ if =grep -q "\[on\]" <<<$vol;then
+ amixer get Master | /bin/grep Mono: | perl -lne 'print ($_ =~ m{([0-9]+)%})'
+ else
+ echo -n "Mute"
+ fi
exit
fi
if [[ $1 = '1' ]];then curvol="10%+" ;fi
diff --git a/w3m b/w3m
index fef33b8..ede25f7 100755
--- a/w3m
+++ b/w3m
@@ -1,11 +1,6 @@
#!/bin/zsh
#set -x
-isurl () {
- curl -I -s "$url" &> /dev/null || return 1
- return 0
-}
session="uake"
own=$$
diff --git a/wsync b/wsync
index 33b5e7d..37e9a45 100755
--- a/wsync
+++ b/wsync
@@ -1,4 +1,9 @@
#!/bin/zsh
+mount | grep -q "/sate" || {
+ echo "FATAL: remote not mounted"
+ exit 100
+}
+[[ -d /tmp/wsync ]] && exit 10
mkdir -p /tmp/wsync
gproj=""
projdir="/home/raghavendra/Arch/Projects"
@@ -41,13 +46,17 @@ rpush(){
pread "Commit $proj and then continue"
git diff
echo "Stop ?"
- read -q || {
+ read -q
+ if [[ $? = 0 ]];then
git add -A
git commit -v || {
git reset --soft
continue
}
- }
+ else
+ echo "Repo not pushed"
+ return
+ fi
done
git push --mirror -v ssh://[email protected]/$remotedir:t/$projname.git
fi