Skip to content

Instantly share code, notes, and snippets.

Marco Lovato lovato

Block or report user

Report or block lovato

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View linuxsetup.sh
#!/bin/bash
set -e
set -x
# Root Access
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi
@lovato
lovato / auto-virtualenv.sh
Created Apr 1, 2014
Script to help switching automatically from a virtualenv to another
View auto-virtualenv.sh
# --- activate a virtualenv without the need of going through a series of
# paths
function venv { source $WORKON_HOME/$1/bin/activate; }
# --- create a virtualenv
function mkenv { virtualenv $WORKON_HOME/$1; venv $1; echo "$1" > ./.venv; }
# --- automagically load virtualenvs, based on the ".venv" file in the directory
# -- search for the ".venv" from the current directory and, if it can't be found,
View .gitconfig
[user]
email = <your email>
name = <your name>
[gitreview]
username = <your username>
[alias]
newf = !bash -c 'git checkout -b feature/$0'
uploadf = !bash -c 'git push origin `git rev-parse --abbrev-ref HEAD`'
updatef = !bash -c 'git fetch && git merge master --no-ff'
gof = !bash -c 'git checkout feature/$0'
@lovato
lovato / video4roku
Last active Dec 29, 2015
Script used to convert any video to a AVC AAC Roku compatible format.
View video4roku
echo Video4Roku Converter 1.0 by @maglovato
echo --------------------------------------
filename=$(basename "$1")
extension="${filename##*.}"
filename="${filename%.*}"
#avconv -i "$1" -c:v libx264 -c:a libvo_aacenc "/tmp/$filename.mp4"
avconv -i "$1" -c:v libx264 -c:a aac -strict experimental "/tmp/$filename.mp4"
@lovato
lovato / java-reinstall.sh
Last active Dec 26, 2015
Wipe out Java from Ubuntu, and then fresh install it back.
View java-reinstall.sh
#
#http://askubuntu.com/questions/84483/how-to-completely-uninstall-java
#
java_version=`java -version 2>&1 | head -n 1 | awk -F"\"" '{print $2}'`
#Remove all the Java related packages (Sun, Oracle, OpenJDK, IcedTea plugins, GIJ):
sudo apt-get update
apt-cache search java | awk '{print($1)}' | grep -E -e '^(ia32-)?(sun|oracle)-java' -e '^openjdk-' -e '^icedtea' -e '^(default|gcj)-j(re|dk)' -e '^gcj-(.*)-j(re|dk)' -e 'java-common' | xargs sudo apt-get -y remove
sudo apt-get -y autoremove
You can’t perform that action at this time.