Skip to content

Instantly share code, notes, and snippets.

View chadmccathie's full-sized avatar

Chad McCathie chadmccathie

  • Deckard Technologies
  • Sydney
View GitHub Profile
@sergeyklay
sergeyklay / sed-cheatsheet.md
Last active June 5, 2024 19:51
Sed Cheatsheet

Sed Cheat Sheet

Sed command line options

sed [options] sed-command [input-file]
Option Description Example
@LeCoupa
LeCoupa / bash-cheatsheet.sh
Last active November 2, 2024 18:03
Bash CheatSheet for UNIX Systems --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@PowerWagon
PowerWagon / logstash-bootstrap.sh
Last active October 4, 2015 21:19
Logstash 1.4.0 install script for Centos/OEL/RHEL 6.5
#!/bin/bash
# Created Fri Mar 22 2014
# This is an indirect fork of https://gist.github.com/SeonghoonKim/4378896
# Most of it was reworked from http://blog.basefarm.com/blog/how-to-install-logstash-with-kibana-interface-on-rhel/
# This script will download, install and start
# the following items on CentOS 6.5:
# OpenJDK 1.7.0
# cURL
# ElasticSearch 1.0.1
# Logstash server 1.4.0
@ryansobol
ryansobol / gist:5252653
Last active September 5, 2024 20:55
15 Questions to Ask During a Ruby Interview

Originally published in June 2008

When hiring Ruby on Rails programmers, knowing the right questions to ask during an interview was a real challenge for me at first. In 30 minutes or less, it's difficult to get a solid read on a candidate's skill set without looking at code they've previously written. And in the corporate/enterprise world, I often don't have access to their previous work.

To ensure we hired competent ruby developers at my last job, I created a list of 15 ruby questions -- a ruby measuring stick if you will -- to select the cream of the crop that walked through our doors.

What to expect

Candidates will typically give you a range of responses based on their experience and personality. So it's up to you to decide the correctness of their answer.

@alobato
alobato / start-stop-example.sh
Created March 3, 2012 23:09
start-stop-example
#!/bin/sh
# Quick start-stop-daemon example, derived from Debian /etc/init.d/ssh
set -e
# Must be a valid filename
NAME=foo
PIDFILE=/var/run/$NAME.pid
#This is the command to be run, give the full pathname
DAEMON=/usr/local/bin/bar
@nherment
nherment / backup.sh
Created February 29, 2012 10:42
Backup and restore an Elastic search index (shamelessly copied from http://tech.superhappykittymeow.com/?p=296)
#!/bin/bash
# herein we backup our indexes! this script should run at like 6pm or something, after logstash
# rotates to a new ES index and theres no new data coming in to the old one. we grab metadatas,
# compress the data files, create a restore script, and push it all up to S3.
TODAY=`date +"%Y.%m.%d"`
INDEXNAME="logstash-$TODAY" # this had better match the index name in ES
INDEXDIR="/usr/local/elasticsearch/data/logstash/nodes/0/indices/"
BACKUPCMD="/usr/local/backupTools/s3cmd --config=/usr/local/backupTools/s3cfg put"
BACKUPDIR="/mnt/es-backups/"
YEARMONTH=`date +"%Y-%m"`