Skip to content

Instantly share code, notes, and snippets.

View MartyLake's full-sized avatar

Matthieu Talbot MartyLake

  • Expressive
  • France
View GitHub Profile
@MartyLake
MartyLake / .bash_profile
Last active August 29, 2015 14:07
ZSH conf
#!/bin/bash
#a black
#b red
#c green
#d brown
#e blue
#f magenta
#g cyan
#h light grey
@MartyLake
MartyLake / setup.sh
Last active August 29, 2015 14:07
ubuntu setup script
# bin/bash
# paste this command to your terminal
# sudo apt-get install curl && bash <(curl -s https://gist.github.com/MartyLake/da7163333e92c80db4cb)
echo "Setting up the environement !"
echo "Installing gcc, gedit, zsh"
apt-get install gcc gedit gedit-plugins zsh
@MartyLake
MartyLake / post push hook
Created October 26, 2014 13:42
git tools
#!/bin/sh
#
# Automaticaly push every commit but not branch
BRANCH_NAME=$(git branch | grep '*' | sed 's/* //')
if [ $BRANCH_NAME != '(no branch)' ] && [ $BRANCH_NAME != 'master' ]
then
# your regularly scheduled hook
exec git push
### Keybase proof
I hereby claim:
* I am martylake on github.
* I am martylake (https://keybase.io/martylake) on keybase.
* I have a public key whose fingerprint is C0C4 31E4 4649 39DA CE93 0F78 F300 56ED 2AB9 606F
To claim this, I am signing this object:
@MartyLake
MartyLake / .vimrc
Last active October 19, 2016 09:37
set encoding=utf-8 " The encoding displayed.
set fileencoding=utf-8 " The encoding written to file.
set guifont=Source_Code_Pro:h12:cANSI:qDRAFT
set syntax=on
set backspace=2 " make backspace work like most other apps
set whichwrap+=<,>,h,l,[,] "left and right will go back to previous/next line
set number "display line numbers
set nolist "IDK, related to wrap and linebreak
set wrap "wrap text when window is too short
@MartyLake
MartyLake / Create an album: Normalize all wav volume and convert all wav to mp3
Last active December 11, 2021 14:08 — forked from championofblocks/wav-mp3
Create an album: Normalize all wav volume and convert all wav to mp3
# dont normalize here if songs have different intensity, for example quiet intro song followed by loud pop song
# from http://normalize.nongnu.org/README.html
# normalize -bv *.wav
# from https://gist.github.com/championofblocks/3982727
for i in *.wav; do lame -b 320 -h "${i}" "${i%.wav}.mp3"; done
# from https://askubuntu.com/questions/65331/how-to-convert-a-m4a-sound-file-to-mp3
# + https://askubuntu.com/questions/385636/what-is-the-proper-way-to-convert-flac-files-to-320-kbit-sec-mp3
find . -type f -name '*.m4a' -exec bash -c 'avconv -i "$0" -qscale:a 0 "${0/%m4a/mp3}"' '{}' \;
@MartyLake
MartyLake / consolidateM3u.sh
Created May 28, 2017 22:18
consolidate m3u files to a folder
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
#set -x #debug mode
HELPSTRING="Usage:
$ sh consolidateM3u.sh -p \"./playlist.m3u\" -o \"./outputDir/\""
function printHelp {
echo "$HELPSTRING"
}
@MartyLake
MartyLake / filter_file.sh
Created September 19, 2017 12:23
filters a big file quickly with bash
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
input_file="in.csv"
output_file="out.csv"
NUMOFLINES=$(wc -l < ${input_file})
it=0
@MartyLake
MartyLake / Makefile
Created November 6, 2017 17:27
makefile uses an embedded python script to populate a local variable
#from https://stackoverflow.com/questions/17125269/embed-python-in-makefile-to-set-make-variables
define NEWLINE
endef
define DETECT_SDK
import os
locations = [
@MartyLake
MartyLake / Makefile
Created November 17, 2017 13:31
Notify when long operation completes
all:
long_operation.sh
notify:
display -resize 1000x1000 '${HOME}/done.jpg'
#if you want to get notified at the end of long operetion, just use:
# ’make all notify’