Skip to content

Instantly share code, notes, and snippets.

@fluxrad
fluxrad / onedark.theme
Last active January 26, 2024 13:12
A one-dark theme for xfce4-terminal
[Scheme]
Name=One Dark
ColorForeground=#ABB2BF
ColorCursor=#ABB2BF
ColorBackground=#282C34
ColorSelection=#3B4451
ColorSelectionUseDefault=FALSE
ColorBold=#B9C0CB
ColorBoldUseDefault=FALSE
ColorPalette=#282C34;#E06C75;#98C379;#E5C07B;#61AFEF;#C678DD;#56B6C2;#ABB2BF;#3E4452;#BE5046;#98C379;#D19A66;#61AFEF;#C678DD;#56B6C2;#5C6370
@fluxrad
fluxrad / MR Unstagnator.user.js
Last active April 18, 2018 23:16
MR Unstagnator
// ==UserScript==
// @name MR Unstagnator
// @namespace http://marginalrevolution.com/
// @version 0.1
// @description Make MR look better and more usable.
// @author Aaron Mills
// @match http*://marginalrevolution.com/*
// @grant GM_addStyle
// ==/UserScript==
@fluxrad
fluxrad / pre-commit
Created April 11, 2012 19:04
A pre-commit git hook to validate puppet syntax
#!/bin/bash
# pre-commit git hook to check the validity of a puppet manifest
#
# Prerequisites:
# gem install puppet-lint puppet
#
# Install:
# /path/to/repo/.git/hooks/pre-comit
# Source RVM if needed
@fluxrad
fluxrad / docker-up-or-reboot.sh
Created May 18, 2016 13:58
A script to check if the Docker daemon is up. If not, reboot after three failed docker ps commands.
#!/bin/bash
SLEEP_SECONDS=600
while true; do
for i in `seq 1 3`; do
timeout 5 docker ps -q && break || echo "Docker daemon is not running. Rebooting"
if [[ $i -eq 3 ]]; then
reboot
@fluxrad
fluxrad / keybase.md
Created March 29, 2016 13:47
Keybase proof

Keybase proof

I hereby claim:

  • I am fluxrad on github.
  • I am fluxrad (https://keybase.io/fluxrad) on keybase.
  • I have a public key ASAqmZbGFe3T3u48LvrAf3_r8MIAmmFvzkC5KYfGmAfNGgo

To claim this, I am signing this object:

@fluxrad
fluxrad / sshrm.sh
Created September 9, 2013 19:02
A function definition to quickly remove host+key entries from .ssh/known_hosts. Useful for when a node is replaced, or you otherwise need to remove a group of hosts.
# Remove any entries from SSH known_hosts file
# that match the specified string.
sshrm () {
node=$1
echo "Removing $node from SSH known hosts"
sed -i '.bak' -e "/^$node/d" ~/.ssh/known_hosts
}
@fluxrad
fluxrad / projects.md
Created January 16, 2013 18:25
Random project ideas or "Cool shit that needs to happen."

Projects that totally need to happen

  • People need to know when a Turntable room is active - use case: companies that have employees who like to jam out together. Idead: An IFTTT channel or a job that contacts a group of subscribers when a Turntable.fm room is active/updated.
@fluxrad
fluxrad / some_user.rb
Created November 1, 2011 21:52
Facter fact to test for a user
require 'facter'
Facter.add("some_user") do
setcode do
system "/usr/bin/id someuser >/dev/null 2>&1"
end
end
@fluxrad
fluxrad / bar.js
Created April 9, 2015 20:17
Dynamically requiring module in NodeJS
exports.index = function(req, res) {
res.send('This is bar!');
};
@fluxrad
fluxrad / update_hostname.sh
Created November 6, 2014 22:08
Update hostname on an AWS instance
# Fix an EC2 instance's hostname.
echo "ip-$(echo $(curl -s http://169.254.169.254/latest/meta-data/local-ipv4 | tr '.' '-'))" | sudo tee /etc/hostname | sudo xargs hostname