Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
echo ">>> Starting Install Script"
# Update
sudo apt-get update
echo ">>> Installing Base Items"
# Install base items
#!/usr/bin/env bash
echo ">>> Starting Install Script"
# Update
sudo apt-get update
echo ">>> Installing Base Items"
# Install base items
@skiold
skiold / gist:8010009
Created December 17, 2013 18:22 — forked from oremj/gist:388608
#!/bin/bash
#
# chkconfig: 35 68 38
# description: Starts celeryd
#
# @author Jeremy Orem <oremj@mozilla.com>
# @author Dave Dash <dd@mozilla.com>
#
DJANGO_PROJECT_DIR=/data/amo_python/www/preview/zamboni
mkdir download /tmp/installdir; cd download;
curl -LO http://python.org/ftp/python/2.7.6/Python-2.7.6.tgz
tar xf Python-2.7.6.tgz
cd Python-2.7.6
yum -y install openssl-devel readline-devel bzip2-devel sqlite-devel zlib-devel ncurses-devel db4-devel expat-devel
./configure --prefix=/usr/local --enable-unicode=ucs4 --enable-shared --enable-ipv6
make -j2
make install DESTDIR=/tmp/installdir
echo '/sbin/ldconfig' > /tmp/installdir/run-ldconfig.sh
fpm -s dir -t rpm -n python27 -v 2.7.6 -C /tmp/installdir \
@skiold
skiold / answer.md
Last active August 29, 2015 14:21 — forked from non/answer.md

What is the appeal of dynamically-typed languages?

Kris Nuttycombe asks:

I genuinely wish I understood the appeal of unityped languages better. Can someone who really knows both well-typed and unityped explain?

I think the terms well-typed and unityped are a bit of question-begging here (you might as well say good-typed versus bad-typed), so instead I will say statically-typed and dynamically-typed.

I'm going to approach this article using Scala to stand-in for static typing and Python for dynamic typing. I feel like I am credibly proficient both languages: I don't currently write a lot of Python, but I still have affection for the language, and have probably written hundreds of thousands of lines of Python code over the years.

@skiold
skiold / tmux.md
Created November 26, 2015 08:23 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

These are only examples, for a few very common actions. You are expected to write your own rules for the rest. The syntax is regular JavaScript, but see the polkit(8) manpage for the object structure and available API.

  • If you don't know the action name, run pkaction:

    pkaction | grep cups
    
  • The possible results are YES, AUTH_SELF(_KEEP), AUTH_ADMIN(_KEEP), NO. Returning a result is final. Returning null will continue checking other rules.

  • Put your rules in /etc/polkit-1/rules.d/*.rules. (You can check everything in one giant addRule, or you can have a separate file and separate addRule for each program; it doesn't matter.)

@skiold
skiold / haproxy.conf
Last active March 16, 2016 09:05 — forked from nateware/haproxy.conf
HAProxy sample config for EC2
#
# This config file is a combination of ideas from:
# http://www.37signals.com/svn/posts/1073-nuts-bolts-haproxy
# http://www.igvita.com/2008/05/13/load-balancing-qos-with-haproxy/
# http://wiki.railsmachine.com/HAProxy
# http://elwoodicious.com/2008/07/15/nginx-haproxy-thin-fastcgi-php5-load-balanced-rails-with-php-support/
# http://upstream-berlin.com/2008/01/09/using-haproxy-with-multiple-backends-aka-content-switching/
# http://wiki.railsmachine.com/HAProxy
# http://gist.github.com/raw/25482/d39fb332edf977602c183194a1cf5e9a0b5264f9
#
import Options.Applicative
import Control.Monad
parser :: Parser (IO ())
parser = subparser $
command "add" (info (helper <*> addMode) mempty)
<> command "test" (info (pure $ putStrLn "testing") mempty)
where
addMode :: Parser (IO ())
addMode = subparser $
@skiold
skiold / curl-ttfb.sh
Created August 16, 2016 21:11 — forked from acdha/curl-ttfb.sh
Use curl to measure and report HTTP response times (pre-, start- and total transfer)
#!/bin/bash
#
# Report time to first byte for the provided URL using a cache buster to ensure
# that we're measuring full cold-cache performance
while (($#)); do
echo $1
curl -so /dev/null -H "Pragma: no-cache" -H "Cache-Control: no-cache" \
-w "%{http_code}\tPre-Transfer: %{time_pretransfer}\tStart Transfer: %{time_starttransfer}\tTotal: %{time_total}\tSize: %{size_download}\n" \
"$1?`date +%s`"