Skip to content

Instantly share code, notes, and snippets.


Jason Ashby snobear

View GitHub Profile
View Podfile
# When using RN in combination with Cocoapods, a lot of
# things are broken. These are the fixes we had to append
# to our Podfile when upgrading to ReactNative@0.55.3.
# WARNING: Check those line numbers when you're on a different version!
def change_lines_in_file(file_path, &change)
print "Fixing #{file_path}...\n"
contents = []
h0tw1r3 / syslog-ng.conf
Created Oct 22, 2017
Syslog-ng 3.6.4 configuration
View syslog-ng.conf
@include "scl.conf"
options {
dnmellen /
Created Jan 31, 2017
AWS Lambda function that performs an ssh command through a bastion server to another server. The function will be triggered by a Cloudwatch Alarm
import json
import boto3
import paramiko
def worker_handler(event, context):
esrever10 /
Last active May 4, 2021
gstreamer send and receive h264 rtp stream
# linux send h264 rtp stream:
gst-launch-1.0 -v ximagesrc ! video/x-raw,framerate=20/1 ! videoscale ! videoconvert ! x264enc tune=zerolatency bitrate=500 speed-preset=superfast ! rtph264pay ! udpsink host= port=5000
# Macos send h264 rtp stream:
gst-launch-1.0 -v avfvideosrc capture-screen=true ! video/x-raw,framerate=20/1 ! videoscale ! videoconvert ! x264enc tune=zerolatency bitrate=500 speed-preset=superfast ! rtph264pay ! udpsink host= port=5000
# receive h264 rtp stream:
gst-launch-1.0 -v udpsrc port=5000 caps = "application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96" ! rtph264depay ! decodebin ! videoconvert ! autovideosink
lfepp /
Last active Aug 21, 2020
Script to create a number of recurring maintenance windows in PagerDuty
#!/usr/bin/env python
# Copyright (c) 2016, PagerDuty, Inc. <>
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
joseluisq /
Last active May 10, 2021
Add Git Branch Name to Terminal Prompt (Linux/Mac)

Add Git Branch Name to Terminal Prompt (Linux/Mac)


Open ~/.bash_profile in your favorite editor and add the following content to the bottom.

# Git branch in prompt.

parse_git_branch() {
snobear /
Last active Jun 21, 2019
script to cancel all pulp tasks
# Cancel all pulp tasks that are just in a specifiedstate
read -p "Enter task state to kill, e.g. Waiting: " ans
echo ""
if [ "${#ans}" -gt 0 ]
drscream /
Last active Nov 10, 2015
Simple script to download the `last-modified` file from PyPI mirror and check if it's up-to-date.
# Thomas Merkel <>
# Check PyPI mirror with nagios
PROGPATH=$(echo ${0} | sed -e 's,[\\/][^\\/][^\\/]*$,,')
source ${PROGPATH}/
# Function to print help

Build a scalable Twitter clone with Django and

In this tutorial we are going to build a Twitter clone using Django and, a hosted API for newsfeed development.

We will show you how easy is to power your newsfeeds with For brevity we leave out some basic Django-specific code and recommend you refer you to the Github project for the complete runnable source code. At the end of this tutorial we will have a Django app with a profile feed, a timeline feed, support for following users, hashtags and mentions.

I assume that you are familiar with Django. If you're new to Django the [official tutorial] ( explains it very well.

simlegate / custom-error-page
Created Oct 31, 2014
Nginx return custom json
View custom-error-page
error_page 400 404 405 =200 @40*_json;
location @40*_json {
default_type application/json;
return 200 '{"code":"1", "message": "Not Found"}';
error_page 500 502 503 504 =200 @50*_json;
location @50*_json {