Commit 2d81ef30 authored by Daniel STAN's avatar Daniel STAN

rajout des bin de zamok

parent dbb16129
#!/bin/bash
if [ ! `umask` = "0002" ] && [ "$(/usr/bin/stat -c %u .)" != "$(id -u)" ]; then
echo "ATTENTION, tu n'as pas le bon umask !!!"
umask
exit 1
fi;
exec /usr/bin/git "$@"
#!/bin/bash
grep -i $1 /usr/scripts/gestion/ethercodes.dat
#!/bin/bash
# Récupère une adresse mac (formatée n'importe comment) et lance un (z)grep
# qui filtre sur l'adresse mac (tout formattage possible)
MAC=`echo "$1" | tr A-Z a-z |
sed "s/\([0-9a-f]\{2\}\).*\([0-9a-f]\{2\}\).*\([0-9a-f]\{2\}\).*\([0-9a-f]\{2\}\).*\([0-9a-f]\{2\}\).*\([0-9a-f]\{2\}\)/\1.\2.\3.\4.\5.\6/"`
#MAC=`echo "$1" | sed "\
# y/ABCDEF/abcdef/; \
# s/[^0-9a-f]//g; \
# s/$/x/; \
# s/[^x]/\0.\\\\\?/g; \
# s/x$//
# "`
#echo "$MAC"
#exit
shift 1
exec zgrep --color=always -i $MAC "$@"
#!/bin/bash
# Collect DBUS_SESSION_BUS_ADDRESS from running process
function set_dbus_adress
{
USER=$1
PROCESS=$2
PID=`pgrep -o -u $USER $PROCESS`
ENVIRON=/proc/$PID/environ
if [ -e $ENVIRON ]
then
export `grep -z DBUS_SESSION_BUS_ADDRESS $ENVIRON`
else
echo "Unable to set DBUS_SESSION_BUS_ADDRESS."
exit 1
fi
}
function spotify_cmd
{
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.$1 1> /dev/null
}
function spotify_query
{
qdbus org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player PlaybackStatus
}
function quit_message
{
echo "Usage: `basename $0` {play|pause|playpause|next|previous|stop|playstatus|<spotify URI>}"
exit 1
}
# Count arguments, must be 1
if [ "$#" -ne "1" ]
then
echo -e "You must supply exactly one argument!\n"
quit_message
fi
# Check if DBUS_SESSION is set
if [ -z $DBUS_SESSION_BUS_ADDRESS ]
then
#echo "DBUS_SESSION_BUS_ADDRESS not set. Guessing."
set_dbus_adress `whoami` spotify
fi
case "$1" in
play)
spotify_cmd Play
;;
pause)
spotify_cmd Pause
;;
playpause)
spotify_cmd PlayPause
;;
next)
spotify_cmd Next
;;
previous)
spotify_cmd Previous
;;
stop)
spotify_cmd Stop
;;
spotify:user:*)
spotify_cmd "OpenUri string:$1"
spotify_cmd Play
;;
spotify:*:*)
spotify_cmd "OpenUri string:$1"
;;
playstatus)
spotify_query
;;
*)
echo -e "Bad argument.\n"
quit_message
;;
esac
exit 0
#!/bin/bash
# Petit script qui diff mon dossier Mail, afin de
# s'assurer que je n'ai pas une règle procmail foireuse
# qui a créé entre temps un nouveau dossier (non suivi par
# TB !)
BACK=/home/dstan/Mail/mylist
BACKBIS=/home/dstan/Mail/mylist.old
DIR=/home/dstan/Mail
mv $BACK $BACKBIS
ls -a $DIR | grep -v "^dovecot-uidvalidity" | sort > $BACK
diff $BACKBIS $BACK
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment