Skip to content

Instantly share code, notes, and snippets.

View debuggerboy's full-sized avatar
:octocat:
I may be slow to respond

debuggerboy debuggerboy

:octocat:
I may be slow to respond
View GitHub Profile
@debuggerboy
debuggerboy / sangoma.sh
Created July 1, 2012 14:09 — forked from tony-landis/sangoma.sh
Automate installation of dahdi, libpri, sangoma, and all deps on debian
#!/bin/bash
DA='dahdi-linux-complete-2.5.0.1+2.5.0.1'
WAN="wanpipe-3.5.23"
PRI="libpri-1.4.12"
apt-get -y install build-essential
apt-get -y install gcc
apt-get -y install g++
apt-get -y install automake
@debuggerboy
debuggerboy / nginx_serverblocks_cfg
Created October 6, 2012 22:06
ERROR :: nginx virtual host configuration
# nginx 0.7.65
# You may add here your
# server {
# ...
# }
# statements for each of your virtual hosts
server {
listen 80; ## listen for ipv4; this line is default and implied
listen [::]:80 default ipv6only=on; ## listen for ipv6
@debuggerboy
debuggerboy / panasonic_P11_kernel_version.txt
Created March 5, 2014 19:56
Panasonc P11 Android 4.1.2 Kernel version
u0_a82@android:/ $ cat /proc/version
Linux version 3.4.0-perf-gf1371cb-00009-gd6ca730-dirty (ccadmin@BUILD12) (gcc version 4.6.x-google 20120106 (prerelease) (GCC) ) #1 SMP PREEMPT Wed Oct 30 14:50:10 CST 2013
u0_a82@android:/ $
@debuggerboy
debuggerboy / playing_with_remote_origin.txt
Created November 16, 2014 12:41
fool around with git remote origin
Already have a Git repository on your computer?
$ cd /path/to/existing/repo
$ git remote add origin https://<username>@github.com/<username>/<new_github_repo_created>.git
$ git push -u origin --all # pushes up the repo and its refs for the first time
$ git push -u origin --tags # pushes up any tags
To add a Remote Repo with other name - for ex: "gitbub"
git remote add github https://<username>@github.com/<username>/<new_github_repo_created>.git
@debuggerboy
debuggerboy / app.py
Last active March 13, 2018 18:15 — forked from leplatrem/app.py
Simple Flask-couchdb demo
import simplejson
from flask import Flask, g, request
from couchdb.design import ViewDefinition
import flaskext.couchdb
app = Flask(__name__)
"""
CouchDB permanent view
@debuggerboy
debuggerboy / static_dir_to_root_flask.txt
Created September 6, 2015 09:13
Serving Static Files From Root “/” and not “/static” Using Flask
There’s some discussion about how to do this here, involving Werkzeug’s middleware.
http://stackoverflow.com/questions/4239825/static-files-in-flask-robot-txt-sitemap-xml-mod-wsgi
This is another way to do it, assuming you have a folder called “static” under where the main application .py file is located:
from flask import Flask, request
app = Flask(__name__, static_url_path='')
@app.route('/')
def root():
@debuggerboy
debuggerboy / rsa-_host_fingerprint.txt
Created September 6, 2015 10:53
Get the SSH RSA HOST Fingerprint
for file in ~anish/.ssh/id_rsa.pub ; do ssh-keygen -lf $file; done
@debuggerboy
debuggerboy / aws_autoscaling_cron.rb
Created April 1, 2017 09:46 — forked from kixorz/aws_autoscaling_cron.rb
Running cron jobs in AWS Auto Scaling group is tricky. When you deploy the same code and configuration to all instances in the group, cron job would run on all of them. You may not want that. This script detects the first instance in the group and allows only this instance to run the job. IAM user used by this script needs to have permissions to…
#!/usr/bin/env ruby
require 'syslog'
require 'net/http'
require 'aws-sdk'
Syslog.open
AWS.config({
:access_key_id => '<iam user key>',
:secret_access_key => '<iam user secret>'
@debuggerboy
debuggerboy / digitalocean_coreos_docker_b4update.txt
Created July 30, 2017 06:54
Digitalocean CoreOS Docker Version 2016 before update
Client:
Version: 1.12.6
API version: 1.24
Go version: go1.7.5
Git commit: a82d35e
Built: Tue Jul 18 23:18:48 2017
OS/Arch: linux/amd64
Server:
Version: 1.12.6
version: "3.2"
services:
nginx:
container_name: local-dev-web
image: nginx:latest
networks :
- local-devnet
ports:
- "80:80"