Skip to content

Instantly share code, notes, and snippets.

🦜

Katie McLaughlin glasnt

Block or report user

Report or block glasnt

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@glasnt
glasnt / pastie
Created Sep 10, 2013
Given sufficient s3cmd setup, this script can be used to paste stuff into your bucket.
View pastie
#! /bin/bash -e
BUCKET="mabucket"
PASTE="paste"
if [ $# -eq 0 ]; then echo "Usage: $0 filename, or -l for list"; exit 1;fi
if [ $1 = "-l" ]; then s3cmd ls s3://$BUCKET/$PASTE/; exit 0; fi
FILENAME=`date +"%s"`
cp $1 /tmp/$FILENAME.txt
View index.html
<!doctype html>
<script src="https://code.shutterstock.com/rickshaw/vendor/d3.v2.js"></script>
<script src="https://code.shutterstock.com/rickshaw/rickshaw.min.js"></script>
<div id="chart"></div>
<script>
// Return an xinterp function for a given graph
function xinterp_on_graph(graph) {
@glasnt
glasnt / Makefile
Last active Aug 29, 2015 — forked from christian-marie/Makefile
Makefile for all the awesome "markdown -> pandoc -> pdf"-ness
View Makefile
MARKDOWNS=$(wildcard *.md)
PDFS=$(MARKDOWNS:md=pdf)
all: $(PDFS)
clean:
rm -f $(PDFS)
%.pdf: %.md
pandoc -V geometry:margin=1in -V papersize:"a4paper" --toc $< -o $@
@glasnt
glasnt / Dockerfile
Created Feb 3, 2015
wget output progress = STDERR
View Dockerfile
FROM debian:wheezy
RUN apt-get update && apt-get install -y wget
# Loud and noisy
RUN wget google.com
# Quiet
RUN wget google.com -q
View keybase.md

Keybase proof

I hereby claim:

  • I am glasnt on github.
  • I am glasnt_ (https://keybase.io/glasnt_) on keybase.
  • I have a public key whose fingerprint is CF58 E858 6DC8 B4AD F1E9 322E 7149 57F8 48E5 B597

To claim this, I am signing this object:

@glasnt
glasnt / 00_readme.md
Last active Aug 29, 2015
Rubocop in SPAACCEE
View 00_readme.md

Rubocop doesn't appear to be correcting spaces within braces denoting variables within strings.

Attempting an automatic correction does not fix this.

Running the auto-gen-correct command does not suggest any configurations to correct this.

@glasnt
glasnt / gist:f9478fc8bf8269d8426d
Created May 31, 2015
DEVOPS WEEKLY ISSUE #230
View gist:f9478fc8bf8269d8426d

DEVOPS WEEKLY ISSUE #230 - 31st May 2015

A bit of a monitoring/performance/security feel this week - mainly due to Velocity conference this last week and partly as I’m heading to Infosecurity Europe this coming week. Thanks to folks who sent me infrastructure testing links last week too.

Sponsor

Devops Weekly is sponsored by Brightbox Cloud - serious UK-based cloud infrastructure from only 1.5p per hour (£10.95/month)

View octohat.rb
# Super basic implementation of the octohat concept, but in ruby.
# It most probably is missing some elements.
require 'octokit'
access_token = ENV["GITHUB_TOKEN"]
repo = ARGV[0]
client = Octokit::Client.new(:access_token => access_token)
Octokit.auto_paginate = true
@glasnt
glasnt / ncpus.py
Created Dec 15, 2015
Get Number of CPUs for Any System, if Python is about
View ncpus.py
# Based on : https://groups.google.com/d/msg/sage-devel/1lIJ961gV_w/y-2uqPCyzUMJ
import os
def ncpus():
#for Linux, Unix and MacOS
if hasattr(os, "sysconf"):
if os.sysconf_names.has_key("SC_NPROCESSORS_ONLN"):
#Linux and Unix
ncpus = os.sysconf("SC_NPROCESSORS_ONLN")
if isinstance(ncpus, int) and ncpus > 0:
return ncpus
You can’t perform that action at this time.