Skip to content

Instantly share code, notes, and snippets.

Add the following chunk to your existing ISC dhcpd.conf file.

if exists user-class and ( option user-class = "iPXE" ) {
    filename "http://boot.smidsrod.lan/boot.ipxe";
}
else {
    filename "undionly.kpxe";
}

(or see https://gist.github.com/4008017 for a more elaborate setup

---
driver_plugin: vagrant
provisioner: chef_zero
driver_config:
require_chef_omnibus: 11.6.0
http_proxy: http://10.0.3.1:8123
https_proxy: https://10.0.3.1:8123
provider: lxc
platforms:
@swettk
swettk / gist:a6ec628f9ee35c3b3810
Last active August 29, 2015 14:19
ChefDK Scripted install (beta)
curl -L https://chef.io/chef/install.sh | sudo bash -s -- -P chefdk -p
chef gem install chef-provisioning chef-provisioning-fog chef-provisioning-vagrant
@swettk
swettk / gist:e2f6811e7b3c8cbc50e3
Last active August 29, 2015 14:27 — forked from ebuildy/gist:5d4ad0998848eaefdad8
Setup sentry logger on a fresh Ubuntu server
sudo apt-get update
sudo apt-get install python-virtualenv
sudo apt-get install python-dev
sudo apt-get install postgresql
sudo apt-get install postgresql-server-dev-9.3
sudo apt-get install redis-server
sudo -u postgres createuser -s sentry
sudo -u postgres psql -c "alter user sentry with password 'sentry';"
@swettk
swettk / README.md
Created November 19, 2015 03:26 — forked from fnichol/README.md
Testing on Mac Platforms with Test Kitchen

Testing Mac Platforms with Test Kitchen

We'll assume an OS X Mavericks (10.9) box here.

Requirements

You'll need:

  • Vagrant
  • Vagrant's VMware Fusion provider
@swettk
swettk / howto.md
Created November 19, 2015 15:26 — forked from rmoriz/howto.md
Build an OSX 10.10 base-box for test-kitchen and VirtualBox
@swettk
swettk / get-api-token-of-user-jenkins-groovy.md
Created December 8, 2015 23:18
jenkins groovy get API token of a user

This is pretty simple snippet to get API Token of a user , lets say "MYUser" in jenkins.
its pretty useful when you are working with 'jenkins-job-builder' to update jobs in jenkins, and you need to get the api token which JJB needs inorder to update jobs to ..
run this code in either jenkins script console , or as i prefer, in form of init.groovy.
so when jenkins amster starts, i create a user for JJb.
after that i get the token right away and pass it to my JJB jobs folder to file 'jenkins_jobs.ini' :)_ .

///////////////////////////////////////////////////////////////////////
@swettk
swettk / provision.sh
Created December 21, 2015 19:12 — forked from badsyntax/provision.sh
Running lxc with zfs backing store, in Ubuntu 14.04, within a virtualbox virtual machine
#!/usr/bin/env bash
# ubuntu/trusty64
apt-get update
apt-get install software-properties-common -y
apt-add-repository ppa:ubuntu-lxc/daily
add-apt-repository ppa:zfs-native/stable
add-apt-repository ppa:nginx/stable -y
@swettk
swettk / zbell.zsh
Created January 2, 2016 08:52 — forked from oknowton/zbell.zsh
#!/usr/bin/env zsh
# This script prints a bell character when a command finishes
# if it has been running for longer than $zbell_duration seconds.
# If there are programs that you know run long that you don't
# want to bell after, then add them to $zbell_ignore.
#
# This script uses only zsh builtins so its fast, there's no needless
# forking, and its only dependency is zsh and its standard modules
#
@swettk
swettk / lxc-default-with-netns
Created March 23, 2016 07:35 — forked from jjo/lxc-default-with-netns
apparmor profile to allow netns handling inside LXCs
# /etc/apparmor.d/lxc/lxc-default-with-netns
# Do not load this file. Rather, load /etc/apparmor.d/lxc-containers, which
# will source all profiles under /etc/apparmor.d/lxc
profile lxc-container-default-with-netns flags=(attach_disconnected,mediate_deleted) {
#include <abstractions/lxc/container-base>
#include <abstractions/lxc/start-container>
# - onetime mount, if /run/netns was not mounted yet: