Skip to content

Instantly share code, notes, and snippets.

View e-minguez's full-sized avatar
😅
I have no idea what I'm doing

Eduardo Mínguez e-minguez

😅
I have no idea what I'm doing
View GitHub Profile
@e-minguez
e-minguez / bashrc
Created June 5, 2014 11:18
Useful .basrc alias/functions
http://www.reddit.com/r/linux/comments/27buyv/i_just_leaned_about_man_html/
function yell {
figlet -f slant "$@" | sed "s/\(.\+\)/ \1/g"
}
function manopt {
man $1 | sed 's/.\x08//g' | sed -n "/^\s\+-\+$2\b/,/^\s*$/p" | sed '$d;';
}
@e-minguez
e-minguez / micsshpifm
Created August 6, 2014 18:25
Send your local mic to pifm through ssh
arecord -f S16_LE -r 22500 | ssh -C user@raspberrypi "sudo /home/user/pifm/pifm - 101.6"
@e-minguez
e-minguez / numbers.sh
Last active August 29, 2015 14:05
random number fm stream
#!/bin/sh
# Like lost numbers, but random :)
VOICE="es"
FREQ="101.6"
SPEEDMIN=100
SPEEDMAX=150
TYPEMIN=1
TYPEMAX=7
NUMMIN=1
NUMMAX=100
@e-minguez
e-minguez / disable_bluetooth.sh
Created August 11, 2014 09:51
Disable bluetooth on thinkpad x230 at boot with systemd and tmpfiles
echo "w /proc/acpi/ibm/bluetooth - - - - disable" >> /etc/tmpfiles.d/disable-bluetooth.conf
@e-minguez
e-minguez / retroarch.cfg
Created March 6, 2015 19:24
My /opt/retropie/configs/all/retroarch.cfg
core_options_path = /opt/retropie/configs/all/retroarch-core-options.cfg
system_directory = /home/pi/RetroPie/roms/../BIOS
config_save_on_exit = false
video_threaded = true
video_smooth = false
video_aspect_ratio = 1.33
video_shader_dir = /opt/retropie/emulators/RetroArch/shader/
input_autodetect_enable = true
joypad_autoconfig_dir = /opt/retropie/emulators/RetroArch/configs/
input_player1_a = x
@e-minguez
e-minguez / get_constants
Created June 8, 2015 14:49
Get all constants in a bash script
cat ${FILE} | grep -o "\"*\$[{]*[[:upper:]]\{1,\}.*[}]*\"*" | sed -e 's|\(.*\):.*|\1|g' -e 's|[\"|{|\$]||g' -e 's|\(.*\)[[:blank:]].*|\1|g' -e 's|\(.*\)}.*|\1|g' -e 's|\(.*\)[[:blank:]]\].*|\1|g' | sort | uniq | grep -v [[:lower:]] | tr '\r\n' ' '

~/.bashrc

Just configure a few default variables to store vagrant images in a custom path, and set libvirt as default provider

# Vagrant stuff
export VAGRANT_DEFAULT_PROVIDER=libvirt
export VAGRANT_HOME=/storage/vagrant
@e-minguez
e-minguez / resourcenode.sh
Created September 14, 2015 12:32
one liner to get the node running a specific service in pacemaker
echo "cat /crm_mon/resources/resource[@id='RESOURCENAME']/node/@name" | xmllint --nocdata --shell <(pcs status xml) | awk -F= '/name/ { print $2 }' | tr -d '"'
@e-minguez
e-minguez / fedora-livecd-creator.sh
Created October 22, 2013 12:54
Fedora 19 livecd creator
# install reqs
su -c 'yum -y install fedora-kickstarts livecd-tools'
# create live image
su -c 'livecd-creator -c /usr/share/spin-kickstarts/fedora-install-fedora.ks -d -f filesystem_label --title=syslinux-title --releasever=19 -t tmp --cache=cache --logfile=image_creator.log'
@e-minguez
e-minguez / getyoutube.sh
Created October 27, 2013 22:34
Get youtube "src" links from an URL
#!/bin/sh
# Credits to http://blog.viktorkelemen.com/2011/07/get-links-from-page-with-bash.html
URL=$1
curl ${URL} 2>&1 | grep -o -E 'src="http://www.youtube([^"#]+)"' | cut -d'"' -f2
exit 0