Skip to content

Instantly share code, notes, and snippets.

@joshskidmore
joshskidmore / gpd-micropc-keyboard.sh
Created July 5, 2019 14:56
Uses xmodmap + xcape to use the MicroPC's bottom row a bit more efficiently
#!/usr/bin/env bash
# resets keyboard; kills all running instances of xcape
reset_kbd () {
local xcape_cnt=$(pgrep xcape | wc -l)
echo " - reset_kbd"
echo " - killing $xcape_cnt instances of xcape"
setxkbmap -layout us
@danieleggert
danieleggert / GPG and git on macOS.md
Last active March 26, 2024 14:22
How to set up git to use the GPG Suite

GPG and git on macOS

Setup

No need for homebrew or anything like that. Works with https://www.git-tower.com and the command line.

  1. Install https://gpgtools.org -- I'd suggest to do a customized install and deselect GPGMail.
  2. Create or import a key -- see below for https://keybase.io
  3. Run gpg --list-secret-keys and look for sec, use the key ID for the next step
  4. Configure git to use GPG -- replace the key with the one from gpg --list-secret-keys
@matejkramny
matejkramny / docker_proxy.js
Created October 5, 2014 20:39
Tiny net proxy
var net = require('net');
net.createServer(function (socket) {
socket.on('data', function (chunk) {
console.log(chunk.toString('utf8'));
});
var d = net.createConnection('/var/run/docker.sock');
d.on('data', function (chunk) {
console.log('res ->', chunk.toString('utf8'));
@DavidVaini
DavidVaini / round.go
Created April 9, 2014 19:58
Arggh Golang does not include a round function in the standard math package. So I wrote a quick one.
package main
import (
"log"
"math"
)
func Round(val float64, roundOn float64, places int ) (newVal float64) {
var round float64
pow := math.Pow(10, float64(places))
@plentz
plentz / nginx.conf
Last active March 20, 2024 18:49
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@mmoulton
mmoulton / README.md
Last active November 7, 2020 18:19
Docker Container Stats Collection Using Collectd

Docker stats collection for collectd

This script can be used to feed collectd with cpu and memory usage statistics for running docker containers using the collectd exec plugin.

This script will report the used and cached memory as well as the user and system cpu usage by inspecting the appropriate cgroup stat file for each running container.

Usage

This script is intented to be executed by collectd on a host with running docker containers. To use, simply configure the exec plugin in collectd to execute the collectd-docker.sh script. You may need to adjust the script to match your particulars, such as the mount location for cgroup.

@jedi4ever
jedi4ever / dns tuning ssh login speedup vagrant
Created May 27, 2013 13:37
speeding up DNS/SSH connections in vagrant
- Tune /etc/ssh/sshd_config
UseDNS no # Disable DNS lookups
GSSAPIAuthentication no # Disable negotation of slow GSSAPI
don't forget to restart it, use a script provider to set it , or create it with veewee or snapshot it
- Tune Vagrantfile
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
@brandonb927
brandonb927 / osx-for-hackers.sh
Last active March 27, 2024 06:33
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx
@marktheunissen
marktheunissen / pedantically_commented_playbook.yml
Last active February 16, 2024 04:32 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
This playbook has been removed as it is now very outdated.
@benatkin
benatkin / Global.sublime-settings
Created July 20, 2011 04:26
excluding node_modules from Sublime Text 2
// Place user-specific overrides in this file, to ensure they're preserved
// when upgrading
{
"folder_exclude_patterns": [".svn", ".git", ".hg", "CVS", "node_modules"]
}