Skip to content

Instantly share code, notes, and snippets.

View briancline's full-sized avatar

Brian Cline briancline

  • SoftLayer / IBM Cloud
  • Dallas, Texas
View GitHub Profile
@teknoraver
teknoraver / unixhttpc.go
Last active March 21, 2024 11:48
HTTP over Unix domain sockets in golang
package main
import (
"context"
"flag"
"fmt"
"io"
"net"
"net/http"
"os"
import os
import sys
import errno
from collections import defaultdict
from swift.common.ring import Ring
device_root = sys.argv[1]
r = Ring('/etc/swift/object.ring.gz')
dev2parts = defaultdict(set)
@oxguy3
oxguy3 / RoughScroll.js
Last active September 27, 2023 15:02
Greasemonkey script for disabling smooth scrolling across the web (WIP! currently breaks a few websites, unfortunately)
// ==UserScript==
// @name RoughScroll
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Disables smooth scrolling on ALL websites
// @author Hayden Schiff (oxguy3)
// @match *://*/*
// @grant none
// ==/UserScript==
/* jshint -W097 */
@fer-ri
fer-ri / mirror.md
Last active November 5, 2021 11:06
Mirror Website Using Httrack Command Line
mkdir ~/Mirror

cd ~/Mirror

httrack --connection-per-second=8 --sockets=8 --keep-alive --display --verbose --advanced-progressinfo --disable-security-limits -i -s0 -m -F 'Mozilla/5.0 (X11;U; Linux i686; en-GB; rv:1.9.1) Gecko/20090624 Ubuntu/9.04 (jaunty) Firefox/3.5' -#L999999 http://domain.com
@irvingpop
irvingpop / sane_defaults.rb
Created October 31, 2015 17:59
Vagrant: Irving's sane defaults for Virtualbox with better performance
# replaces this file /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/plugins/providers/virtualbox/action/sane_defaults.rb
# NOTE: if using a different Vagrant version, adjust the version field accordingly
# NOTE2: only the sections with the IRVING comment have been changed from the default
require "log4r"
module VagrantPlugins
module ProviderVirtualBox
module Action
class SaneDefaults
@noromanba
noromanba / twitch-irc-with-weechat.mkd
Last active January 24, 2024 01:17
How to join Twitch IRC w/ WeeChat
@Zeerg
Zeerg / newcert.py
Last active March 21, 2024 17:22
Python script to generate CSR/Self Signed Cert. Needs pyOpenssl and python-whois
#!/usr/bin/python
from OpenSSL import crypto
import os
import sys
import datetime
import whois
#Variables
TYPE_RSA = crypto.TYPE_RSA
TYPE_DSA = crypto.TYPE_DSA
@sling00
sling00 / dfree
Last active October 22, 2023 13:05
disk free for samba that can determine fs type and calculate accordingly.
#!/bin/bash
#Originally by stanislavs from post http://stanislavs.org/reporting-correct-space-usage-for-samba-shared-zfs-volumes/#comment-2443
#Used some updated code from github user umito / Peter on that site to clean up the non zfs code.
if [[ `findmnt -n -o FSTYPE -T "$PWD" | grep -c zfs` > 0 ]]
then
# echo "DEBUG: this is zfs"
USED=$((`zfs get -o value -Hp used $PWD` / 1024)) > /dev/null
AVAIL=$((`zfs get -o value -Hp available $PWD` / 1024)) > /dev/null
TOTAL=$(($USED+$AVAIL)) > /dev/null
@paalfe
paalfe / CiscoKeyGen.py
Created May 17, 2015 20:45
Cisco IOU License Generator. Originally found at http://www.routingloops.co.uk/cisco/gns3-v1-1-install-on-ubuntu-14-04-lts/, I have done a few changes to it. Make the file executable with " chmod +x CiscoKeyGen.py " and execute it " ./CiscoKeyGen.py ".
#! /usr/bin/python
print "\n*********************************************************************"
print "Cisco IOU License Generator - Kal 2011, python port of 2006 C version"
import os
import socket
import hashlib
import struct
# get the host id and host name to calculate the hostkey
hostid=os.popen("hostid").read().strip()
hostname = socket.gethostname()
rew search aptly
brew install aptly
brew install gpg
brew install wget
gpg --no-default-keyring --keyring trustedkeys.gpg --keyserver keys.gnupg.net --recv-keys 437D05B5
aptly -architectures="amd64" -with-udebs=true mirror create precise-main-udeb http://us.archive.ubuntu.com/ubuntu precise
aptly mirror update precise-main-udeb
gpg --no-default-keyring --keyring trustedkeys.gpg --keyserver keys.gnupg.net --recv-keys 17ED316D
aptly -architectures="amd64" mirror create ceph-firefly http://ceph.com/debian-firefly precise main
aptly -architectures="amd64" mirror create ceph-extras http://ceph.com/packages/ceph-extras/debian/ precise main