Skip to content

Instantly share code, notes, and snippets.

@paulschwarz
paulschwarz / gist:2776456
Created May 23, 2012 17:15 — forked from ciastek/gist:2776416
Global Vagrantfile to override number of CPUs used by VM
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
config.vm.customize ["modifyvm", :id, "--cpus", 1]
end
@marktheunissen
marktheunissen / pedantically_commented_playbook.yml
Last active September 24, 2024 14:52 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
This playbook has been removed as it is now very outdated.
@ncremins
ncremins / gist:3812686
Created October 1, 2012 16:00
[MySQL] comma separated column names
SELECT GROUP_CONCAT(column_name ORDER BY ordinal_position)
FROM information_schema.columns
WHERE table_schema = 'DATABASE_HERE' AND table_name = 'TABLE_HERE'
@theangryangel
theangryangel / AuthController.js
Created February 28, 2013 21:54
sails (v0.8.82) + passport + passport-local Rough Example. For the love of all that is holy, don't use this in production.
// api/controllers/AuthController.js
var passport = require('passport');
var AuthController = {
login: function (req,res)
{
res.view();
},
@willurd
willurd / web-servers.md
Last active November 13, 2024 13:44
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@crifkin
crifkin / gist:5986419
Created July 12, 2013 17:57
Crifkin 2013 DCLA Vagrant help
NOTE: version numbers are at the time of this writing
1. Download and install Virtualbox (4.2.16)
2. Download and install Vagrant (1.2.3)
3. Check ruby and rubygems versions
4. Install berkshelf gem
gem install berkshelf --version '>= 1.4.0'
5. Install berkshelf vagrant plugin
vagrant plugin install vagrant-berkshelf --plugin-version '1.2.0'
6. Add vagrant basebox provided in Crifkin Training package (precise64_chef11.box)
@jhedstrom
jhedstrom / gist:6125918
Created July 31, 2013 20:36
Running Firefox headless for selenium/Behat tests
if [ ! -f /tmp/.X5-lock ]; then /usr/bin/Xvfb :5 -ac -screen 0 1024x768x8 & fi
export DISPLAY=:5.0 # firefox needs this to know where to find a display to run on
java -jar /opt/selenium/selenium-server-standalone-2.26.0.jar > /dev/null 2>&1 &
@kendellfab
kendellfab / golang-request
Created August 26, 2013 14:27
Golang Example for adding custom headers to a request.
client := &http.Client{]
req, err := http.NewRequest("POST", "http://example.com", bytes.NewReader(postData))
req.Header.Add("User-Agent", "myClient")
resp, err := client.Do(req)
defer resp.Body.Close()
@z3cka
z3cka / gist:6601887
Last active December 23, 2015 07:39
sample ansible playbook evocation to a vagrant vm
ansible-playbook ~/Development/playbooks/apt-drupal8.yml -u vagrant -s -k
@zoni
zoni / iptables
Created November 26, 2013 09:20
Ansible module to manage iptables rules
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Ansible module to manage iptables rules
Written by Nick Groenen <[email protected]>. If you get your hands on a
copy of this code, please feel free to do with it whatever you like.
"""