Skip to content

Instantly share code, notes, and snippets.

View kenjij's full-sized avatar
👨‍💻
Hacking away...

Ken J. kenjij

👨‍💻
Hacking away...
View GitHub Profile
@kenjij
kenjij / clean-sidekiq-stats.sh
Created January 11, 2017 05:05
Clean up Sidekiq stats in Redis
redis-cli KEYS "Sidekiq:*:stat:processed:*" | xargs -n 100 redis-cli DEL
@kenjij
kenjij / CHANGELOG.md
Created December 29, 2016 09:12
A change log template

1.0.0 / Unreleased

Added

  • Version followed by release date.
  • Maintain "Unreleased" version in draft in preparation for release.
  • "Added" section for new features added.
  • MAJOR increment in semantic versioning would mean incompatible changes.

Changed

@kenjij
kenjij / slack_formatting.md
Created December 28, 2016 08:58
Slack message formatting to be used with their API

Slack Message Formatting Reference

Text Formatting

Basic Styles

Making a *bold statement.*
Emphasis with _italic text._
Let's ~strike out~ post this message.
@kenjij
kenjij / build.sh
Created November 17, 2016 18:53
Compiling Reactjs/JSX using Babel
# Usage:
# - Install npm
# - Configure package.json
# - Place source code in "src/"
# - Outputs to "app.js"
npm run build
@kenjij
kenjij / update.sh
Last active February 16, 2016 06:38
Create New Host from Ubuntu Backup Image
# Better to be root
sudo bash
# Change IP address (static)
nano /etc/network/interfaces
# Update hostnames
nano /etc/hostname
nano /etc/hosts
@kenjij
kenjij / textmate-fontsmoothing.sh
Created August 22, 2015 03:24
Font smoothing control in TextMate
# Change settings below if font renderings appear to thin or bold.
# 0: Always disabled.
# 1: Always enabled.
# 2: Disabled for dark themes.
# 3: Disabled for dark themes on high-DPI displays (default).
# Generaly, set the value to 1 if renderings appear too thin
defaults write com.macromates.TextMate.preview fontSmoothing 1
# Reset to default
@kenjij
kenjij / textmate-lineheight.sh
Created August 21, 2015 22:06
Line-height adjustment in TextMate
# This example will make Adobe Source Code Pro font look snug in TextMate.
# Adjust space above the line
defaults write com.macromates.TextMate.preview fontAscentDelta -float -2
# Adjust space below the line
defaults write com.macromates.TextMate.preview fontLeadingDelta -float 0
# Reset to default
defaults delete com.macromates.TextMate.preview fontAscentDelta
@kenjij
kenjij / gist:fd572a372096d47b3e41
Last active August 29, 2015 14:22
Installing RVM in OS X
# Install Homebrew; this will prompt you to install Xcode Command Line Developer Tools
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Agree to Xcode license; necessary for fresh install
$ sudo xcodebuild -license
# Install RVM
$ \curl -sSL https://get.rvm.io | bash -s stable
@kenjij
kenjij / geoip.sh
Last active April 20, 2025 07:13
Downloading free MaxMind GeoIP file, use with NGINX
# Download the legacy format for NGINX compatibility
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
# Unzip
gunzip Geo*.gz
# Copy to /usr/share/GeoIP/
cp Geo*.dat /usr/share/GeoIP/
@kenjij
kenjij / gist:cc93165babf1f3b4b040
Last active August 6, 2018 16:57
Secure and optimized NGINX SSL configuration
http {
# Shared cache size; 1MB = 4000 sessions
ssl_session_cache shared:SSL:10m;
# Decrease timeout if resources are low
ssl_session_timeout 10m;
# Good-bye SSL
ssl_protocols TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers ECDH+AESGCM:ECDH+AES256:ECDH+AES128:!ADH:!AECDH:!MD5;
# OCSP stapling