Skip to content

Instantly share code, notes, and snippets.

View Chaz6's full-sized avatar

Chris Hills Chaz6

View GitHub Profile
@oogali
oogali / gen-iface-names.sh
Created January 13, 2011 23:24
Generate interface DNS names for your rooters.
#!/bin/sh
# router name generator
# [ omachonu ogali / oogali at blip dot tv / @oogali ]
#
# README:
# 1. point at your router with a community
# 2. finesse names as needed into your DNS zones
# 3. have a cold beverage of your choosing.
#
@rjnienaber
rjnienaber / orgchartBuilder.py
Created February 18, 2011 06:03
Script to build an organizational chart from Active Directory
'''
Copyright (c) 2011, Richard Nienaber
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
The name of 'Richard Nienaber' may not be used to endorse or promote products derived from this software without specific prior written permission.
@cdown
cdown / gist:1163649
Last active April 9, 2024 01:10
Bash urlencode and urldecode
urlencode() {
# urlencode <string>
old_lc_collate=$LC_COLLATE
LC_COLLATE=C
local length="${#1}"
for (( i = 0; i < length; i++ )); do
local c="${1:$i:1}"
case $c in
@robinsmidsrod
robinsmidsrod / sshd_autoblock
Created October 7, 2011 15:34
Temporarily block IPs that try to brute force attack sshd automatically with ipset and rsyslog
#!/usr/bin/perl
#
# Filename: /usr/local/sbin/sshd_autoblock
# Copyright: Robin Smidsrød <robin@smidsrod.no>
# License: Same as Perl 5
#
# Temporarily block IPs that try to brute force attack sshd
# automatically with ipset and rsyslog.
#
@chitchcock
chitchcock / 20111011_SteveYeggeGooglePlatformRant.md
Created October 12, 2011 15:53
Stevey's Google Platforms Rant

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

@markusfisch
markusfisch / mime.sh
Last active March 24, 2023 16:22
bash functions to dump and inspect a message in MIME format
#!/usr/bin/env bash
##############################################################################
#### MIME interface
##############################################################################
# Parse message in MIME format and create a temporary cache directory
mime_parse()
{
MIME_CACHE=${MIME_CACHE:-`mktemp -d ${BIN}.XXXXXXXXXX`}
@christopherscott
christopherscott / ExcelToJsDate.js
Created May 24, 2012 16:40
Convert Excel date values to JavaScript date objects
// Convert Excel dates into JS date objects
//
// @param excelDate {Number}
// @return {Date}
function getJsDateFromExcel(excelDate) {
// JavaScript dates can be constructed by passing milliseconds
// since the Unix epoch (January 1, 1970) example: new Date(12312512312);
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active June 8, 2024 17:28
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@marktheunissen
marktheunissen / pedantically_commented_playbook.yml
Last active June 5, 2024 22:16 — 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.
@achimnol
achimnol / sqlite_backup.py
Created June 30, 2012 03:13
A simple and safe SQLite3 backup script written in Python using ctypes + sqlite3 online backup API
#! /usr/bin/env python
# Of course, the author does not guarantee safety.
# I did my best by using SQLite's online backup API.
from __future__ import print_function
import sys, ctypes
from ctypes.util import find_library
SQLITE_OK = 0
SQLITE_ERROR = 1
SQLITE_BUSY = 5