Skip to content

Instantly share code, notes, and snippets.

@geraldh
geraldh / blocksync.py
Created August 8, 2012 16:47 — forked from rcoup/blocksync.py
Block device sync between remote hosts. Based off http://www.bouncybouncy.net/programs/blocksync.py
#!/usr/bin/env python
"""
Synchronise block devices over the network
Copyright 2006-2008 Justin Azoff <justin@bouncybouncy.net>
Copyright 2011 Robert Coup <robert@coup.net.nz>
License: GPL
Getting started:
@ramcq
ramcq / blocksync.py
Last active July 6, 2021 15:03 — forked from rcoup/blocksync.py
#!/usr/bin/env python
"""
Synchronise block devices over the network
Copyright 2006-2008 Justin Azoff <justin@bouncybouncy.net>
Copyright 2011 Robert Coup <robert@coup.net.nz>
Copyright 2012 Holger Ernst <info@ernstdatenmedien.de>
Copyright 2014 Robert McQueen <robert.mcqueen@collabora.co.uk>
License: GPL
@chernjie
chernjie / git-gh-setup.sh
Created February 9, 2015 09:25
Fetch Github's Pull Request as a remote branch
#!/usr/bin/env bash
git remote -v | grep fetch | grep github | \
while read remote url _; do
if ! git config --get-all "remote.$remote.fetch" | grep -q refs/pull
then
git config --add "remote.$remote.fetch" \
'+refs/pull/*/head:refs/remotes/'"$remote"'/pull/*'
fi
done
@ladyada
ladyada / ar1100cal.py
Last active March 19, 2018 23:01
ar1100.py auto-calibrator
#!/usr/bin/python
import sys
import usb.core
import usb.util
import time
import os
import pygame
from pygame.locals import*
def mapnum(x, in_min, in_max, out_min, out_max):
@kmassada
kmassada / README.md
Last active September 4, 2021 12:22
Vagrant and KVM(QEMU) on Centos7

Libvirt

yum group install -y "Development Tools"
yum -y install qemu-kvm libvirt virt-install bridge-utils libvirt-devel  libxslt-devel libxml2-devel libvirt-devel libguestfs-tools-c
echo "net.ipv4.ip_forward = 1"|sudo tee /etc/sysctl.d/99-ipforward.conf
sysctl -p /etc/sysctl.d/99-ipforward.conf
@n1trux
n1trux / linux_lightsout.bash
Last active January 2, 2018 00:36
lightsout for linux (suspend when no network activity for 1 hour)
#!/bin/bash
########################################################################
# LIGHTS OUT FOR LINUX (lofl) #
# This script suspends the computer if it's idle for a given period of #
# time. It monitors network activity, logged on users and CPU load. #
########################################################################
# maximum packet count per minute – usually not more than 12-15
net_threshold=12
@roykho
roykho / stripe-pre-4.1.14-styles.txt
Last active February 5, 2024 11:58
Stripe Pre 4.1.14 Styles
#add_payment_method .woocommerce-PaymentMethod label { margin-left: 10px; }
#add_payment_method li { clear: right; }
#add_payment_method #wc-stripe_sepa-form { padding: 10px; }
form#order_review #payment_method_stripe { margin: 25px 0 25px 25px; }
form#order_review #payment_method_stripe_sepa { margin: 25px 0 25px 25px; }
form#order_review .payment_methods label { margin-left: 10px; }
form#order_review li { clear: right; }
form#order_review #wc-stripe_sepa-form { padding: 10px; }
.wc_payment_method .payment_box label { display: inline; }