Skip to content

Instantly share code, notes, and snippets.

@arteezy
arteezy / puma.service
Last active April 23, 2024 00:31
Manage Puma with systemd and rbenv
[Unit]
Description=Puma Rails Server
After=network.target
[Service]
Type=simple
User=deploy
WorkingDirectory=/home/deploy/app/current
ExecStart=/home/deploy/.rbenv/bin/rbenv exec bundle exec puma -C /home/deploy/app/shared/config/puma.rb
ExecStop=/home/deploy/.rbenv/bin/rbenv exec bundle exec pumactl -S /home/deploy/app/shared/tmp/pids/puma.state stop
@jeffweiss
jeffweiss / mix.exs
Last active December 18, 2018 23:13
Retrieving application version number in mix.exs from git describe
defmodule MyApp.Mixfile do
use Mix.Project
def project do
[app: :my_app,
version: get_version,
elixir: "~> 1.0",
elixirc_paths: elixirc_paths(Mix.env),
compilers: Mix.compilers,
build_embedded: Mix.env == :prod,
@chrislaskey
chrislaskey / flask_application.wsgi
Created February 23, 2013 21:49
Example of a basic .WSGI template for Python Flask deployments using Apache with Mod_WSGI
#!/usr/bin/env python
# Adding the current directory to the Python path is easy:
import os
import sys
this_dir = os.path.dirname(__file__)
sys.path.insert(0, this_dir)
# Now that the Python path includes the current directory, any
# application specific modules can be loaded just like this was
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active April 19, 2024 11:00
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@chrislaskey
chrislaskey / iptables.rules
Created January 15, 2013 21:37
Example generic iptable rules file for forwarding traffic from port 80 to port 8080, used in this case for configuring Jenkins/Hudson to run on port 80. Initial commit is the default iptable rules' output from `iptables-save > /etc/iptables.up.rules` on Ubuntu Server 12.04. The revised commit are the updated rules to forward traffic from port 80…
## Filter Table
*filter
:INPUT ACCEPT [971:197590]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [95:9682]
-A INPUT -i eth0 -p tcp --dport 80 -j ACCEPT
-A INPUT -i eth0 -p tcp --dport 8080 -j ACCEPT
COMMIT
@MicahElliott
MicahElliott / colortrans.py
Created November 29, 2010 07:57
Convert values between RGB hex codes and xterm-256 color codes.
#! /usr/bin/env python
""" Convert values between RGB hex codes and xterm-256 color codes.
Nice long listing of all 256 colors and their codes. Useful for
developing console color themes, or even script output schemes.
Resources:
* http://en.wikipedia.org/wiki/8-bit_color
* http://en.wikipedia.org/wiki/ANSI_escape_code