Skip to content

Instantly share code, notes, and snippets.

@artbikes
artbikes / lvsnapshot.sh
Created November 11, 2015 22:55 — forked from bcarpio/lvsnapshot.sh
lvsnapshot.sh
#!/bin/bash
DATE=`date +"%a"`
DVOLNAME=datalv
LVOLNAME=journallv
VOLGR=datavg
DVOLPATH=/dev/$VOLGR/$DVOLNAME
LVOLPATH=/dev/$VOLGR/$LVOLNAME
DSNAME=`echo ${DVOLNAME}_ss_${DATE} | tr '[A-Z]' '[a-z]'`
LSNAME=`echo ${LVOLNAME}_ss_${DATE} | tr '[A-Z]' '[a-z]'`
@artbikes
artbikes / gist:c46f284807118cfff48217a3ca8e9df0
Created July 20, 2016 19:12 — forked from jkeiser/gist:7244532
Adventures With Chef: Ghost #1

Installing My Blog

I want to install Ghost as my blog. I want the web server, ghost, and OS, all to receive security updates on a regular schedule without me having to muck with it. (I am willing for the blog to sometimes go down because of this.)

I'll eventually want monitoring and alerting, and backups of the blog entries; uploads of the static site to my web hosting company; automatic DNS configuration; updates of the base OS. But for now I'm modest, I just want Ghost and I want updates.

I want to do this all with Chef. I want to write the Ghost cookbook myself, not because the existing Ghost cookbook is bad, but because I want to get a real feel for how these get written.

Getting Started: Test Kitchen

@artbikes
artbikes / notifier.go
Created July 29, 2016 18:52 — forked from zankich/notifier.go
Santa Monica Golang
package main
import (
"encoding/json"
"fmt"
"net/http"
"time"
"github.com/goiot/devices/piglow"
"golang.org/x/exp/io/i2c"
@artbikes
artbikes / one-liners.md
Created July 29, 2016 18:55 — forked from KL-7/one-liners.md
Ruby one-liners

One-liners

Reverse every line:

Input file:

$ cat foo
qwe
123

bar

@artbikes
artbikes / Bitwise AND
Created August 4, 2016 13:42 — forked from cedricbellet/ Bitwise AND
Draws the bitwise AND graph
.
@artbikes
artbikes / gist:728f4e0fe3d8481fba56277c18ac1b9e
Created August 26, 2016 20:37 — forked from adomado/gist:1226159
Example mongodb script
db = connect("localhost:27017/test");
var cursor = db.unicorns.find({gender : "m"});
var total = 0;
while(cursor.hasNext()) {
var obj = cursor.next();
total += (obj.hits || 0);
}
print(total);
@artbikes
artbikes / dspD8.ino
Created September 29, 2016 02:24 — forked from anonymous/dspD8.ino
The dsp-D8 drum synthesizer
// dsp-D8 Drum Chip (c) DSP Synthesizers 2015
// Free for non commercial use
// http://janostman.wordpress.com
#include <avr/interrupt.h>
#include <avr/io.h>
#include <avr/pgmspace.h>
#include <Adafruit_NeoPixel.h>
#define PIN 3
#define LEDCOUNT 23
#define SPEED 5
const uint8_t PROGMEM gamma[] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2,
@artbikes
artbikes / raid.yml
Created October 3, 2016 19:19 — forked from suprememoocow/raid.yml
Setup and initialise a RAID10 array of EC2 EBS volumes using an Ansible playbook
- action: ec2_facts
- apt: pkg=lvm2 state=present
- apt: pkg=mdadm state=present
- pip: name=boto state=latest
- ec2_vol: instance="{{ hostvars[inventory_hostname]['ansible_ec2_instance-id'] }}"
volume_size=20
device_name="{{ item }}"
@artbikes
artbikes / knife cheat
Created January 27, 2017 18:19 — forked from ipedrazas/knife cheat
Hello!
# knife cheat
## Search Examples
knife search "name:ip*"
knife search "platform:ubuntu*"
knife search "platform:*" -a macaddress
knife search "platform:ubuntu*" -a uptime
knife search "platform:ubuntu*" -a virtualization.system
knife search "platform:ubuntu*" -a network.default_gateway