Skip to content

Instantly share code, notes, and snippets.

@commonquail
commonquail / dapt.sh
Created January 5, 2014 14:01
Setup Debian D development evironment. Installs Sayol's D APT repository (http://d-apt.sourceforge.net/) and prompts to install compilers and DUB.
#!/bin/bash
# Setup a D development environment on a Debian system.
# Installs the D APT repository and prompts to install compilers DMD, LDC, and
# GDC, and package manager DUB.
# Licence: MIT/Expat.
daptsrc=http://netcologne.dl.sourceforge.net/project/d-apt/files/d-apt.list
daptlist=/etc/apt/sources.list.d/d-apt.list
wget ${daptsrc} -O ${daptlist}
@commonquail
commonquail / .blockify_list
Last active August 29, 2015 14:08
Blockify company name list for https://github.com/mikar/blockify
AAU
Artpeople
betsafe.com
Bose
Digster
disco:wax
Dr. Oetker
Filtr
Finetunes
FRESH LIGE NU
@commonquail
commonquail / unattended-upgrades.md
Last active August 29, 2015 14:16
Unattended upgrades for Linux Mint 17.1

Based on [this guide by Andew Bolster, 2015-02-06][guide]; reposted for posterity and to address a minor awk field separator oddity.

Install unattended-upgrades:

$ sudo apt-get install unattended-upgrades -y

unattended-upgrades writes to the log file

@commonquail
commonquail / gear.md
Last active August 29, 2015 14:18
Cinnamon's smaller menu gear icon.

For unknown reasons I keep having to reset this. Now, additionally, the only relevant Google result leads to a GitHub issue that unfortunately points to a file on the master branch that has since been moved. Here are the direct links to the files.

Note that this icon has been changed in a later version. The newer version seems to be slightly larger. I dislike it, so this is the original gear.

@commonquail
commonquail / java-files-with-no-declared-constructors.sh
Created April 13, 2015 11:58
Find Java files with no declared constructors
# These two commands both search the working directory
# for java class files that do not declare a constructor.
#
# The first command is marginally faster than the second;
# for truly large code bases, this may matter,
# but mostly it won't.
#
# The commands disregard package-info.java and tests.
# #1: Finds all files in the first pass,
@commonquail
commonquail / git-restore-branches.sh
Created April 29, 2015 08:13
Restores the branchnames of all merged branches between two revisions
#!/bin/bash
#
# Restores the branchnames of all merged branches
# between two revisions,
# and prints them to stdout.
#
# If the end revision is omitted it defaults to HEAD.
#
# If a branchname already exists,
# it is not moved,
@commonquail
commonquail / README.md
Last active August 29, 2015 14:24
Notes for filtering IPVanish servers

Server list at https://www.ipvanish.com/api/servers.geojson

No CORS. Copy the JavaScript functions below into the console and confirm. Copy all the (JSON) output in the browser window into the console, into a variable named e.g. everything. Copy the final line, then play arround with the all array.

@commonquail
commonquail / commit-msg-stats.sh
Created August 4, 2015 12:01
Very simple commit message stats
#!/bin/bash
set -o errexit
set -o nounset
[[ $# -eq 1 ]] || {
echo "usage: $0 <author>"
exit 1
}
@commonquail
commonquail / spot.sh
Created August 4, 2015 12:02
Start Spotify and Blockify from the command line if either is not running
#!/bin/bash
set -o errexit
if ! ps -e | grep -q spotify
then
spotify > /dev/null 2>&1 &
fi
if ! ps -e | grep -q blockify-ui
@commonquail
commonquail / lso.sh
Created August 4, 2015 12:06
List human readable and octal file permissions for the specified file or files in the current directory
#!/bin/sh
# Lists human readable and octal file permissions for the specified files.
# If no files are specified, lso is invoked for all files in the current
# directory.
arg="$@"
[ "$arg" = '' ] && arg="*"
stat -c '%A %a %n' $arg