Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0"?>
<root>
<appdef>
<appname>MACVIM</appname>
<equal>org.vim.MacVim</equal>
</appdef>
<list>
<item>
<name>LeaveInsMode with EISUU(Terminal)</name>
<identifier>private.app_terminal_esc_with_eisuu</identifier>
@poppen
poppen / run_knife-solo.sh
Created May 1, 2013 08:40
Expect script for running knife solo
#!/bin/sh
host=""
password=""
expect -c "
spawn ./bin/knife solo cook -V root@${host}
expect Enter; send $password; send \r
set done 0
@poppen
poppen / vcf2tsv.pl
Created March 19, 2013 04:35
vcf2tsv.pl
#!/usr/bin/env perl
use strict;
use warnings;
use feature qw( say );
use Text::vCard::Addressbook;
my $address_book = Text::vCard::Addressbook->new(
{ 'source_file' => $ARGV[0], }
@poppen
poppen / gist:5185141
Last active December 15, 2015 02:09
iperf_on_server.sh
#!/bin/sh
rpm -ivh http://ftp.riken.jp/Linux/fedora/epel/6/i386/epel-release-6-8.noarch.rpm
yum -y install iperf
iperf -s
@poppen
poppen / gist:5176336
Created March 16, 2013 13:20
install ruby_build with chef
knife solo cook [email protected] -o rbenv::ruby_build -j '{"ruby_build":{"prefix":"/opt/rbenv"}}'
@poppen
poppen / gist:5168039
Last active December 14, 2015 23:49
knife-solo one-liner with JSON attributes
knife solo cook vagrant@harmony -o postgresql::server --json-attributes '{"postgresql":{"password":{"postgres":"hogehoge"}}}'
@poppen
poppen / quickrun.vim
Last active December 14, 2015 16:19
quickrun.vim for PostgreSQL(copied from http://potix2.blogspot.jp/2011/12/quickrunsqlmysql.html)
" PostgreSQL
let g:quickrun_config['sql'] = {
\ 'command': 'psql',
\ 'exec': ['%c %o < %s'],
\ 'cmdopt': '%{MakepgsqlCommandOptions()}',
\ }
let g:pgsql_config_host = ''
let g:pgsql_config_port = ''
let g:pgsql_config_user = ''
@poppen
poppen / private.xml
Created February 16, 2013 04:03
Setting 'push C-[ in Terminal, IME Off' for keyremap4macbook
<?xml version="1.0"?>
<root>
<list>
<item>
<name>LeaveInsMode with EISUU(Terminal)</name>
<identifier>private.app_terminal_esc_with_eisuu</identifier>
<only>TERMINAL</only>
<autogen>--KeyToKey-- KeyCode::BRACKET_LEFT, VK_CONTROL, KeyCode::JIS_EISUU, KeyCode::ESCAPE</autogen>
</item>
</list>
#!/usr/bin/env perl
use strict;
use warnings;
use 5.010;
use YAML;
use Algorithm::Bucketizer;
my $size = 20;
Dim goal
Dim before
Dim x
Dim y
Dim i
goal = 1000000
Do While True
before = Timer