Skip to content

Instantly share code, notes, and snippets.

Edward Samson esamson

Block or report user

Report or block esamson

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
esamson /
Created Nov 10, 2018
Install Calibre on Linux without sudo
sh install_dir=~/.local/opt isolated=True
esamson / retext
Created Aug 23, 2018
Reencode text file character set and line endings.
View retext
#!/usr/bin/env amm
import $ivy.`com.github.pathikrit::better-files:3.5.0`
import $ivy.`commons-io:commons-io:2.6`
import{BufferedReader, InputStreamReader, PrintWriter}
import java.nio.charset.{Charset, StandardCharsets}
import ammonite.ops._
import better.files._
View Solarized Dark (Darcula).icls
<scheme name="Solarized Dark (Darcula)" version="142" parent_scheme="Darcula">
<option name="EDITOR_FONT_SIZE" value="12" />
<option name="CONSOLE_FONT_NAME" value="Menlo" />
<option name="EDITOR_FONT_NAME" value="Monaco" />
<option name="ADDED_LINES_COLOR" value="baffba" />
<option name="ANNOTATIONS_COLOR" value="586e75" />
<option name="ANNOTATIONS_MERGED_COLOR" value="2aa198" />
<option name="CARET_COLOR" value="eee8d5" />
<option name="CARET_ROW_COLOR" value="73642" />
View google-chrome.desktop.patch
--- original/google-chrome.desktop
+++ fixed/google-chrome.desktop
@@ -112,6 +112,7 @@
[NewWindow Shortcut Group]
Name=New Window
esamson / PlantUML beta
Last active Aug 27, 2015
PlantUML v8029 fix for skinparam FrameBorderColor
View PlantUML beta

From PlantUML Q&A. This fixes the issue where defining different border colors with stereotypes has no effect:

skinparam frame {
    borderColor Yellow
    borderColor<<good>> Green
    borderColor<<bad>> Red
esamson /
Created Aug 26, 2015
Dump all PlantUML skinparams to standard output as a nested structure. Use as a starting point for defining a custom PlantUML skin.
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.TreeSet;
import net.sourceforge.plantuml.SkinParam;
esamson /
Created May 23, 2015
Clearing a Java String
import java.lang.reflect.Field;
public class Secret {
public static void main(String[] args) throws Exception {
Console console = System.console();
String secret = console.readLine("secret: ");
System.out.println("Capture secret in heap");
esamson / Dockerfile
Created Mar 6, 2015
Dockerfile for a Vagrant ready image. Kinda works but getting permission denied errors in the synced folder (e.g., `/vagrant`).
View Dockerfile
FROM centos:7
RUN yum install -y openssh-server openssh-clients sudo
RUN yum clean all
RUN sed -ri 's/#PermitRootLogin yes/PermitRootLogin yes/g' /etc/ssh/sshd_config
RUN sed -i "s/Defaults requiretty.*/#Defaults requiretty/g" /etc/sudoers
RUN ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ''
RUN ssh-keygen -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key -N ''
RUN useradd vagrant
# Credits to:
# -
# -
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 /
Created Feb 20, 2015
Set Gnome 3 app switcher to only consider the current workspace
gsettings set current-workspace-only true
You can’t perform that action at this time.