Skip to content

Instantly share code, notes, and snippets.

@esamson
esamson / purge.sh
Last active August 29, 2015 14:16 — forked from adrienbrault/purge.sh
#!/bin/sh
# Credits to:
# - http://vstone.eu/reducing-vagrant-box-size/
# - https://github.com/mitchellh/vagrant/issues/343
aptitude -y purge ri
aptitude -y purge installation-report landscape-common wireless-tools wpasupplicant ubuntu-serverguide
aptitude -y purge python-dbus libnl1 python-smartpm python-twisted-core libiw30
aptitude -y purge python-twisted-bin libdbus-glib-1-2 python-pexpect python-pycurl python-serial python-gobject python-pam python-openssl libffi5
@esamson
esamson / current-workspace-only.sh
Created February 20, 2015 03:08
Set Gnome 3 app switcher to only consider the current workspace
gsettings set org.gnome.shell.app-switcher current-workspace-only true
@esamson
esamson / opendj
Created February 19, 2015 09:33
OpenDJ subcommands -- instead of adding everything to your PATH
#!/bin/bash
OPENDJ_HOME=~/.local/opt/opendj
if [ -z "$1" ] ; then
echo "Usage: $0 <command>"
echo
echo "Where <command> is one of:"
echo
ls -1 $OPENDJ_HOME/bin
@esamson
esamson / tmux-window-titles-fix.sh
Created February 19, 2015 09:25
Workaround for tmux window titles in Fedora 21. See: https://bugzilla.redhat.com/show_bug.cgi?id=969429#c27
#!/bin/bash
sudo ln -s /usr/bin/true /etc/sysconfig/bash-prompt-screen
@esamson
esamson / swapescape.sh
Created December 16, 2014 01:14
Swap Escape and CAPS LOCK keys
dconf write /org/gnome/desktop/input-sources/xkb-options "['caps:swapescape']"
@esamson
esamson / .gitignore
Last active April 28, 2019 14:56
systemd service file for sonatype nexus. Put this in `$HOME/.config/systemd/user/nexus.service`. Launch with `systemctl --user start nexus`.
default.target.wants/
nexus
@esamson
esamson / InYourProcessor.java
Last active May 2, 2022 12:12
Maven and javax.annotation.processing.Messager NOTE messages.
import javax.annotation.processing.SupportedOptions;
@SupportedOptions("debug") // declare the `debug` option
public final class InYourProcessor extends AbstractProcessor {
/**
* This is now your logging routine.
*/
private void log(String msg) {
if (processingEnv.getOptions().containsKey("debug")) {
@esamson
esamson / makeapp.sh
Last active August 29, 2015 13:57 — forked from demonbane/makeapp.sh
#!/bin/sh
echo "What should the Application be called (no spaces allowed e.g. GCal)?"
read inputline
name="$inputline"
echo "What is the url (e.g. https://www.google.com/calendar/render)?"
read inputline
url="$inputline"
@esamson
esamson / Stinger-2.2-2.2.2.diff
Created November 12, 2013 01:35
Source file changes between Stinger-2.2 and Stinger-2.2.2
diff -ur Stinger-2.2/src/org/owasp/stinger/Stinger.java Stinger-2.2.2/src/org/owasp/stinger/Stinger.java
--- Stinger-2.2/src/org/owasp/stinger/Stinger.java 2006-11-21 21:11:16.000000000 +0800
+++ Stinger-2.2.2/src/org/owasp/stinger/Stinger.java 2007-12-20 11:04:30.000000000 +0800
@@ -44,12 +44,15 @@
private static RuleSet set = null;
+ private static boolean debug = false;
+
private Stinger() {
@esamson
esamson / default-license.ftl
Created February 27, 2013 02:25
My NetBeans default license template. Copyright year is automatically determined from the current date.
<#if licenseFirst??>
${licenseFirst}
</#if>
${licensePrefix}Copyright ${date?date?string("yyyy")} Edward Samson
<#if licenseLast??>
${licenseLast}
</#if>