Skip to content

Instantly share code, notes, and snippets.


Joey Geiger jgeiger

View GitHub Profile
jgeiger / nginx.conf
Last active December 24, 2021 06:23
Nginx base config
View nginx.conf
user www-data;
worker_processes 2;
worker_rlimit_nofile 8192;
events {
worker_connections 4096;
multi_accept on;
use epoll;
jgeiger / sysctl.conf
Last active January 27, 2021 08:51
Tweaked sysctl.conf for ubuntu
View sysctl.conf
# /etc/sysctl.conf - Configuration file for setting system variables
# See /etc/sysctl.d/ for additional system variables.
# See sysctl.conf (5) for information.
#kernel.domainname =
# Uncomment the following to stop low-level messages on console
#kernel.printk = 3 4 1 3
jgeiger / monit.conf
Created August 11, 2014 04:50
Monit upstart script
View monit.conf
description "Monit service manager"
limit core unlimited unlimited
start on runlevel [2345]
stop on runlevel [!2345]
expect daemon
jgeiger / Makefile
Created January 28, 2016 15:49
Default Makefile for building Go projects including Docker containers
View Makefile
SHELL := /bin/bash
PKGS := $(shell go list ./... | grep -v /vendor)
EXECUTABLE := example
PKG := example
GIT_COMMIT := $(shell git rev-parse --short HEAD 2>/dev/null)
.PHONY: build test golint docs $(PROJECT) $(PKGS) vendor
jgeiger / timecapsule-handler
Created September 15, 2017 18:46 — forked from dgraziotin/timecapsule-handler
Script to automatically look for Apple TimeCapsule devices and mount/umount them under GNU/Linux. See for info and explanations.
View timecapsule-handler
# This program is free software. It comes without any warranty, to
# the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want
# To Public License, Version 2, as published by Sam Hocevar. See
# for more details.
# Version 3, enhanced for Ubuntu 13.X+, Fedora 19+, and similar distros.

Keybase proof

I hereby claim:

  • I am jgeiger on github.
  • I am jgeiger ( on keybase.
  • I have a public key whose fingerprint is 881A 1844 D71E 5741 C36E C5BD F733 E075 2CE8 36DF

To claim this, I am signing this object:

jgeiger / snippet.rb
Created April 22, 2011 18:56
using redis to reserve a set of records from a larger group
View snippet.rb
def find_for_curation(conditions, user_id)
RedisConnection.db.sadd('curators', user_id)
curator_ids = RedisConnection.db.smembers('curators')
curator_keys = { |id| "curator-#{id}" }
active_annotation_ids = RedisConnection.db.sunion(*curator_keys)
annotations = Annotation.where(conditions).where(" NOT IN (#{active_annotation_ids.to_in_query_string})").joins(:ontology_term).joins(:ontology).limit(15).order('')
annotations.each do |annotation|
View cronjob.text
# create a new cron job at and run it daily (which will be midnight)
/home/account/opt/bin/logrotate -f -s /home/account/opt/lib/logrotate.status /home/account/opt/etc/logrotate.conf
View .bashrc
export PATH=$HOME/.gems/bin:$HOME/opt/bin:$PATH
export GEM_HOME=$HOME/.gems
export RUBYLIB="$HOME/opt/lib:$RUBYLIB"
alias gem="nice -n19 ~/opt/bin/gem"
View visual_password_check.js
$("#new_user #user_password").passwordCheck();
jQuery.fn.passwordCheck = function() {
var pass = $(this[0]) // It's your element
var noofchar=/^.*(?=.{6,}).*$/;
var checkspace=/\s/;
var best=/^.*(?=.{6,})(?=.*[A-Z])(?=.*[\d])(?=.*[\W]).*$/;
var strong=/^[a-zA-Z\d\W_]*(?=[a-zA-Z\d\W_]{6,})(((?=[a-zA-Z\d\W_]*[A-Z])(?=[a-zA-Z\d\W_]*[\d]))|((?=[a-zA-Z\d\W_]*[A-Z])(?=[a-zA-Z\d\W_]*[\W_]))|((?=[a-zA-Z\d\W_]*[\d])(?=[a-zA-Z\d\W_]*[\W_])))[a-zA-Z\d\W_]*$/;
var weak=/^[a-zA-Z\d\W_]*(?=[a-zA-Z\d\W_]{6,})(?=[a-zA-Z\d\W_]*[A-Z]|[a-zA-Z\d\W_]*[\d]|[a-zA-Z\d\W_]*[\W_])[a-zA-Z\d\W_]*$/;
var bad=/^((^[a-z]{6,}$)|(^[A-Z]{6,}$)|(^[\d]{6,}$)|(^[\W_]{6,}$))$/;