Skip to content

Instantly share code, notes, and snippets.

View rietta's full-sized avatar
Working from home

Frank Rietta rietta

Working from home
View GitHub Profile
sealocal / yarn.config
Last active May 14, 2021 12:16
Install Yarn and NodeJS on AWS Elastic Beanstalk EC2 Instance with Amazon Linux Ruby Platform, prior to precompiling assets for a Rails app
# If this file is edited, it must be removed from EC2 instance prior to deploy.
"/opt/elasticbeanstalk/hooks/appdeploy/pre/" :
mode: "000775"
owner: root
group: users
content: |
#!/usr/bin/env bash
set -xe
brandondees / authentication_token.rb
Created September 17, 2015 20:06
Stronger Authentication Tokens
# == Schema Information
# Table name: authentication_tokens
# created_at :datetime
# expires_at :datetime
# hashed_token :string(255)
# id :integer not null, primary key
# ip_address :string(255)
# updated_at :datetime
chaimpeck / Sample a Motorola SB6121 Surfboard's Signal
Created August 21, 2015 00:28
This script is meant to be run with the Motorola SB6121 Surfboard Modem.
#!/usr/bin/env python
"""Sample the modem's signal
This script is meant to be run with the Motorola SB6121 Surfboard Modem.
If you run it on a different modem, it might not work, but it's worth a try...
It should be run as a cron job, every minute (or whatever interval you'd like)
into a text file. The file can later be used by a json parser to analyze the
signal over time, which can be used to come to conclusions that you can argue
bhumphrey / gist:3764983
Created September 22, 2012 03:10
Cherry-picking from another fork
git checkout <branch>
git fetch <other-fork-alias>
git cherry-pick <commit-hash>
git push <your-fork-alias>
rgreenjr / postgres_queries_and_commands.sql
Last active April 19, 2024 07:21
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
gingerlime /
Created April 24, 2012 19:32
Postgresql - Changing ownership on all tables
cat << EOF
usage: $0 options
This script set ownership for all table, sequence and views for a given database
Credit: Based on by Alex Soto
juniorz / import.rb
Created January 5, 2012 10:15 — forked from ngauthier/import.rb
Import a blogger archive to jekyll (octopress version)
require 'rubygems'
require 'nokogiri'
require 'fileutils'
require 'date'
require 'uri'
# usage: ruby import.rb my-blog.xml
# my-blog.xml is a file from Settings -> Basic -> Export in blogger.
data = ARGV[0]