Skip to content

Instantly share code, notes, and snippets.

View voor's full-sized avatar
🐢
it's pronounced turtle cuddle

Robert Van Voorhees voor

🐢
it's pronounced turtle cuddle
View GitHub Profile
module.exports = angular.module('com.good.company.directive', []);
angular.module('com.good.company.directive')
.directive('myDirective', [
// directive definition ...
]);
@voor
voor / install-java-8.sh
Last active July 5, 2018 17:22
Install Oracle Java 8 RPM
## You need to sudo this script, as it will install RPMs and run alternatives.
## You must accept the Oracle Binary Code License Agreement for Java SE to download this software.
## Read more here: http://www.oracle.com/technetwork/java/javase/terms/license/index.html
curl -L -H "Cookie: gpw_e24=xxx; oraclelicense=accept-securebackup-cookie;" http://download.oracle.com/otn-pub/java/jdk/8u74-b02/jdk-8u74-linux-x64.rpm -o /tmp/jdk-8-linux-x64.rpm && \
yum install -y /tmp/jdk-8-linux-x64.rpm && \
rm -rf /tmp/jdk-8-linux-x64.rpm
## OpenJDK started using 18000XX as their priority, so kick it up to 2 million to surpass them.
## java ##
@voor
voor / create-database-user.sh
Last active August 29, 2015 14:22
Create MySQL Database and User
# Adopted from http://jetpackweb.com/blog/2009/07/20/bash-script-to-create-mysql-database-and-user/
# Replace $mysqlroot with root password
# Replace $dbname with database name
# Replace $dbuser with database user
# Replace $dbpasswd with password
mysql -u root -p$mysqlroot <<-EOF
CREATE DATABASE $dbname;
GRANT ALL PRIVILEGES ON $database.* TO '$dbuser'@'localhost' \
IDENTIFIED BY '$dbpasswd';
FLUSH PRIVILEGES;
@voor
voor / copy-to-folder.sh
Last active August 29, 2015 14:22
Empty Maven Settings File
# If you've never run maven this folder doesn't exist yet.
mkdir ~/.m2
# Provided from https://gist.github.com/voor/3b86d9dbea77d1d094fe#file-settings-xml
wget -o ~/.m2/settings.xml https://gist.githubusercontent.com/voor/3b86d9dbea77d1d094fe/raw/73dc13028f617fc86a28819cdd919c13d9f0a360/settings.xml
#!/bin/sh
# We run the first part twice, since the first time it's going to output a bunch of maven log stuff.
mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | grep -v '\[' | grep -v 'Downloading:' | sed s/-SNAPSHOT//
export VERSION=`mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | grep -v '\[' | grep -v 'Downloading:' | sed s/-SNAPSHOT//`
git checkout master
mvn release:update-versions -DdevelopmentVersion=$VERSION-development-SNAPSHOT # The version in master should already be something similar, $VERSION-SNAPSHOT
git commit -a -m "Updated development version to $VERSION-development-SNAPSHOT"
git checkout development
git merge master -m "Merging development version into development."
git checkout -b $VERSION-SNAPSHOT-version
@voor
voor / make-kiosk.sh
Created March 17, 2017 12:14
Configuring Kiosk Mode on CentOS
#!/bin/bash
# KIOSK generator for Scientific Linux and CentOS (versions 5; 6 and 7)
# Created using Scientific Linux
# Wasn't made and never tested on different distros than SL/CentOS/EL!
# Version 1.4 for i386 and x86_64
#
# Feel free to contact me: marcin@marcinwilk.eu
# www.marcinwilk.eu
# Marcin Wilk
@voor
voor / update-atom.sh
Last active March 24, 2017 15:29
Check atom for latest release and update it if one exists.
#!/usr/bin/env sh
set -e
command -v jq >/dev/null 2>&1 || { echo >&2 "I require jq but it's not installed. Aborting."; exit 1; }
command -v curl >/dev/null 2>&1 || { echo >&2 "I require curl but it's not installed. Aborting."; exit 1; }
INSTALLED_ATOM=`rpm -q --queryformat '%{version}' atom`
LATEST_ATOM=`curl -s https://api.github.com/repos/atom/atom/releases/latest | jq --raw-output -c '.name'`
COMPARE=`printf "$INSTALLED_ATOM\n$LATEST_ATOM\n" | sort -V | tail -n1`
@voor
voor / Adding Audio to a Video.sh
Created March 27, 2017 12:59
Over the weekend I wanted to add a silly Noooo from Darth Vader in the prequels to a clip from Rogue One. I couldn't find any good tutorials on how to do it, so I figured it out for myself.
#!/usr/bin/env sh
# Extract audio from the Video File into a file.
ffmpeg -i video.mp4 -map 0 -vn -acodec -copy video_audio.m4a
# Create 11 seconds of silence
ffmpeg -f lavfi -i aevalsrc=0:0::duration=11 -ab 320k silence.mp3
# Prepend the silence to the audio track you downloaded
ffmpeg -i concat:"silence.mp3|commentary_audio.mp3" -codec copy silence_commentary_audio.mp3
# Merge the commentary track with the video_audio into a single file
ffmpeg -i silence_commentary_audio.mp3 -i video_audio.m4a -filter_complex amerge -ac 2 -c:a libfdk_aac -vbr 4 merged_audio.m4a
SELECT 1
mkdir -p ~/.npm-global
npm config set prefix '~/.npm-global'