Skip to content

Instantly share code, notes, and snippets.

View rphillips's full-sized avatar

Ryan Phillips rphillips

  • Red Hat
  • Austin, TX
View GitHub Profile
@creationix
creationix / rackspace-monitoring-agent.service
Last active August 29, 2015 14:04
Virgo service file for archlinux
; Create this file at /etc/systemd/system/rackspace-monitoring-agent.service
; Then reload the configs using `systemctl daemon-reload`
; Enable it with `systemctl enable rackspace-monitoring-agent.service`
; Restart this service using `systemctl restart rackspace-monitoring-agent`
[Unit]
Description=Rackspace Monitoring Agent
After=network.target
[Service]
""" file mytest.py """
# you require to return a HttpResponse instance in your view
from django.http import HttpResponse
# handler* are required for the urlresolver
from django.conf.urls.defaults import patterns, handler404, handler500
# minimal settings
DEBUG = True
# tell django to use this file to find urlpatterns. see below
ROOT_URLCONF = "mytest"

Create a tunnel to github with the git default daemon port like this:

$ ssh -L9418:github.com:9418 myuser@myhomessh.com

And clone repositories replacing github.com with localhost, like so:

$ git clone git://localhost/someuser/someproject.git

If you want to preserve the “correct” metadata, there are several options

-- updated for luvit 2
local ffi = require('ffi')
local bit = require('bit')
local uv = require('uv')
local timer = require('timer')
local Object = require('core').Object
local utils = require('utils')
local libcurl = ffi.load('libcurl')
@JoshTGreenwood
JoshTGreenwood / gist:443253f42fb80455792f
Created December 1, 2015 22:20
Automatically add magit cloned repos to the projectile project list
(defun add-project-to-projectile-known-projects (_ directory)
(projectile-add-known-project directory))
(advice-add 'magit-clone :after 'add-project-to-projectile-known-projects)
Mac OS X 10.9.2, Vagrant 1.5.1, VMWare Fusion 6.0.2
I had some intense difficulties getting this all to work. The VMs would boot
fine with gui=true, but then would fail as soon as I turned that off. Yet when
they failed, they were actually running just fine! I could ssh in, but neither
vagrant nor vmrun could find the running VMs! You would think that it would
give better errors, but no.
First off, most boxes you find online will be using the VMWare configuration 9,
which will only boot if you have gui=true the first boot, so you can upgrade it
@joerg-krause
joerg-krause / lj-amonitor.lua
Last active May 12, 2016 16:58
ALSA integration into Luvit
--[[
The MIT License (MIT)
Copyright (c) 2016 Jörg Krause <joerg.krause@embedded.rocks>
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:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
@jjbuchan
jjbuchan / gist:83b03c1fb24ea1039fe25e9e44f822a2
Last active August 6, 2016 05:14
Re-evaluating for incident
If we receive an email with a list of accounts related to the ddos in LON, we need to do the following:
The email will likely be from Slade and will relate to a new comment in this gist - https://gist.github.rackspace.com/virg3823/efc9483068ea64bc879cdc2b9f35daa9
The last one I have run is "992837, als0FRG5zP" from https://gist.github.rackspace.com/virg3823/efc9483068ea64bc879cdc2b9f35daa9#gistcomment-4193
so look for anything after it.
You need to convert that to a list with just the tenant ids:
e.g.
I copy it into sublime and remove the alarm ids, then:
#!/usr/bin/env groovy
import groovy.jmx.builder.JmxBuilder
import javax.management.ObjectName
import groovy.json.JsonOutput
@Grapes(
@Grab(group='args4j', module='args4j', version='2.33')
)
import org.kohsuke.args4j.*
#!/usr/bin/env bash
if [ $# -eq 0 ]; then
printf 1 "Usage: $(basename $0) [build-args [-- run-args [-- cmd-args] ] ]"
printf 1 " NOTE!!! the -rm-flag is hardcoded for build!"
fi
BUILD_ARG=()
RUN_ARG=()
CMD_ARG=()