Skip to content

Instantly share code, notes, and snippets.

View rsrchboy's full-sized avatar

Chris Weyl rsrchboy

View GitHub Profile
@mannih
mannih / hl-var.vim
Last active August 29, 2015 14:01
Automatic variable highlighting in vim the easy way
" Vim plugin to highlight variables in Perl.
" I now created a repository from this: https://github.com/mannih/vim-perl-variable-highlighter
function! s:hlvar()
if ( exists( "w:current_match" ) )
call matchdelete( w:current_match )
unlet w:current_match
endif
let l:old_iskeyword = &iskeyword
:map <F9> :w<cr>:! PERL5LIB="" /usr/bin/prove -v -Ilib -I/home/cgranum/ndn/perl %<CR>
:imap <F9> <ESC>:w<cr>:! PERL5LIB="" /usr/bin/prove -v -Ilib -I/home/cgranum/ndn/perl %<CR>
:map <F10> :w<cr>:! PERL5LIB="" /opt/plack/perl/bin/prove -v -Ilib -I/home/cgranum/ndn/perl %<CR>
:imap <F10> <ESC>:w<cr>:! PERL5LIB="" /opt/plack/perl/bin/prove -v -Ilib -I/home/cgranum/ndn/perl %<CR>
function! RunFennecLine()
let cur_line = line(".")
exe "!FENNEC_TEST='" . cur_line . "' prove -v -Ilib -I. -I/home/cgranum/ndn/perl %"
endfunction
#cloud-config
apt_update: false
apt_upgrade: true
packages:
- pwgen
- pastebinit
- byobu
- build-essential
- bison
@lorn
lorn / starman.sh
Created December 7, 2011 23:23
Starman init.d script
#!/bin/bash
# starman - this script starts and stops the starman daemon
#
# chkconfig: - 85 15
# description: Starman
# processname: starman
# pidfile : /var/run/starman.pid
# www file: /var/www/myapp
@johnl
johnl / brightbox cloud example
Last active October 7, 2015 07:38
puppet-git-receiver cloud-config install script
$ brightbox-servers create --user-data="#include https://gist.githubusercontent.com/johnl/3129203/raw/d4b591546f1987803771bbc8c303c62cbca93538/puppet-git-receiver-install" img-9h5cv
Creating a nano (typ-4nssg) server with image Ubuntu Precise 12.04 LTS server (img-9h5cv) with 0.10k of user data
id status type zone created_on image_id cloud_ip_ids name
-----------------------------------------------------------------------------
srv-3te8u creating nano gb1-a 2012-07-17 img-9h5cv
-----------------------------------------------------------------------------
$ git init
sub add_vota : Chained('start')
POST PathPart('vota') Args(0)
{
my ($self, $ctx) = @_;
my $params = $self->parse_json_body($ctx->req->body);
my $result = (my $form = Vota::Web::NewVotumForm->new)
->run($params);
if($result->validated) {
@dansimpson
dansimpson / ifind
Last active December 19, 2015 12:19
Small command line utility for fetching GPS coordinates of you iPhone, iPad, or iPod.
#!/usr/bin/env ruby
require "optparse"
require "json"
require "findi"
def report device, mode=:text
name = device.name
@Ovid
Ovid / vawa.vim
Created May 16, 2014 15:30
Perl Vim Variable highlighting
" Drop this into .vim/plugin.vawa.vim
" if you already have vawa.vim, rename appropriately
" automatically highlights variables under cursor, allowing you to easily see the data flow.
" Vawa Plugin for VIM > 7.3 version 1.00
" Maintainer: Sandeep.c.r<sandeepcr2@gmail.com>
" Hacked for Perl by Curtis "Ovid" Poe <ovid@allaroundtheworld.fr>
function! s:vawa()
call clearmatches()
@ismell
ismell / README.md
Last active September 10, 2016 15:39
Docker Ubuntu upstart scripts

Production Ready Process Monitoring

  1. Install docker-manger.conf and docker-instance.conf in /etc/init

  2. Create a containers file in /etc/docker/ with the following format

     name: image cmd
    

    The name must be unique.

  3. sudo service docker-manager start

@marktheunissen
marktheunissen / stunnel-systemd-socket.patch
Last active March 7, 2017 23:50
Stunnel patch for systemd socket activation
diff a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -478,8 +478,18 @@ if test "$fips" = "auto"; then
])
fi
+# Check for systemd support for socket activation.
+AC_CHECK_LIB(systemd-daemon, sd_notify, SYSTEMD_LIBS="-lsystemd-daemon")
+AC_CHECK_HEADERS(systemd/sd-daemon.h)