Skip to content

Instantly share code, notes, and snippets.

# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=
@SyBen
SyBen / init.vim
Last active August 9, 2018 15:18
#VIM #CONF
" Display options
set background=dark
set nu
set rnu
set ruler
set showcmd
" tabs and spaces and tabs and spaces
set expandtab
set tabstop=2
# Lock the session if a bluetooth device is too far away.
# /!\ Use MAC address as identifier.
# Adapted from https://github.com/karulis/pybluez/blob/master/examples/advanced/inquiry-with-rssi.py
from subprocess import check_output, call, CalledProcessError
import sys
import struct
import bluetooth._bluetooth as bluez
import bluetooth
#!/bin/bash
for i in "$@"; do :
if [ -f "$i" ]; then
printf "==========\nFile: %s\n" "$i"
tee >(md5sum - | awk '{print "MD5: "$1}') \
>(sha1sum - | awk '{print "SHA1: "$1}') \
> >(sha256sum - | awk '{print "SHA256: "$1}') < "$i" \
| sort
fi
@SyBen
SyBen / flacToMP3
Last active January 4, 2016 02:59
converts all the flac files from a directory to 320kbps mp3 files in a new directory.
#!/bin/bash
#License CC-BY-NC-SA for the code.
#This script converts all flac files in a directory into 320kpbs mp3 files, and then move them into another directory,
#set as the first argument. The occurences of words Flac and FLAC will be replace in the name of the working director.y
#considering wd is /path/nameOfDirectory-FLAC, the new directory will be $1/nameOfDirectory-mp3.
#Needs 1 parameter : the path to save the directory containing the mp3 files.
var2=`pwd`
var1=${var2##*/}
var=${var1//FLAC|Flac/mp3}
@SyBen
SyBen / 4chanPicsDownloader
Created December 10, 2013 07:56
Script used to download all the pictures from a 4chan thread
#!/bin/bash
#License CC-BY-NC-SA for the code, 4Chan licence for any 4Chan related content.
#This script downloads all pictures from a 4chan.org/ thread.
#Needs 2 parameters : first the link of the thread, the second the name of the folder where the pictures will be saved.
curl -L -s $1 | grep -o "\<a\ href\=\"//i.4cdn.[^ ]*\"" | cut -d"\"" -f2 | sed 's/^/https\:/' | xargs wget -P $2