Skip to content

Instantly share code, notes, and snippets.

View eugenius1's full-sized avatar

Eusebius Ngemera eugenius1

View GitHub Profile
@eugenius1
eugenius1 / gitpush.sh
Created May 17, 2016 14:15
Git commands: add all, commit with a custom message, and a push
#! /bin/sh
git status;
echo '\ntype your commit message to proceed with pushing new changes, or \033[31m"n" to abort\033[39m'
# \033 or \x1B or \e
read CommitMessage;
if [ "$CommitMessage" != "n" ] && [ "$CommitMessage" != "" ] && [ "$CommitMessage" != "N" ]
then
git add . && git commit -m "'$CommitMessage'" && git push
#https://en.wikipedia.org/wiki/Python_syntax_and_semantics#Easter_eggs
from __future__ import braces
import this
import __hello__
import antigravity
@eugenius1
eugenius1 / fix_newline_errors.py
Created April 1, 2016 02:25
Fixes error due to missing new lines in Linux (Ubuntu) directory /var/lib/dpkg/info
#!/usr/bin/python
# updated 11th February 2016 by Eusebius Ngemera to use 'with' for file I/O
# 8th November, 2009
# update manager failed, giving me the error:
# 'files list file for package 'xxx' is missing final newline' for every package.
# some Googling revealed that this problem was due to corrupt files(s) in /var/lib/dpkg/info/
# looping though those files revealed that some did not have a final new line
# this script will resolve that problem by appending a newline to all files that are missing it
# NOTE: you will need to run this script as root, e.g. sudo python newline_fixer.py
@eugenius1
eugenius1 / REBOOT_Android.bat
Created September 25, 2015 00:59
Windows script to reboot an Android device via adb
@ECHO OFF
CD /D "C:\Users\Username\AppData\Local\Android\sdk\platform-tools"
adb reboot
echo rebooting..
PAUSE