Skip to content

Instantly share code, notes, and snippets.

@nirvdrum
nirvdrum / foo.sh
Created July 1, 2016 01:46 — forked from waylan/foo.sh
Simple bash subcommands. Each subcommand is implemented as a function. For example, `sub_funcname` is called for `funcname` subcommand.
#!/bin/sh
ProgName=$(basename $0)
sub_help(){
echo "Usage: $ProgName <subcommand> [options]\n"
echo "Subcommands:"
echo " bar Do bar"
echo " baz Run baz"
echo ""
@nirvdrum
nirvdrum / howto-tomato-l2tp-ipsec-server.markdown
Last active December 2, 2016 16:23 — forked from dferg/howto-tomato-l2tp-ipsec-server.markdown
HOWTO: Install L2TP/IPsec Server on TomatoUSB

Introduction

This howto describes setting up a LT2P over IPsec VPN server on your router with TomatoUSB firmware. This should allow you to connect using the built-in client to your Mac, iPhone or Android device. (Not sure about Windows.)

At the end of this tutorial, you should have a L2TP/IPsec VPN server that starts automatically on boot. Mac/iPhone/Android devices can connect with their native client and will be assigned an IP address within your LAN subnet. They should be able to talk to other devices on your LAN and should be able to contact hosts on the Internet NAT'd behind your WAN IP address.

Requirements

  • Router running Shibby's fork of TomatoUSB
  • entware installed to a USB stick mounted at /opt (howto)
@nirvdrum
nirvdrum / rubber.yml
Last active August 29, 2015 13:56 — forked from DaKaZ/rubber.yml
# REQUIRED: The name of your application
app_name: foo
# REQUIRED: The system user to run your app servers as
app_user: foo
# REQUIRED: Notification emails (e.g. monit) get sent to this address
#
admin_email: "webmaster@foo.com"
@nirvdrum
nirvdrum / performance_and_backport_gc.patch
Created January 27, 2012 22:16 — forked from funny-falcon/performance_and_backport_gc.patch
Union of backport GC and performance patches for ruby-1.9.3-p0
diff --git a/ChangeLog b/ChangeLog
index c4ea779..0a6bf73 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,188 @@
+Tue Jan 17 12:32:46 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * gc.c (aligned_malloc, aligned_free): covered missing defined
+ operators and fixes for cygwin.
+
Proposal title: AWS Deployment with Rubber
==============
Description (400 characters - 65 words):
=======================================
Cloud computing has made computing at scale available to everyone. Cloud computing is not without its pitfalls, however. Overcoming these relies on following the deployment best practices discovered through years of trial and error. The Rubber framework aims to codify some of these best practices and help you build and manage your real world cloud deployment in a practical manner.
Proposal title: AWS Deployment with Rubber
==============
Description (400 characters - 65 words):
=======================================
Amazon Web Services (AWS) is one of the easiest ways to get going with cloud computing. Rubber is a Capistrano plugin that simplifies provisioning and deploying Ruby Web apps to EC2, EBS, and S3. In this
talk you'll learn how to build out both common and complex application stacks rapidly on AWS.
#!/usr/bin/env ruby
# put in /etc/munin/plugins and restart munin-node
# by Dan Manges, http://www.dcmanges.com/blog/rails-application-visualization-with-munin
# NOTE: you might need to add munin to allow passwordless sudo for passenger-memory-stats
def output_config
puts <<-END
graph_category App
graph_title Passenger memory stats
graph_vlabel count
#!/usr/bin/env ruby
def output_config
puts <<-END
graph_category App
graph_title passenger status
graph_vlabel count
sessions.label sessions
max.label max processes
# Comment if you dont want rubygems
require 'rubygems'
require 'gitauth'
require 'fileutils'
if ARGV.empty?
puts "Usage: ruby #{$0} path-to-base-dir"
exit!
end
@nirvdrum
nirvdrum / 0what.md
Created August 24, 2009 12:49 — forked from defunkt/0what.md

Poor Man's Deploy

  • Start a Sinatra server on port 4000
  • GET / to that server triggers a git pull and mod_rails restart
  • Hit port 4000 locally after pushing

Why?