Skip to content

Instantly share code, notes, and snippets.

View jhazelwo's full-sized avatar

John Hazelwood jhazelwo

View GitHub Profile
@jhazelwo-charter
jhazelwo-charter / GGit.ps1
Created March 31, 2017 16:38
A 1-button git add, commit and push Powershell script using the Windows GitHub client.
$env:Path += ";C:\Users\me\AppData\Local\GitHub\PortableGit_f02737a78695063deace08e96d5042710d3e32db\cmd"
. C:\Users\me\AppData\Local\GitHub\PoshGit_73b8bf9c588df6d17c193e270da0ed4cf890d868\GitUtils.ps1
Start-SshAgent -Quiet
Add-SshKey C:\Users\me\.ssh\github_rsa
cd C:\Users\me\Art\docs\
git add -A .
git commit -m 'auto'
git push -u origin master

How to kill your VM: limits.d and the Magic of dotfiles

I was benchmark testing StatsD on my VM this week, and was seeing 40% package drop rate right out of the box. So, I increased my UNIX limits by creating a /usr/security/limits.d/limits.conf as such:

*               soft    nofile           unlimited
*               hard    nofile           unlimited
*               soft    nproc            unlimited
*               hard    nproc            unlimited
@marcan
marcan / linux.sh
Last active July 21, 2024 14:00
Linux kernel initialization, translated to bash
#!/boot/bzImage
# Linux kernel userspace initialization code, translated to bash
# (Minus floppy disk handling, because seriously, it's 2017.)
# Not 100% accurate, but gives you a good idea of how kernel init works
# GPLv2, Copyright 2017 Hector Martin <marcan@marcan.st>
# Based on Linux 4.10-rc2.
# Note: pretend chroot is a builtin and affects the current process
# Note: kernel actually uses major/minor device numbers instead of device name
@alirobe
alirobe / reclaimWindows10.ps1
Last active July 3, 2024 09:36
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
###
###
### UPDATE: For Win 11, I recommend using this tool in place of this script:
### https://christitus.com/windows-tool/
### https://github.com/ChrisTitusTech/winutil
### https://www.youtube.com/watch?v=6UQZ5oQg8XA
### iwr -useb https://christitus.com/win | iex
###
###
@archagon
archagon / playlist-to-podcast.py
Created September 28, 2012 07:03
A script that downloads videos from YouTube playlists, extracts their audio, and only downloads missing files each time it's run. Also generates an iTunes-compliant podcast xml file for private hosting purposes. Requires youtube-dl, ffmpeg, and ffprobe.
# YouTube playlist audio retreiver and iTunes-compliant podcast XML generation tool.
# This script will download each video file from the specified YouTube playlist, losslessly extract
# the audio, delete the video, and ultimately produce an iTunes-compliant podcast XML with the
# appropriate metadata, including chapter markers (if provided in the description). If you run the
# script again, only videos that haven't already been converted will be downloaded, allowing you to
# schedule the script to run as often as needed without stressing your internet connection or
# hard drive space. After generating the files and xml, you can easily host them on a local server
# in order to use them with iTunes or your favorite podcast aggregator -- but that's beyond this
# script's jurisdiction.