Skip to content

Instantly share code, notes, and snippets.

View bonelifer's full-sized avatar

William Jacoby bonelifer

View GitHub Profile
@kamermans
kamermans / auto_subscribe_moderators.php
Created February 20, 2012 15:31
Subscribe all phpBB3 moderators to all forums/topics
#!/usr/bin/php
<?php
/**
* This script subscribes all global moderators to all forums.
* Put this in your phpBB3 directory and do "chmod 0700 auto_subscribe_moderators.php"
* You can use crontab to run this script so your moderators stay subscribed!
*/
// Path to the phpBB3 Config Script
require dirname(__FILE__).'/config.php';
@astanin
astanin / Direct_Links_in_Google_Search.user.js
Created September 25, 2012 14:52
Remove indirections from Google search results on all TLDs (GreaseMonkey script)
#!/bin/bash
# Description:
# Script to query mpd's status and download a cover of the currently playing
# song on song-change and execute a user-defined command to show the cover.
# (e.g. with notify-send, by default with a image viewer for testing)
# Feel free to make your customizations here.
MPD_SERVER="--port 6600 --host localhost" # For default case.
#!/bin/sh
# Usage: add-random [[NUMBER [FILTER]]
sels="${1:-10}"
filter="${2:-}"
mpc listall | grep "$filter" | shuf | head "-n" "$sels" | while read selected
do
echo "$selected"
@da-n
da-n / backup.sh
Last active October 8, 2023 08:08
Backup script with Pushover notifications. Pushover is optional, you can edit it out if not required. To get this script running check all the parameters at the top.
#!/bin/bash
DATE=`date +%Y%m%d-%H%M%S`
PROGNAME=$(basename $0)
APPEND=-$DATE.tar.gz
# Set the local backup directory, ensure that this directory exists
LOCALDIR=$HOME/backups/
# Set the remote directory to backup
@jjrh
jjrh / remember_good_song
Created August 22, 2013 15:12
tool for mpd that formats the output of mpc in a way I can remember it. If I like a song in my playlist dump its name and file location into $file_path
#!/bin/sh
# tool for mpd that formats the output of mpc in a way I can remember it.
# If I like a song in my playlist dump its name and file location into $file_path
#
file_path="~/temp/good_songs"
echo "--------------------------------------------------------------------------------" >> $file_path # note this line is 80characters wide.
SONG_INFO=`mpc status -f "%artist% - %title% \n%file%" | head -1`
SONG_LOCATION=`mpc status -f "%artist% - %title% \n%file%" | head -2 | tail -n -1`
@emmaly
emmaly / gist:8267078
Created January 5, 2014 11:21
Bash script to automatically switch PulseAudio sink to Bluetooth headset on connect with A2DP profile and 50% volume.
#!/bin/bash
sink_name="bluez_sink.00_42_1B_AD_FA_CE"
if [ -z "$1" ]; then
dbus-monitor --system "path=/org/bluez/777/hci0/dev_00_42_1B_AD_FA_CE, interface=org.bluez.AudioSink, member=Connected" | while read line; do
echo $line
$0 1
done
else
@uriel1998
uriel1998 / simple_covers.sh
Created April 26, 2014 23:45
A simple cover art downloader/extractor.
#!/bin/bash
# requires mpc to get song info
# requires glyr https://github.com/sahib/glyr to retrieve metadata
# requires eyeD3 http://eyed3.nicfit.net/ to extract image from mp3
# uses xseticon, wmctrl, and transset to make its little terminal window all pretty. Feel free to delete these lines.
snark=$(echo $WINDOWID)
xseticon -id $snark ~/.icons/Faenza-Like/iKamasutra.png
@weshouman
weshouman / .bashrc
Last active November 1, 2023 13:27
After installation todos #important #bash #linux #git
# I usually add a similar block to the .bashrc
####################################
##### My Stuff: Walid Shouman ####
####################################
# disable freezing, follow https://unix.stackexchange.com/a/72092/310075
stty -ixon
#~~~~~~~~~~~~~~~~~~~~~~~#
@johnabela
johnabela / [PHP] bitly_MakeShortLink()
Last active September 8, 2015 09:55
Use the bit.ly api to generate short URL