Skip to content

Instantly share code, notes, and snippets.

View cwarden's full-sized avatar

Christian G. Warden cwarden

View GitHub Profile
@cwarden
cwarden / gist:1100148
Created July 22, 2011 19:03
use imagemagick and qiv to preview and delete pdfs
(IFS=$(echo -e "\n\r"); for i in $(ls -1 *.pdf); do gif=${i%%.pdf}.gif; if [ ! -f $gif ] ; then convert -scale 600x600 $i[0] $gif; fi; done; qiv *.gif; for i in .qiv-trash/*.gif; do x=$(basename $i); wipe -fc ${x%%.gif}.pdf; done)
https://addons.mozilla.org/blocklist/3/%APP_ID%/%APP_VERSION%/%PRODUCT%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/
{
["GROUP BY"] = {
[1] = "field1";
};
["SELECT"] = {
[1] = "column1";
[2] = "column2";
};
["FROM"] = {
[1] = "table1";
--- disqus.orig 2011-01-26 16:45:26.000000000 -0800
+++ /etc/blosxom/plugins/disqus 2011-01-26 12:09:06.000000000 -0800
@@ -9,7 +9,7 @@
#
# What is your username on Disqus (the one that should appear
# on the javascript section of the HTML pages)?
-$disqus_username = 'nunonunes' unless defined $disqus_username;
+$disqus_username = 'pinkhamster' unless defined $disqus_username;
#
# Message to display if feedback (comments and trackbacks) is not allowed
@cwarden
cwarden / statsd.lua
Created September 1, 2011 22:05 — forked from jbarciauskas/StatsD.php
Lua client for StatsD
-- StatsD.php ported to lua
local math = require "math"
local os = require "os"
local socket = require "socket"
local type, pairs, ipairs, next = type, pairs, ipairs, next
local pcall = pcall
math.randomseed(os.time())
@cwarden
cwarden / INSTALL
Created September 2, 2011 01:01 — forked from mat/INSTALL
Turn an Ubuntu 10.04 server into a StatsD/Graphite server
TODO:
- edit /opt/statsd/local.js
- correct the graphite host to localhost
- if desired, put 'debug: true' in there
- make the box accessible via the hostname 'graphite'
- patch graphite, like described in https://answers.launchpad.net/graphite/+question/152851
require "try-catch"
try {
function()
error('oops')
end,
catch {
function(error)
print('caught error: ' .. error)
@cwarden
cwarden / EXAMPLE
Created September 18, 2011 19:24
MySQL-Proxy Mock Server/JDBC Bug
$ javac MysqlProxyTest.java
$ mysql-proxy --plugins=proxy --proxy-lua-script="$(pwd)/mock-server.lua" --proxy-address 127.0.0.1:4040 --daemon
$ java -cp .:./mysql-connector-java-5.1.17-bin.jar MysqlProxyTest
Cannot connect to database server:
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet successfully received from the server was 41 milliseconds ago. The last packet sent successfully to the server was 11 milliseconds ago.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
@cwarden
cwarden / gist:1265128
Created October 5, 2011 17:45
git filter-branch example
git clone saiku saiku-copy
cd saiku-copy/
git-large-blob 300k
git filter-branch --tree-filter 'rm -f saiku-core/saiku-web/src/test/resources/org/saiku/web/rest/resources/sampledata.sql saiku-core/saiku-web/src/test/resources/org/saiku/web/rest/resources/foodmart/foodmart.script saiku-server/custom/foodmart/foodmart.zip saiku-webapp/src/test/resources/org/saiku/web/rest/servlet/sampledata.sql saiku-core/saiku-web/src/test/resources/org/saiku/web/rest/servlet/sampledata.sql saiku-core/saiku-web/src/test/resources/org/saiku/web/rest/servlet/foodmart/foodmart.script saiku-core/saiku-web/src/test/resources/org/saiku/web/rest/service/sampledata.sql' --tag-name-filter cat -- --all
rm -rf .git/refs/original/
git reflog expire --expire=now --all
git gc --prune=now --aggressive