Skip to content

Instantly share code, notes, and snippets.

View cig0's full-sized avatar

Martín Cigorraga cig0

View GitHub Profile
@cig0
cig0 / gist:32d16da4a7c69c30f664
Created February 13, 2015 16:21
Convert absolute path to relative
CURPATH=$(pwd)
dir="/"
file=""
FILECHANGE=${dir}${file}
# convert absolute path to relative
FILECHANGEREL=$(echo "$FILECHANGE" | sed 's_'$CURPATH'/__')
@cig0
cig0 / gist:86d143b7312919167539
Created February 16, 2015 01:00
typeset - arrays
#!/bin/bash
# Sum a set of arrays and assign the result indirectly, also printing each intermediary result (without portability workarounds)
# sum name arrname [ arrname ... ]
incrontab -l | { cat; echo '/watchme/path IN_CLOSE_WRITE /bin/whatever $@/$#'; } | incrontab -
incrontab -l | { cat; echo '/mnt/sites/test/BO/mfs_merged/public/lookupImg/BO/carousel IN_CLOSE_WRITE /home/multicore/bin/t.bash $@/$#,$%'; } | incrontab -
Refs:
http://linuxaria.com/article/incron-cron-inotify
http://stackoverflow.com/questions/878600/how-to-create-cronjob-using-bash
@cig0
cig0 / gist:bd4c863dd129c8eeb2b3
Last active August 29, 2015 14:16
Validate IP and substitute name's spaces with underscores
# Taken from here: http://stackoverflow.com/questions/13015206/variables-validation-name-and-ip-address-in-bash
#!/bin/bash
read name
name=${name// /_}
read ip
if [[ "$ip" =~ ^([0-9]{1,3})[.]([0-9]{1,3})[.]([0-9]{1,3})[.]([0-9]{1,3})$ ]]
then
### Keybase proof
I hereby claim:
* I am msx on github.
* I am msx (https://keybase.io/msx) on keybase.
* I have a public key whose fingerprint is 2E77 84B6 9333 E6F0 0D33 50F1 AEB7 1E8D E492 A3FF
To claim this, I am signing this object:
#!/bin/sh
set -x
DBUS_NAME="org.freedesktop.login1"
DBUS_PATH="/org/freedesktop/login1"
DBUS_INTERFACE="org.freedesktop.login1.Manager"
DBUS_SIGNAL="PrepareForSleep"
INHIBITOR_PID=
install_background_inhibitor() {
@cig0
cig0 / gist:3e0446080958988a86bc
Created July 13, 2015 21:58
SysAdmin / Playtika.com
Me pongo en contacto con vos en esta oportunidad porque estoy buscando incorporar un System Administrator para las oficinas de Playtika (www.playtika.com) en Buenos Aires. Veo que estas en Mar del Plata, no sé si estas evaluando la posibilidad de relocarte.
Me gustaría saber si te interesa que conversemos y te comente un poco de que se trata la posición y la compañía. Si tienes disponibilidad para hablar por Skype esta semana, indícame en que día/horario te es conveniente. Gracias.
Saludos!
Victoria Nini
@cig0
cig0 / gist:6cbd02e3b23caf6ae0a4
Created July 13, 2015 22:00
System Engineer para Cia. Multinacional líder E-commerce
Te estamos contactando por una propuesta laboral para Argentina. Vi en tus datos que estás en Mar del Plata, la búsqueda sería para CABA. Te envio el perfil del puesto, si estás interesado te agradezco enviarme tu CV actualizado indicando en que nivel se encuentra tu pretensión salarial en valor bruto para la posición.
Espero tu respuesta.
System Engineer
para Cia. Multinacional líder E-commerce
Requisitos:
Ing. en Sistemas, Cs, de la Computación o afines.
;; Restore last frame size on startup
(defun save-framegeometry ()
"Gets the current frame's geometry and saves to ~/.emacs.d/framegeometry."
(let (
(framegeometry-left (frame-parameter (selected-frame) 'left))
(framegeometry-top (frame-parameter (selected-frame) 'top))
(framegeometry-width (frame-parameter (selected-frame) 'width))
(framegeometry-height (frame-parameter (selected-frame) 'height))
(framegeometry-file (expand-file-name "~/.emacs.d/framegeometry"))
)
@cig0
cig0 / grub.cfg
Created January 18, 2016 01:54
/boot/efi/EFI/fedora/grub.cfg
### BEGIN /etc/grub.d/00_header ###
set pager=1
if [ -s $prefix/grubenv ]; then
load_env
fi
if [ "${next_entry}" ] ; then
set default="${next_entry}"
set next_entry=
save_env next_entry