Skip to content

Instantly share code, notes, and snippets.

"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause" XF86AudioPlay
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Stop" XF86AudioStop
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next" XF86AudioNext
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous" XF86AudioPrevious
@l-modolo
l-modolo / udev-unmounter.sh
Created June 19, 2015 09:24
/usr/local/sbin/udev-unmounter.sh
#!/bin/sh
#
# USAGE: udev-unmounter.sh MOUNTPT
# MOUNTPT is a mountpoint we want to unmount and delete.
MOUNTPT="$1"
if [ -z "$MOUNTPT" ]; then
exit 1
fi
@l-modolo
l-modolo / udev-auto-mount.sh
Created June 19, 2015 09:23
/usr/local/sbin/udev-auto-mount.sh
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
@l-modolo
l-modolo / udev-automounter.sh
Created June 19, 2015 09:21
/usr/local/sbin/udev-automounter.sh
#!/bin/sh
#
# USAGE: usb-automounter.sh DEVICE
# DEVICE is the actual device node at /dev/DEVICE
/usr/local/sbin/udev-auto-mount.sh ${1} &
@l-modolo
l-modolo / rtorrent
Created June 19, 2015 08:58
Daemonise rtorrent with screen with the file /etc/init.d/rtorrent
#!/bin/bash
### BEGIN INIT INFO
# Provides: rtorrent
# Required-Start: $local_fs $remote_fs $network $syslog $netdaemons
# Required-Stop: $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: rtorrent script using screen(1)
# Description: rtorrent script using screen(1) to keep torrents working without the user logging in
### END INIT INFO
@l-modolo
l-modolo / .rtorrent.rc
Created June 19, 2015 08:43
my rtorrent configuration file
# This is an example resource file for rTorrent. Copy to
# ~/.rtorrent.rc and enable/modify the options as needed. Remember to
# uncomment the options you wish to enable.
# Sort the main view by name
view.sort_current = main,less=d.get_name=
view.sort_new = main,less=d.get_name=
view.sort = main
# Maximum and minimum number of peers to connect to per torrent.
@l-modolo
l-modolo / sms.sh
Created June 19, 2015 08:37
Small script to send sms with free. Replace <userid> and <userpasswd> by your own.
#!/bin/sh
echo $@
text=""
for i in $@
do
text+=$i
text+="%20"
done
curl -k https://smsapi.free-mobile.fr/sendmsg\?user=userid\&pass=userpasswd\&msg=$text
@l-modolo
l-modolo / .screenrc
Created June 19, 2015 08:33
.screenrc file
autodetach on # autodetach on disconnect/close
startup_message off # disable intro msg
defscrollback 8000 # default scrollback buffer
vbell off # enable visual bell
#escape `` # replace C- escape sequence
#escape `e # double-tap backtick toggles screen windows
# reset escape key to the default
escape ^Aa
@l-modolo
l-modolo / .bashrc
Last active August 29, 2015 14:23
.bashrc file
#append history file
shopt -s histappend
#check windows size
shopt -s checkwinsize
alias ls='ls'
alias ll='ls -salh'
alias java32='/opt/bin32-jre/jre/bin/java'
alias yaourtfull='yaourt -Syu --devel --aur'
@l-modolo
l-modolo / network_scan.sh
Created March 24, 2015 09:29
scan the network for device
#!/bin/bash
# scan the network for device
# usage: sudo network_scan.sh
arp -a | grep 192 | grep -v 255 | perl -pe 's/\? \((.*)\) at ([^\s]*) on .*/\1 \2/g' | \
awk '{print $1; print $2; system("nmap -O "$1" | grep Running")}'