Skip to content

Instantly share code, notes, and snippets.

View carlzulauf's full-sized avatar

Carl Zulauf carlzulauf

  • Unabridged Software
  • Denver, CO
View GitHub Profile

Today I learned to use siege.config to generate a .siegerc and to use siege to benchmark the throughput of a website.

sudo apt-get install siege
siege -b -t60S http://my/remote/app

Using this tool

--------10--------20--------30--------40--------50--------60--------70--------80--------90-------100-------110-------120-------130-------140-------150-------160

This page lets you create HTML by entering text in a simple format that's easy to read and write.

  • Type Markdown text in the left window
  • See the HTML in the right

Steps to Reinstalling Ubuntu and Restoring /home mdadm RAID

  • On existing install, backup any files not on your RAID.
    • Look for sym links in your home that point back to your SSD that you added for "speed"
    • Check out /var and /opt for anything you might want.
    • Probably just move the files onto the RAID.
  • Install Ubuntu on SSD (Any version. Normal install. Use whole drive. Replace existing. Easy peasy)
  • Install mdadm package. Chose No Configuration when prompted about postfix.
#!/usr/bin/env ruby
# quick and dirty thin init script
#
# path for thin
thin = "/home/someuser/.rvm/gems/ruby-1.8.7-p72@global/bin/thin"
config = "config/config.ru"
# which dir to run from
path = "/srv/thisapp"
@carlzulauf
carlzulauf / thin.rb
Last active December 17, 2015 01:19
Thin initd script. Spawns thin daemons from a config directory using a specific non-privileged user (`carl`).
#!/usr/bin/env ruby
# thin init script
# install to /etc/init.d/thin
# crazy debian LSB header stuff
### BEGIN INIT INFO
# Provides: thin
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
@carlzulauf
carlzulauf / curb-mock.rb
Created May 7, 2013 00:11
curb mock example
class Curl::Mock
def initialize(*args)
@replay = Curb.replay?
@i = Curb.add_instance
if replay?
puts "Mocking #{args.first}"
@data = Curb.get_instance(@i)
else
@curb = OldCurlEasy.new(*args)
log(:initialize, args)
@carlzulauf
carlzulauf / Preferences.sublime-settings
Last active December 20, 2015 17:28
Preferences.sublime-settings
{
"auto_complete": true,
"color_scheme": "Packages/Color Scheme - Default/Twilight.tmTheme",
"ensure_newline_at_eof_on_save": true,
"ignored_packages":
[
"Vintage"
],
"rulers":
[
@carlzulauf
carlzulauf / idea.md
Created August 8, 2013 01:17
Idea: Extensions Developer Console

Extensions Developer Console

Simple proposed extension for Google Chrome, and possibly other browsers.

Goal

Provide a console imbued with access to internal browser APIs.

require 'securerandom'
require 'benchmark'
require 'redis'
ruby_hash = Hash.new
puts "Creating the ruby hash"
puts(Benchmark.measure do
1_000_000.times do
ruby_hash[SecureRandom.base64(32)] = SecureRandom.base64(64)
class PhotoFrame
constructor: ->
@foo = "bar"