Skip to content

Instantly share code, notes, and snippets.

@rdroro
rdroro / ffmpeg.md
Created November 29, 2017 09:43 — forked from protrolium/ffmpeg.md
using ffmpeg to extract audio from video files

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 kbps and sample rate to 22050 Hz:

@rdroro
rdroro / gist:3d43fe0bb8c25e30f7b8
Created February 5, 2015 11:42
Set Java version
#!/bin/bash
# set your environment for a specific version of java
# run this script in your terminal via $ . ./script-name.sh
# Initialize the JAVA_HOME variable
export JAVA_HOME=/opt/applications/path_to_decompressed_archive
# Set java binary in your path
export PATH=${PATH}:${JAVA_HOME}/bin
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1
@rdroro
rdroro / bash_functions
Created July 19, 2014 09:41
Usefull bash functions for vagrant shell provisionning
#!/bin/bash
## Include this file : . ./utils.sh
## Display message ${1} on stdout with [Bootstrap] prefix
function pecho
{
echo "[Bootstrap] ${1}"
}
@rdroro
rdroro / gist:9988478
Last active April 5, 2021 11:58
Proxmox - Server setup

Setup

Network

Before install

# apt-get update

fail2ban

@rdroro
rdroro / install-node-instance.sh
Last active August 29, 2015 13:56
Shell - Setup nodejs instance
#!/bin/bash
# Version 1.3
# author rdubos
# Personnal echo
function pecho
{
echo "[Provisioning] ${1}"
}
@rdroro
rdroro / nodejs.sh
Last active December 25, 2015 21:19
init.d example - Here for nodejs app
#!/bin/bash
# To start one nodejs process on boot
# Add this script in /etc/init.d
# And run update-rc.d SCRIPT_NAME defaults to add it
# To remove it run update-rc.d -f SCRIPT_NAME remove
NODE=/opt/node/bin/node
APP_JS=/home/pi/app/server.js
USER=pi