Skip to content

Instantly share code, notes, and snippets.

@Sam-R
Sam-R / Flac to MP3
Created June 29, 2016 16:36
Bash convert FLAC to MP3 using lame on Ubuntu 14.04/Mint 17
#
# Original code copied from @ http://www.boback.com/2013/how-to-convert-flac-to-mp3-ubuntu-command-line/
#
# Install lame and flac
sudo apt-get install lame flac
# For each file in the current directory, pass it through lame and output as MP3
for f in *.flac; do flac -cd "$f" | lame -b 320 - "${f%.*}".mp3; done
@Sam-R
Sam-R / insert_countries.php
Created April 21, 2016 12:38
Insert ISO 3166-1 alpha-2 country codes into MySQL
$country_codes = array(
'AF' => 'Afghanistan',
'AX' => 'Aland Islands',
'AL' => 'Albania',
'DZ' => 'Algeria',
'AS' => 'American Samoa',
'AD' => 'Andorra',
'AO' => 'Angola',
'AI' => 'Anguilla',
'AQ' => 'Antarctica',
#!/bin/bash
# ----------------------------------------------- #
# Restart AMP
# ----------------------------------------------- #
sudo service apache2 stop
sudo service mysql restart
sudo service apache2 start
@Sam-R
Sam-R / Install Apache MySql PHP5
Last active September 9, 2016 19:15
Install Apache, MySQL and PHP5 on a Debian/Ubuntu based machine
#!/bin/bash
# ----------------------------------------------- #
# Install an AMP environment on Ubuntu 14.04
# ----------------------------------------------- #
# Update the system's repositories
sudo apt-get update
# Install apache2, mysql-server and PHP5
sudo apt-get install apache2 mysql-server libapache2-mod-auth-mysql php5-mysql php5 libapache2-mod-php5 php5-mcrypt php5-cli php5-gd php5-curl php5-imagick mcrypt phpmyadmin