Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Frank Rietta rietta

🏠
Working from home
View GitHub Profile
@sealocal
sealocal / yarn.config
Last active Apr 4, 2020
Install Yarn and NodeJS on AWS Elastic Beanstalk EC2 Instance with Amazon Linux Ruby Platform, prior to precompiling assets for a Rails app
View yarn.config
files:
# If this file is edited, it must be removed from EC2 instance prior to deploy.
"/opt/elasticbeanstalk/hooks/appdeploy/pre/09_yarn_install.sh" :
mode: "000775"
owner: root
group: users
content: |
#!/usr/bin/env bash
set -xe
@brandondees
brandondees / authentication_token.rb
Created Sep 17, 2015
Stronger Authentication Tokens
View authentication_token.rb
# == 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
chaimpeck / Sample a Motorola SB6121 Surfboard's Signal
Created Aug 21, 2015
This script is meant to be run with the Motorola SB6121 Surfboard Modem.
View Sample a Motorola SB6121 Surfboard's Signal
#!/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
bhumphrey / gist:3764983
Created Sep 22, 2012
Cherry-picking from another fork
View gist:3764983
git checkout <branch>
git fetch <other-fork-alias>
git cherry-pick <commit-hash>
git push <your-fork-alias>
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active Jan 25, 2021
Useful PostgreSQL Queries and Commands
View postgres_queries_and_commands.sql
-- 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
gingerlime / change_db_owner.sh
Created Apr 24, 2012
Postgresql - Changing ownership on all tables
View change_db_owner.sh
#!/bin/bash
usage()
{
cat << EOF
usage: $0 options
This script set ownership for all table, sequence and views for a given database
Credit: Based on http://stackoverflow.com/a/2686185/305019 by Alex Soto
@juniorz
juniorz / import.rb
Created Jan 5, 2012 — forked from ngauthier/import.rb
Import a blogger archive to jekyll (octopress version)
View import.rb
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 = File.read ARGV[0]