Skip to content

Instantly share code, notes, and snippets.

View asears's full-sized avatar

Andrew Sears asears

View GitHub Profile
@fernandoaleman
fernandoaleman / Linux Static IP
Created March 23, 2012 16:20
How To Configure Static IP On CentOS 6
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static
@rberrelleza
rberrelleza / UseServiceBusFromPowershell.ps1
Created March 27, 2012 23:55
Send and receive messages to a Service Bus queue via PowerShell
Import-Module "PATH_TO_Microsoft.ServiceBus.dll"
#Create the required credentials
$tokenProvider = [Microsoft.ServiceBus.TokenProvider]::CreateSharedSecretTokenProvider("owner", "YOUR_ISSUERSECRET")
$namespaceUri = [Microsoft.ServiceBus.ServiceBusEnvironment]::CreateServiceUri("sb", "YOUR_NAMESPACE", "");
$namespaceManager = New-Object Microsoft.ServiceBus.NamespaceManager $namespaceUri,$tokenProvider
#Create a queue
$queue = $namespaceManager.CreateQueue("MyPowershellQueue");
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active June 2, 2024 11:04
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@minrk
minrk / Retina Figures.ipynb
Created August 9, 2012 04:37
2x plots for Retina displays with matplotlib and the IPython Notebook
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bockel
bockel / parse-aup.sh
Created September 19, 2012 20:54
Parse audio track times from an audacity .aup project
#!/bin/sh
# Parse audio track times from an audacity .aup project
# Copyright (C) 2012 William Heinbockel <heinbockel@redhat.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
@mbostock
mbostock / .block
Last active March 1, 2024 06:07
The Gist to Clone All Gists
license: gpl-3.0
@NeoCat
NeoCat / honeywell_set_temp.sh
Last active August 22, 2022 14:17
Set temperature of honeywell Wi-Fi thermostat by shell script
#!/bin/bash
# Usage: ./honeywell_settmp.sh [-c|-h|-o] [<temp(F)>|schedule]
# Example: ./honeywell_settmp.sh -h 72 # set HEAT: temp=72F
# ./honeywell_settmp.sh -c schedule # set COOL: follow shceduled temp
# ./honeywell_settmp.sh -o # turn system OFF
######## Settings ########
LOGIN="YOUR_MAIL_ADDRESS"
PASSWORD="YOUR_PASSWORD"
@miguelgrinberg
miguelgrinberg / rest-server.py
Last active March 29, 2024 09:05
The code from my article on building RESTful web services with Python and the Flask microframework. See the article here: http://blog.miguelgrinberg.com/post/designing-a-restful-api-with-python-and-flask
#!flask/bin/python
from flask import Flask, jsonify, abort, request, make_response, url_for
from flask_httpauth import HTTPBasicAuth
app = Flask(__name__, static_url_path = "")
auth = HTTPBasicAuth()
@auth.get_password
def get_password(username):
if username == 'miguel':
@ralphbean
ralphbean / list-all-repos.py
Created June 7, 2013 23:17
Script to list all repos for a github organization
#!/usr/bin/env python
""" Print all of the clone-urls for a GitHub organization.
It requires the pygithub3 module, which you can install like this::
$ sudo yum -y install python-virtualenv
$ mkdir scratch
$ cd scratch
$ virtualenv my-virtualenv
@airawat
airawat / 00-OozieCoordinatorJobWithDatasetCreationAsTrigger
Last active May 21, 2021 16:09
Sample Oozie coordinator job that executes upon availability of a specified dataset. Includes scripts/code, sample data, commands.
This gist includes components of a oozie, dataset availability initiated, coordinator job -
scripts/code, sample data and commands; Oozie actions covered: hdfs action, email action,
sqoop action (mysql database); Oozie controls covered: decision;
Usecase
-------
Pipe report data available in HDFS, to mysql database;
Pictorial overview of job:
--------------------------