Skip to content

Instantly share code, notes, and snippets.

View tsabat's full-sized avatar

Tim Sabat tsabat

View GitHub Profile
cat errors.out.newest  | awk '{print $30}' | awk '{print length, $0}' | sort -g
3 '//
59 'http://pepsi.pre.tribalddb.fi/nhl/v6/libs/modernizr.min.js
66 '//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js<div
66 'http://static.tumblr.com/1s4z8hu/UTBlo4136/jquery.masonry.min.js,
68 'http://netdna.bootstrapcdn.com/bootstrap/3.0.2/js/bootstrap.min.js,
<ul><li><a target='_blank' href='http://codepen.dev/pen/wldCG'> wldCG </a></li><li><a target='_blank' href='http://codepen.dev/pen/kHgnt'> kHgnt </a></li><li><a target='_blank' href='http://codepen.dev/pen/JHgvi'> JHgvi </a></li><li><a target='_blank' href='http://codepen.dev/pen/czCey'> czCey </a></li><li><a target='_blank' href='http://codepen.dev/pen/laCsw'> laCsw </a></li><li><a target='_blank' href='http://codepen.dev/pen/GbDAr'> GbDAr </a></li><li><a target='_blank' href='http://codepen.dev/pen/gqCBf'> gqCBf </a></li><li><a target='_blank' href='http://codepen.dev/pen/mrovt'> mrovt </a></li><li><a target='_blank' href='http://codepen.dev/pen/yvqoh'> yvqoh </a></li><li><a target='_blank' href='http://codepen.dev/pen/Dgulj'> Dgulj </a></li><li><a target='_blank' href='h
@tsabat
tsabat / pills.md
Last active August 29, 2015 14:19

Hey, here are the images you asked for.

The page breaks the browser cause of the sheer size. I could alter this to download the images for you, but i don't know what u really want to accomplish.

For posterity, here's the code:

#!/usr/bin/env ruby

require 'httparty'

Which came first, codepen.io or decodedmagazine.com?

asking whois

whois decodedmagazine.com

result

@tsabat
tsabat / bad_disk.md
Last active August 29, 2015 14:14
exploring disk contention on a box

Sometimes choosing the right AWS resource to use makes all the difference. Here's a story of how I used iotop and iostat to help build evidence for the need to chose ebs-optimized disk to solve a problem.

problem description

A redis box was acting up. Here's what I'd experience:

  • slow login
  • failing redis backups (ERR Background save already in progress)
  • general slugishness
## The Problem
Standard practices say no non-root process gets to talk to the Internet on a port less than 1024. How, then, could I get Node talking on port 80 on EC2? (I wanted it to go as fast as possible and use the smallest possible share of my teeny tiny little micro-instance's resources, so proxying through nginx or Apache seemed suboptimal.)
## The temptingly easy but ultimately wrong solution:
Alter the port the script talks to from 8000 to 80:
}).listen(80);
@tsabat
tsabat / solr.sh
Last active August 29, 2015 14:13
install solr on ubuntu
# instructions adapted from
# http://www.valuebound.com/resources/blog/tomcat-7-multi-core-apache-solr-47-installation-and-configuration-with-drupal-7
# https://drupal.stackexchange.com/questions/95897/apache-solr-4-6-0-installation-and-compatibility-with-drupal7/124038#124038
VERSION="4.10.3"
cd /opt
wget http://apache.petsads.us/lucene/solr/$VERSION/solr-$VERSION.tgz
tar -xvf solr-$VERSION.tgz
@tsabat
tsabat / jetty
Last active August 29, 2015 14:13 — forked from peterc/jetty
#!/usr/bin/env bash
#
# Startup script for jetty under *nix systems (it works under NT/cygwin too).
# To get the service to restart correctly on reboot, uncomment below (3 lines):
# ========================
# chkconfig: 3 99 99
# description: Jetty 7 webserver
# processname: jetty
# ========================
@tsabat
tsabat / fix.md
Created December 22, 2014 18:21
fix core audio

Add this to your ~/.bash_profile

function fixaudio() {
  sudo kill `ps -ax | grep 'coreaudiod' | grep 'sbin' |awk '{print $1}'`
}

then run