Skip to content

Instantly share code, notes, and snippets.

View shadowbq's full-sized avatar
👔
Doing Things

shadowbq shadowbq

👔
Doing Things
View GitHub Profile
@igalic
igalic / Makefile
Created February 13, 2013 08:35
Makefile to create a root-ca, an intermediate signing CA. It can also be used to quickly create keys and Certificates and sign them with that intermediate CA. You should put the root-ca into your Trust Store (preferably as the only CA;) and make sure your programs validate it correctly.
root_DN = /CN=Esotericsystems Root Authority/C=AT/
issuing_DN = /CN=Esotericsystems Issuing Authority/C=AT/
passphrase:
echo -n changeme > $@
#
# Create param files, keys and Self-Signed Certificate for the Root CA
#
root-ca-dsa.param: passphrase
@seratch
seratch / config.yml
Created October 25, 2012 09:37
AWS SQS Example
access_key_id: xxx
secret_access_key: yyy
@andsens
andsens / bootstrap_homeshick.sh
Last active December 27, 2023 12:47
Script that can set up an entire user account with homeshick automatically
#!/bin/bash -ex
# Paste this into ssh
# curl -sL https://gist.github.com/andsens/2913223/raw/bootstrap_homeshick.sh | tar -xzO | /bin/bash -ex
# When forking, you can get the URL from the raw (<>) button.
### Set some command variables depending on whether we are root or not ###
# This assumes you use a debian derivate, replace with yum, pacman etc.
aptget='sudo apt-get'
chsh='sudo chsh'
@cehoffman
cehoffman / .gitignore
Created April 27, 2012 18:50
Program to remove an IP Address from SSHGuard's blacklist
build/
@btoone
btoone / curl.md
Last active April 2, 2024 20:18
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API.

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
@danielevans
danielevans / gist:1011309
Created June 6, 2011 23:01
A create admin rake task using the highline gem
namespace :admin do
desc "creates and admin user"
task :create => :environment do
line = HighLine.new # a command line lib that uses erb? Bizarre.
line.say "<%= color('Creating a new administrative user', BOLD) %>"
email = line.ask("Email: ")
pass = line.ask("Password: " ) { |q| q.echo = "*" }
admin = Admin.new(:email => email, :password => pass)
@morhekil
morhekil / LICENSE
Last active January 22, 2017 22:12
Implementation of deep symbolization of keys for Ruby hashes
The MIT License (MIT)
Copyright (c) 2015 Oleg Ivanov http://github.com/morhekil
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@denmarkin
denmarkin / mysql.god.rb
Created May 10, 2011 07:45
God recipes examples for Rackspace Cloud (Ubuntu) with resque and php-cgi. Try any of them with "sudo god -c /path/to/config -D"
God.watch do |w|
w.name = "mysqld"
w.interval = 30.seconds # default
w.start = "service mysql start"
w.stop = "service mysql stop"
w.restart = "service mysql restart"
w.start_grace = 20.seconds
w.restart_grace = 20.seconds
w.pid_file = "/var/lib/mysql/hostname.pid"
@groesser3
groesser3 / lifo_fifo.rb
Created November 5, 2010 07:05
simple LIFO, FIFO functions in ruby
require "test/unit"
class Array
def fifo
verbrauch = inject(0) {|sum, el| sum+=el.abs if el < 0; sum }
res = select{|el| el > 0}.inject([]) do |result, el|
if el > verbrauch
result << (el - verbrauch)
verbrauch = 0
else
@vast
vast / Rakefile
Created April 28, 2010 08:44
Interactive console for sinatra + activerecord
require 'my-sinatra-app'
require 'sinatra/activerecord/rake'
desc "run irb console"
task :console, :environment do |t, args|
ENV['RACK_ENV'] = args[:environment] || 'development'
exec "irb -r irb/completion -r my-sinatra-app"
end