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 / 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 '"'
#!/bin/bash
mkdir -p {images,final}
cd $1
for i in *.pdf
do
convert -density 400 -flatten ${i} ${i}.png
convert ${i}.png -crop 2550x1780+375+200 -resize 50% ${i}_ok.png

Keybase proof

I hereby claim:

  • I am e-minguez on github.
  • I am eminguez (https://keybase.io/eminguez) on keybase.
  • I have a public key whose fingerprint is 3FE2 FE2D 1256 C9F8 64EE 31C0 7C91 D6AD F693 A6D0

To claim this, I am signing this object:

#!/bin/python
import os
import time
import RPi.GPIO as GPIO
# set GPIO pin 7 as output
GPIO.setmode(GPIO.BCM)
GPIO.setup(7, GPIO.OUT)
GPIO.setup(18, GPIO.IN, pull_up_down = GPIO.PUD_UP)
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Number of virtualized CPUs
VM_CPU = ENV['VM_CPU'] || 2
# Amount of available RAM
VM_MEMORY = ENV['VM_MEMORY'] || 6144
# Validate required plugins