Skip to content

Instantly share code, notes, and snippets.

View Brainiarc7's full-sized avatar

Dennis E. Mungai Brainiarc7

View GitHub Profile

rage-quit support for bash

HOW TO INSTALL

Put flip somewhere in your $PATH and chmod a+x it.

Copy fuck into ~/.bashrc.

from osgeo import gdal
import os
layer_dict = {"reli":"reliability", "qual":"Quality", "ndvi":"NDVI", "evi":"EVI"}
def print_data(layer, data):
print data
print "data:", layer
print "type:", data.dtype
print "mean:", data.mean()
#!/bin/bash
#backup studio project files
#ignore build/ dir
SRC_DIR="/home/james/AndroidStudioProjects/"
DEST_DIR="/run/media/james/tank/Backups/studio/"
cd $SRC_DIR
@Brainiarc7
Brainiarc7 / PKGBUILD
Created August 17, 2014 00:23
Correct PKGBUILD for libeap on Arch Linux
pkgname=libeap
pkgver=1.5.1
pkgrel=2
pkgdesc="WiMAX EAP Library"
arch=('i686' 'x86_64')
url="http://linuxwimax.org"
license=('BSD')
depends=('openssl')
source=('http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/net-wireless/wpa_supplicant/files/wpa_supplicant-0.7.3-generate-libeap-peer.patch'
'http://hostap.epitest.fi/releases/wpa_supplicant-0.7.3.tar.gz')
@Brainiarc7
Brainiarc7 / flite-PKGBUILD
Created August 17, 2014 01:16
This gist contains a PKGBUILD for the flite package on Arch Linux. Fixed to prevent build errors on Arch.
# Maintainer: Dennis Mungai <dmngaie@gmail.com>
pkgname=flite
pkgver=1.9.0
pkgrel=1
pkgdesc="A lighweight speech synthesis engine (text to speech)"
arch=('i686' 'x86_64')
url="http://cmuflite.org"
license=('custom')
depends=('alsa-lib')
@Brainiarc7
Brainiarc7 / deis.yaml
Created August 21, 2014 07:35
Deploy a CoreOS cluster that tracks the Stable channel on Rackspace
heat_template_version: 2013-05-23
description: Deploy a CoreOS cluster that tracks the Stable Channel
parameters:
count:
description: Number of CoreOS machines to deploy
type: number
default: 3
constraints:
@Brainiarc7
Brainiarc7 / Automated-Cloud-OpenELEC-Build-Script.sh
Created January 9, 2015 01:25
Automated script for OpenELRC builds on a VPC instance
#!/bin/bash
# Outer loop for build and image
while :
do
# Inner loop for git pull
while :
do
GIT=$(git pull)
echo $GIT
if [ "$GIT" = 'Already up-to-date.' ]
@Brainiarc7
Brainiarc7 / nvidia-upgrade-fix
Created February 4, 2015 06:06
Fixing NVIDIA 346 upgrade on Ubuntu 14.04LTS
If you are upgrading from NVIDIA 340 to NVIDIA 346+ on Ubuntu 14.04LTS, do this to fix dkms build issues:
1. Remove the NVIDIA 340 dpkg configuration files after the upgrade:
sudo rm /var/lib/dpkg/info/nvidia-340*
2. Reconfigure the newly upgraded driver:
sudo dpkg-reconfigure nvidia-340
@Brainiarc7
Brainiarc7 / GPU toggle NVIDIA and Intel
Created February 10, 2015 09:30
Toggle the NVIDIA GPU on and off as needed in Optimus
Turn on the NVIDIA discrete GPU on an Optimus system for use when needed:
tee /proc/acpi/bbswitch <<< ON
Turn off the NVIDIA discrete GPU on an Optimus system when unloaded:
tee /proc/acpi/bbswitch <<< OFF
#!/bin/bash
# Dirty script to build Unity under ArchLinux
# Thanks for PKGBUILDs, chenxiaolong!
# Valdos Sine <fat0troll at riseup dot net> 2012
# Pratik Sinha <pratik at humbug dot in> 2012
echo "Run it in directory which will be build root ;)"
echo "Make sure you're have sudo without password or you will stuck in every package installation"
echo "GO!"
sudo pacman -Sy