Skip to content

Instantly share code, notes, and snippets.

@zenoando
zenoando / ffmpeg-mp4-to-mp3.sh
Created March 6, 2015 13:54
ffmpeg-mp4-to-mp3.sh
ffmpeg -i video.mp4 -f mp3 -ab 192000 -vn music.mp3
# some bitrate
ffmpeg -i video.mp4 -b:a 192K -vn music.mp3
# variable bitrate
ffmpeg -i k.mp4 -q:a 0 -map a k.mp3
@zenoando
zenoando / jenkins-slave.sh
Last active August 29, 2015 14:16 — forked from mgedmin/gist:9547214
jenkins-slave.sh
# This is how you add a Jenkins slave
# On master, create ssh keys for the Jenkins user if you don't have one.
# We will use ssh-key auth for master connections towards the slave.
sudo -u jenkins -H ssh-keygen
# On slave.
# Create a jenkins user account
# Create a system directory and use that for jenkins' user home directory
@zenoando
zenoando / jenkins-linux-slave.sh
Last active August 29, 2015 14:15 — forked from mgedmin/gist:9547214
jenkins-linux-slave.sh
# This is how you add a Jenkins slave
# On master:
sudo -u jenkins -H ssh-keygen
# On slave
adduser --system --group --home=/var/lib/jenkins-slave --no-create-home --disabled-password --quiet --shell /bin/bash jenkins-slave
install -d -o jenkins-slave -g jenkins-slave /var/lib/jenkins-slave
@zenoando
zenoando / nginx.conf
Last active August 29, 2015 14:07 — forked from plentz/nginx.conf
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
#!/bin/bash
tarray=(
# this is
'eenie'
# a testing
'meenie'
# of
'minee'
# arrays
set :application, "My Static Content"
set :servername, 'test.example.com'
# no git? simply deploy a directory
set :scm, :none
set :repository, "." # the directory to deploy
# using git? deploy from local git repository
# set :scm, :git
# set :repository, 'file//.' # path to local git repository
## hocho
## when i don't want to move directories to use a different knife.rb
## usage: where knife <command> <options> is transformed to hocho <command> <options>
function hocho () {
knife "$1" --config $HOME/$DEVCHEF/.chef/knife.rb "${@:2}"
}
@zenoando
zenoando / pem2json
Created June 7, 2014 15:31
pem2json or pre-json
#!/bin/bash
INFILE=$1
cat $INFILE | sed s/$/\\\\n/ | tr -d '\n' >> $INFILE.jsonready
# For CORS Ajax
proxy_pass_header Access-Control-Allow-Origin;
proxy_pass_header Access-Control-Allow-Methods;
proxy_hide_header Access-Control-Allow-Headers;
add_header Access-Control-Allow-Headers 'X-Requested-With, Content-Type';
add_header Access-Control-Allow-Credentials true;
@zenoando
zenoando / docker-commands
Last active August 29, 2015 14:01
docker commands
#!/bin/bash
# Delete all containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi $(docker images -q)
# Remove containers that exited.
docker ps -a | grep Exit | cut -d ' ' -f 1 | xargs sudo docker rm