Skip to content

Instantly share code, notes, and snippets.

@kung-foo
kung-foo / gist:1730627
Created February 3, 2012 15:13
ON DUPLICATE KEY UPDATE hack
from sqlalchemy.ext.compiler import compiles
from sqlalchemy.sql.expression import Insert
@compiles(Insert)
def append_string(insert, compiler, **kw):
s = compiler.visit_insert(insert, **kw)
if 'append_string' in insert.kwargs:
return s + " " + insert.kwargs['append_string']
return s
javascript:(function(e,a,g,h,f,c,b,d)%7Bif(!(f=e.jQuery)%7C%7Cg%3Ef.fn.jquery%7C%7Ch(f))%7Bc=a.createElement(%22script%22);c.type=%22text/javascript%22;c.src=%22http://ajax.googleapis.com/ajax/libs/jquery/%22+g+%22/jquery.min.js%22;c.onload=c.onreadystatechange=function()%7Bif(!b&&(!(d=this.readyState)%7C%7Cd==%22loaded%22%7C%7Cd==%22complete%22))%7Bh((f=e.jQuery).noConflict(1),b=1);f(c).remove()%7D%7D;a.documentElement.childNodes%5B0%5D.appendChild(c)%7D%7D)(window,document,%221.3.2%22,function($,L)%7B$('%23header,%20.pagehead,%20.breadcrumb,%20.commit,%20.meta,%20%23footer,%20%23footer-push,%20%23serverstats,%20.header').remove();%20$('%23files,%20.file').css(%7B%22background%22:%22none%22,%20%22border%22:%22none%22%7D);%20$('link').removeAttr('media');%7D);
root@asgard-1:/tmp# openssl s_client -connect onmodulus.net:443 -quiet
140550297405088:error:140790E5:SSL routines:SSL23_WRITE:ssl handshake failure:s23_lib.c:177:
root@asgard-1:/tmp# openssl s_client -connect modulus.io:443 -quiet
depth=2 C = US, O = "The Go Daddy Group, Inc.", OU = Go Daddy Class 2 Certification Authority
verify error:num=19:self signed certificate in certificate chain
verify return:0
^C
From To Downtime
2013-05-03 22:38:17 2013-05-03 22:39:18 0h 01m 01s
2013-05-03 22:40:17 2013-05-03 22:41:17 0h 01m 00s
2013-05-03 23:04:17 2013-05-03 23:05:18 0h 01m 01s
2013-05-03 23:11:17 2013-05-03 23:14:17 0h 03m 00s
2013-05-03 23:24:17 2013-05-03 23:26:17 0h 02m 00s
2013-05-03 23:28:17 2013-05-03 23:29:17 0h 01m 00s
2013-05-03 23:38:17 2013-05-03 23:39:17 0h 01m 00s
2013-05-03 23:47:17 2013-05-03 23:48:19 0h 01m 02s
2013-05-03 23:56:17 2013-05-03 23:57:17 0h 01m 00s
#! /bin/sh
### BEGIN INIT INFO
# Provides: ondemand
# Required-Start: $remote_fs $all
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop:
# Short-Description: Set the CPU Frequency Scaling governor to "ondemand"
### END INIT INFO
@kung-foo
kung-foo / Dockerfile
Last active August 29, 2015 14:06
Elasticsearch + marvel + wikipedia river
FROM dockerfile/ubuntu
ENV DEBIAN_FRONTEND noninteractive
RUN sed -i 's/http:\/\/archive\.ubuntu\.com\/ubuntu/mirror:\/\/mirrors\.ubuntu.com\/mirrors\.txt/g' /etc/apt/sources.list
# Install Java.
RUN \
echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && \
echo debconf shared/accepted-oracle-license-v1-1 seen true | debconf-set-selections && \
add-apt-repository -y ppa:webupd8team/java && \
--- supervisor-3.0a8.orig/setup.py
+++ supervisor-3.0a8/setup.py
@@ -12,7 +12,7 @@
#
##############################################################################
-__revision__ = '$Id: setup.py 910 2009-11-01 19:27:10Z Mike Naberezny <[email protected]> $'
+__revision__ = '$Id: setup.py 2118 2010-01-26 12:33:46Z iko $'
import urllib

Keybase proof

I hereby claim:

  • I am kung-foo on github.
  • I am kung_foo (https://keybase.io/kung_foo) on keybase.
  • I have a public key whose fingerprint is BE1C FB63 CB8C 2BA9 EE1C 3857 8F1F B151 D565 3923

To claim this, I am signing this object:

10.06.2015 13:32 <DIR> .
10.06.2015 13:32 <DIR> ..
10.06.2015 13:32 <DIR> 3 Doors Down
03.06.2015 10:00 <DIR> Aaron Copland
10.06.2015 13:32 <DIR> Adrian Johnston
03.06.2015 10:00 <DIR> Aerosmith
03.06.2015 10:00 <DIR> Alan Silvestri
03.06.2015 10:00 <DIR> Alanis Morissette
03.06.2015 10:00 <DIR> Alice in Chains
03.06.2015 10:00 <DIR> Antonin Dvorak, Victor Herbert; Yo-Yo Ma, New York Philharmonic, Kurt Masur
input {
tcp {
port => 9999
codec => json_lines {}
}
}
output {
stdout {
codec => rubydebug