Skip to content

Instantly share code, notes, and snippets.

View echohack's full-sized avatar
🎥
twitch.tv/echohack

echohack echohack

🎥
twitch.tv/echohack
View GitHub Profile
@barn
barn / gist:d79ec61526d32f977501
Created April 14, 2015 21:06
dumping osx system certs to a PEM file
ohessten% security find-certificate -a /System/Library/Keychains/SystemRootCertificates.keychainc >osx_system_roots.pem
ohessten% /path/to/homebrew/bin/openssl s_client -CAfile osx_system_roots.pem -verify 5 -connect sketchy.example.org:443
#!/bin/zsh
# computer activity data collection for http://jehiah.cz/one-two/
# Originally by Jehiah Czebotar. This verison by Luca Spiller.
FILE="$HOME/Dropbox/activity_log/`hostname`-`date +%Y%m%d`.log"
function log_activity()
{
local TIME=`date "+%Y-%m-%dT%H:%M:%S%z"`
local IDLE=$((`/usr/sbin/ioreg -c IOHIDSystem | sed -e '/HIDIdleTime/!{ d' -e 't' -e '}' -e 's/.* = //g' -e 'q'` / 1000000000 ))
@jehiah
jehiah / activity_snapshot.sh
Created January 7, 2013 18:43
A cron job script to capture computer activity every 30 seconds
#!/bin/sh
# computer activity data collection for http://jehiah.cz/one-two/
# by Jehiah Czebotar
FILE="activity_log/`date +%Y%m%d`.log"
function log_activity()
{
local UTC=`date "+%s,%Z"`
local IDLE=$((`/usr/sbin/ioreg -c IOHIDSystem | sed -e '/HIDIdleTime/!{ d' -e 't' -e '}' -e 's/.* = //g' -e 'q'` / 1000000000 ))
@jehiah
jehiah / dailyphoto.sh
Last active January 15, 2016 20:08
A script to use isightcapture to take photos via crontab on OSX. crontab: `*/10 * * * * sh bin/take_dailyphoto.sh`
#!/bin/sh
# This script takes a photo if the computer has not been idle for longer than a period of time
# it uses isightcapture from https://www.macupdate.com/app/mac/18598/isightcapture
[ -z "$USER" ] && echo "missing variable \$USER " && exit 1
if [ ! -d /Users/$USER/daily_photo ]; then
mkdir -p $/Users/$USER/daily_photo
fi
IDLE=$((`/usr/sbin/ioreg -c IOHIDSystem | sed -e '/HIDIdleTime/!{ d' -e 't' -e '}' -e 's/.* = //g' -e 'q'` / 1000000000 ))
export SUDO_ASKPASS=/Users/$USER/bin/get_pass.sh
# Our .tmux.conf file
# Setting the prefix from C-b to C-a
# START:prefix
set -g prefix C-a
# END:prefix
# Free the original Ctrl-b prefix keybinding
# START:unbind
unbind C-b
# END:unbind
@juliandunn
juliandunn / aix-chef-client-known-issues.md
Last active April 7, 2016 18:50
Currently known issues for Chef Client 12 & AIX.

Known Issues in Chef Client 12.0 & AIX

  • Our standard bootstrap procedure doesn't work (not that I think many folks on AIX will use it). A couple problems:
    • Omnitruck doesn't understand BFFs and has invalid syntax for uname: chef/omnitruck#72
    • Bootstrap SSH fails with SSH debug returns "cipher_init: EVP_CipherInit: set key failed for aes128-cbc (when running in -VV) -- it will also fail to negotiate other cipher suites like 3des-cbc
      • Only fix I've found so far is to installp -u security.pkcs11. The one suggested by IBM does not work: http://www-01.ibm.com/support/docview.wss?uid=isg3T1019142
      • Maybe there's a patch for this. My LPAR is 7100-02-04-1341 which isn't the latest SP.
      • security.pkcs11 is safe to remove as it has to do with hardware encryption devices (a rare use case). Customers can contact IBM if they have a hardware crypto device and need this package
    • Bootstrap assumes bash is available on the system so you get something like `k
@justinredd
justinredd / lean_coffee.md
Last active September 9, 2016 18:25
Lean Coffee

Lean Coffee

  • 60 - 90 minutes
  • 5 - 11 people

Materials

  • Table + chairs
  • PostIts and Pens
  • Timer
@damieng
damieng / WinDev.ps1
Last active March 4, 2020 19:09
Make Windows more developer-workstation oriented (includes removing crapware)
# Run this from Powershell as Administrator with (New-Object System.Net.WebClient).DownloadString("https://gist.github.com/damieng/881852e7112be7d97957/raw") | powershell -command -
Write-Output "Making Windows more developer oriented (Revision 26)..."
Set-ExecutionPolicy Unrestricted
if ([System.Environment]::OSVersion.Version.Major -ge 10) {
Write-Output " * Detected Windows 10"
Write-Output " * Removing Windows 10 bloatware"
$apps = @(
"Microsoft.3DBuilder"
@echohack
echohack / convert_flac_to_mp3.sh
Last active August 10, 2021 00:27
convert_flac_to_mp3.sh
# Recurse into all subdirectories of the working directory.
# Converts all flac into mp3 using ffmpeg
find . -type f -name "*.flac" -print0 | while read -d $'\0' a; do < /dev/null ffmpeg -i "$a" -qscale:a 0 "${a[@]/%flac/mp3}"
done
@jtimberman
jtimberman / knife.rb
Created February 1, 2012 19:33
Commented knife.rb for all the things
# Knife Configuration File.
#
# This is a Ruby DSL to set configuration parameters for Knife's
# general options. The default location for this file is
# ~/.chef/knife.rb. If multiple Chef repositories are used,
# per-repository configuration files can be created. A per repository
# configuration file must be .chef/knife.rb in the base directory of
# the Chef repository. For example,
#
# ~/Development/chef-repo/.chef/knife.rb