Skip to content

Instantly share code, notes, and snippets.

View mbohun's full-sized avatar
🙃
How do you do?

Martin Bohun Hormann mbohun

🙃
How do you do?
  • Canberra, ACT, Australia
View GitHub Profile
@mbohun
mbohun / gist:5499889
Last active December 16, 2015 21:29
an example of double-buffering using java.awt.image.BufferStrategy
import java.applet.Applet;
import java.awt.Canvas;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.image.BufferStrategy;
public class TestAppletCanvasBufferStrategy extends Applet {
public void init() {
this.canvas.setSize(WIDTH, HEIGHT);
--- linux-3.10.3-00/.config 2013-07-26 14:15:09.615113657 +1000
+++ linux-3.10.3-01/.config 2013-07-27 14:35:18.921281455 +1000
@@ -47,7 +47,7 @@
#
CONFIG_INIT_ENV_ARG_LIMIT=32
CONFIG_CROSS_COMPILE=""
-CONFIG_LOCALVERSION="-00"
+CONFIG_LOCALVERSION="-01"
# CONFIG_LOCALVERSION_AUTO is not set
CONFIG_HAVE_KERNEL_GZIP=y
@mbohun
mbohun / gist:6459374
Last active December 22, 2015 10:29
diff -Naur .config.old .config > config-3.10.10_3.11.0.diff
--- .config.old 2013-09-06 13:44:55.287071534 +1000
+++ .config 2013-09-06 13:49:43.730445310 +1000
@@ -1,6 +1,6 @@
#
# Automatically generated file; DO NOT EDIT.
-# Linux/x86 3.10.10 Kernel Configuration
+# Linux/x86 3.11.0 Kernel Configuration
#
CONFIG_64BIT=y
CONFIG_X86_64=y
# flac to mp3
for file in *.flac; do flac -cd "$file" | lame -h -b 320 - "${file%.flac}.mp3"; done
# lftp example
lftp -u username,password -e "put -O src Screenshot_2013-02-21-01-31-05.png" ftp.host.here
public class BitCollissionDetector {
private final int[] cdi_map;
public BitCollissionDetector(final int[] cm ) {
this.cdi_map = cm;
}
public boolean test(final int x, final int y ) {
final int column_bit_mask = 1<<(x>>5); //get proper constant, configurable?
@mbohun
mbohun / gist:7123204
Created October 23, 2013 17:40
diff -Naur .config.old .config > config-3.11.6-01_3.12-rc6.diff
--- .config.old 2013-10-24 04:20:56.409472894 +1100
+++ .config 2013-10-24 04:28:03.097108704 +1100
@@ -1,6 +1,6 @@
#
# Automatically generated file; DO NOT EDIT.
-# Linux/x86 3.11.6 Kernel Configuration
+# Linux/x86 3.12.0-rc6 Kernel Configuration
#
CONFIG_64BIT=y
CONFIG_X86_64=y
@mbohun
mbohun / gist:697659b3197b442c24cd
Last active November 15, 2015 17:56
SMILES notes and diary
C1OCCNC1Cc2cc3c(OCO3)cc2
c1(OC)c(OC)c(OC)cc2c1C[C@H]2CN
c1(OC)c(OC)c(OC)cc2c1C[C@H]2CN.COC1=C(C(=C2CC[C@H](C2=C1)CN)OC)OC
O=C(O)CC(c1ccccc1)CN
O=C(C)C(c1ccccc1)CN.O=C(N)C(c1ccccc1)CC
c1ccccc1CCN.c1ccccc1CC(=O)N.c1c(OC)c(OC)c(OC)cc1CC(=O)N.c1ccccc1CCNC(=O)C
c1c(OC)c(OC)c(OC)cc1CCN2CCCC2.c1c(OC)c(OC)c(OC)cc1CCN2CCCC2=O.c1c(OC)c(OC)c(OC)cc1CC2NCCC2.c1c(OC)c(OC)c(OC)cc1CC2NC(=O)CC2
c1c(OC)c(OC)c(OC)cc1CCN2CCCC2.c1c(OC)c(OC)c(OC)cc1CCN2CCCC2=O.c1c(OC)c(OC)c(OC)cc1CC2NCCC2.c1c(OC)c(OC)c(OC)cc1CC2NC(=O)CC2.c1c(OC)c(OC)c(OC)cc1C2CN(CC(=O)N)C(=O)C2
c1ccccc1C2CN(CC(=O)N)C(=O)C2.c1ccccc1C2CCN(CC(=O)N)C(=O)2
O=C1CCCCC1(NC)c1ccccc1Cl
@mbohun
mbohun / ubuntu32-vagrant-ansible-mods-for-4gbRAM.diff
Created June 4, 2014 04:33
vagrant and ansible adjustments i had to make in order to run it on a box with only 4gb of RAM
diff --git a/ansible/roles/biocache-db/tasks/main.yml b/ansible/roles/biocache-db/tasks/main.yml
index 93314e1..d8d2cb2 100644
--- a/ansible/roles/biocache-db/tasks/main.yml
+++ b/ansible/roles/biocache-db/tasks/main.yml
@@ -4,9 +4,6 @@
# - include: ../../common/tasks/cassandra.yml
# - include: ../../common/tasks/nameindex.yml
-- name: disable swap
- shell: "sudo swapoff --all"
@mbohun
mbohun / gist:8289b4a5ae73b5b1b155
Created June 13, 2014 07:02
ansible meets brew :-)
bash-3.2$ uname -a
Darwin twain-be-2.local 13.2.0 Darwin Kernel Version 13.2.0: Thu Apr 17 23:03:13 PDT 2014; root:xnu-2422.100.13~1/RELEASE_X86_64 x86_64
bash-3.2$ ansible all -m ping -i inventories/vagrant -u vagrant --ask-pass -vvvv
SSH password:
<10.1.1.2> ESTABLISH CONNECTION FOR USER: vagrant
<10.1.1.2> REMOTE_MODULE ping
10.1.1.2 | FAILED => to use the 'ssh' connection type with passwords, you must install the sshpass program
bash-3.2$
bash-3.2$ sudo brew install sshpass
Error: No available formula for sshpass
From c4a2d5ac5c75eda619c5df52879a251787a90f66 Mon Sep 17 00:00:00 2001
From: mbohun <[email protected]>
Date: Fri, 20 Jun 2014 16:30:08 +1000
Subject: [PATCH] initial version of ansible support for dashboard
---
.gitignore | 1 +
ansible/dashboard-standalone.yml | 7 +++++++
ansible/roles/dashboard/tasks/main.yml | 17 +++++++++++++++++
.../dashboard/templates/dashboard-config.properties | 12 ++++++++++++