Skip to content

Instantly share code, notes, and snippets.

View nealhardesty's full-sized avatar
🙀
Doin' stuffz

Neal Hardesty nealhardesty

🙀
Doin' stuffz
View GitHub Profile

Keybase proof

I hereby claim:

  • I am nealhardesty on github.
  • I am nealhardesty (https://keybase.io/nealhardesty) on keybase.
  • I have a public key ASCqfHI0CbEc309kWuXyZRi4wt-RGcF5l4t1pL-fH1PaYQo

To claim this, I am signing this object:

@nealhardesty
nealhardesty / mvregex.py
Last active November 29, 2018 23:11
Super simple python file renamer.
#!/usr/bin/env python3
import argparse
import re
import os
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Bulk File Rename With Regexes!")
parser.add_argument("pattern", help="Pattern (or Regex) to look for in the file names. Required.", nargs=1)
parser.add_argument("replacement", help="Substitution value in the file name. Required.", nargs=1)
@nealhardesty
nealhardesty / metroSums.go
Created January 4, 2015 17:00
The 2010 Census puts populations of 26 largest US metro areas at 18897109, 12828837, 9461105, 6371773, 5965343, 5946800, 5582170, 5564635, 5268860, 4552402, 4335391, 4296250, 4224851, 4192887, 3439809, 3279833, 3095313, 2812896, 2783243, 2710489, 2543482, 2356285, 2226009, 2149127, 2142508, and 2134411. Can you find a subset of these areas where…
package main
import (
"fmt"
"math"
)
/*
OpenGarden Code Challenge
@nealhardesty
nealhardesty / kvmBridge
Last active December 27, 2015 06:19
KVM /etc/network/interfaces
1) Edit /etc/network/interfaces
auto br0
iface br0 inet static
address xxx.xxx.xxx.xxx
netmask xxx.xxx.xxx.xxx
gateway xxx.xxx.xxx.xxx
bridge_ports eth0
bridge_stp off
bridge_maxwait 5
@nealhardesty
nealhardesty / enableSambaAccess
Created August 12, 2013 18:21
Enable Access To Samba/MacSMB from Windows
* Run 'gpedit.msc'
* Navigate to 'Local Computer Policy > Computer Configuration > Windows Settings > Security Settings > Local Policies > Security Options'
* Set 'Microsoft network client: Send unencrypted password to third-party SMB server' to "Enabled".
* Set 'Network security: LAN Manager authentication level' to 'Send LM & NTLM - use NTLMv2 session security if negotiated.
* Reboot
@nealhardesty
nealhardesty / sbt-init
Last active December 20, 2015 18:49
Simple bash shell script to initialize an sbt/scala project.
#!/bin/bash
#
# init-sbt
#
# Initializes an sbt project with ScalaTest, ENSIME and idea-gen support
# Created by Neal Hardesty 2013, released under an MIT License
#
function usage() {
@nealhardesty
nealhardesty / enableNatRouting.txt
Last active December 19, 2015 20:18
Enable NAT Routing
```
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
sudo sysctl -w net.ipv4.ip_forward=1
```

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@nealhardesty
nealhardesty / gist:2714705
Created May 16, 2012 22:55 — forked from kennethkalmer/gist:278814
node.js SMTP Server
/*
smtpd.js is SMTP server written for node.js
MIT License
*/
var tcp = require('tcp');
var sys = require('sys');