Skip to content

Instantly share code, notes, and snippets.

View nrr's full-sized avatar
🛒

Nathaniel Reindl nrr

🛒
  • Sunnyvale, CA, USA
View GitHub Profile

Keybase proof

I hereby claim:

  • I am nrr on github.
  • I am nrr (https://keybase.io/nrr) on keybase.
  • I have a public key ASD8aFFMRc9GxObly8Hwjen6nbJ9gLBiIPs8u3lgBQyZ8Ao

To claim this, I am signing this object:

@nrr
nrr / gist:cfb54db904a5bb88dd010267a4898230
Last active August 19, 2016 12:20
PowerShell on OS X is weird. The Microsoft of 2016 is weird. I want off this ride.
PS /Users/nrr> Get-Process | Sort-Object -Property CPU | Select-Object -Last 10
Handles NPM(K) PM(K) WS(K) CPU(s) Id SI ProcessName
------- ------ ----- ----- ------ -- -- -----------
0 0 0 106808 4,238.603 581 1 Google Chrome H
0 0 0 68060 4,240.391 671 1 Google Chrome H
0 0 0 34944 4,558.544 347 1 Dock
0 0 0 691396 6,055.888 2865 1 Google Chrome H
0 0 0 34588 6,254.382 299 1 CalendarAgent

Keybase proof

I hereby claim:

  • I am nrr on github.
  • I am nrr (https://keybase.io/nrr) on keybase.
  • I have a public key whose fingerprint is 95D3 B9ED EC4A A8AD BC21 AF4B 1CB7 6F2B 66C7 D0F1

To claim this, I am signing this object:

@nrr
nrr / _etc_logrotate.d_nginx.conf
Created August 1, 2013 18:25
Wanna chunk nginx logs into multilog/svlogd? Well, here's kinda how you do that.
/var/log/nginx/*.log {
hourly
missingok
rotate 24
compress
delaycompress
notifempty
create 640 nginx adm
sharedscripts
postrotate
@nrr
nrr / log_root_lumberjack.json
Last active December 20, 2015 12:28 — forked from bakins/gist:6130281
Here's a primer on using Jordan Sissel's lumberjack as a processor for svlogd/multilog.
{
"network": {
"servers": [ "localhost:5043" ],
"ssl certificate": "./root/lumberjack.crt",
"ssl key": "./root/lumberjack.key",
"ssl ca": "./root/lumberjack_ca.crt"
},
"files": [
{
"paths": [ "-" ],
xsetwacom set "Wacom Intuos4 4x6 pad" AbsWheelUp "4"
xsetwacom set "Wacom Intuos4 4x6 pad" RelWheelUp "4"
xsetwacom set "Wacom Intuos4 4x6 pad" AbsWheelDown "5"
xsetwacom set "Wacom Intuos4 4x6 pad" RelWheelDown "5"
xsetwacom set "Wacom Intuos4 4x6 pad" Rotate half
@nrr
nrr / gist:3907865
Created October 17, 2012 20:14 — forked from wolfiestyle/gist:3907574
strange error in line 7
#!/usr/bin/perl
use strict;
sub test
{
open FP, "< $0" or die;
while (my $l = <FP>) # Modification of a read-only value attempted at ./test.pl line 7.
{
chomp $l;
print "w: $l\n";
@nrr
nrr / crontab
Created May 6, 2012 06:12 — forked from tovbinm/crontab
Logrotate & upload nginx logfiles to s3://bucket/dt=..../hostname.log...gz
# Nginx - logrotate & upload to S3
0 0 * * * /usr/sbin/logrotate /etc/logrotate.d/nginx
15 0 * * * s3cmd put /var/log/nginx/access.log-`date +"\%Y\%m\%d"`.gz s3://$LOGS_BUCKET_NAME/nginx-access/`date +"dt=\%Y\%m\%d"`/`hostname -s`.access.log-`date +"\%Y\%m\%d"`.gz
@nrr
nrr / random_filehandle_combinators.pl
Created March 13, 2012 17:23
Some combinators for writing and reading files in Perl because why not?
sub with_open_filehandle
{
my ($fh, $callback) = @_;
try {
$callback->($fh);
}
finally {
$fh->close;
};
@nrr
nrr / gist:1994928
Created March 7, 2012 18:22
Rakefile for puppet modules
require 'rubygems'
require 'rake/clean'
require 'rspec/core/rake_task'
CLEAN.include("")
CLOBBER.include("target")
desc "Default task prints the possible targets."
task :default do
sh %{rake -T}