This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<#if licenseFirst??> | |
${licenseFirst} | |
</#if> | |
${licensePrefix}Copyright ${date?date?string("yyyy")} Edward Samson | |
<#if licenseLast??> | |
${licenseLast} | |
</#if> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<configuration> | |
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> | |
<encoder> | |
<pattern>%r [%thread] %-5level %logger - %msg%n</pattern> | |
</encoder> | |
</appender> | |
<root> | |
<level value="error" /> | |
<appender-ref ref="STDOUT" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT concat(table_schema,'.',table_name), | |
concat(round(table_rows/1000000,2),'M') rows, | |
concat(round(data_length/(1024*1024*1024),2),'G') DATA, | |
concat(round(index_length/(1024*1024*1024),2),'G') idx, | |
concat(round((data_length+index_length)/(1024*1024*1024),2),'G') total_size, | |
round(index_length/data_length,2) idxfrac | |
FROM information_schema.TABLES | |
ORDER BY data_length+index_length DESC LIMIT 20; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# | |
# Tools for the Extra Bored | |
# brought to you by Edward Samson | |
# | |
# time-to-uwian | |
# | |
# If you turn on your computer as soon as you get to work, this script will | |
# show how much longer you have to wait before you can leave. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
import java.math.*; | |
public class MapVsMap { | |
static final int MAP_SIZE = 100000; | |
static final int STR_LEN = 10; | |
static final int ROUNDS = 10; | |
static final char[] chars = { | |
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.lang.reflect.Field; | |
import java.io.Console; | |
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"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gsettings set org.gnome.shell.app-switcher current-workspace-only true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |