Skip to content

Instantly share code, notes, and snippets.

View jaimehrubiks's full-sized avatar

Jaime Hidalgo García jaimehrubiks

View GitHub Profile
@jaimehrubiks
jaimehrubiks / cloud-init-test
Created November 4, 2019 16:19
cloud-init-test
#cloud-config
ssh_authorized_keys:
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDiS6gC5CK9j05+5xikmhsTBlfJZ7td6Myt203P3mD84implfbGDoh3NeXtwfA2CsQ+OflehEkLOqdpIZ1ZlnfDlVOLZ6WmYM2/dGN0mZ0WqaU/L2XX6O4Z6vBvp27pg1P0ORSkXIxYSVNS6SXj2XBpd62pTb61PgR9x9jbaPnJ37JRy0q5FBCSlCKx4Buc6g1HI/6W16wYhEyAY2iJHpxNgToQ68f+oqBQnUbfrEIVBHC7ZlxI2QvgA0LakVNyoWlvjOtgRxZWTFFnEfjJg0UxsgZXHgoQf4hrjYE+UCbl+j7nuq1iDjH49yPaG1yS5Dx9TdcKDDc7Y4BAl3AwAL1g/94VFksbWX7FFpuchXiN4cBUsRi0hRLlT3STIEgLo71T9LhRJzmOlJ5d7507MMvxoxT1zHuZpdCOYViIZzBEPEcqsGPqIC7IzGVgSBdwniVwtMSdWPaLsgTW3QOw0ZUUYD/R1ZVfh+KDlAo6RD4H19OZL1aiY4V+VLF8RXR5nxm+HAo9Ub3PDvezaypUyeTgqUGy3vVTNOBvS3gUN3og9TYMWxiXg0t8Mdl6hgXtALv/3dNTZs8t3RxAw5SjG1dm44Bx0joi5iy9iAxusU7HQ1ONG4LBtVChlMk//hsmNLNu4niFxQfzE2qlxqZEkWzM+MMT/6JQPihqRXmciQbaew== [email protected]
@jaimehrubiks
jaimehrubiks / script.sh
Created July 16, 2019 15:26
Shrink XFS system on LVM (do as root, no sudo)
#!/bin/bash
cd
/bin/cp -rf /home/controller /tmp/
pkill -KILL -u controller
usermod -d /tmp/controller controller
fuser -km /home/
umount /home
lvremove -y /dev/centos/home
lvcreate -y -L 12G -n home centos
umount /home
@jaimehrubiks
jaimehrubiks / android_pattern.c
Created April 1, 2019 17:06
Teensy Android Pattern AutoDraw
int moveDelay = 0;
void setup() {
delay(1000);
wakeUp();
delay(1000);
revealPin();
delay(1000);
pattern(120,1050*1,200*1);
@jaimehrubiks
jaimehrubiks / vscode_git_mergetool.txt
Created December 1, 2018 23:49
VScode for git mergetool
git config --global --edit
[merge]
tool = vscode
[mergetool "vscode"]
cmd = code --wait $MERGED
[diff]
tool = vscode
[difftool "vscode"]
cmd = code --wait --diff $LOCAL $REMOTE
@jaimehrubiks
jaimehrubiks / ssh_wsl.txt
Created October 10, 2018 21:03
Make SSH work in WSL [Windows subsystem for Linux] (Tested in Ubuntu Oct 2018)
# 1. Reinstall open ssh server
sudo apt-get purge openssh-server
sudo apt-get install openssh-server
# 2. Install public key
# vim .ssh/authorized_keys blabla
chmod 400 .ssh/authorized_keys
# 3. Edit open ssh server config files
# Some settings are not needed, but these will help for sure to make it work
# OSX PC
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCtbk7Ed8d83S7sF4r8uMOZiVWPeTXlfs+Q8E/pNaVlfye1/SbutNdTQEwyCUCC1+LLjujWXxd4PZhwwXpNYLQQRD+21+srjBn5ejeLq25IMIEzYcLtHE9krKgG4Zeq6Ebz2NI0CkZl4aYq3LM2nLo178RRzcIClgtfeLqWW7QwBLal2wbo3MkN9qzA8XuNAXI3twka4Au8ElToSKnX+D2GsWB57deT5v8DYkFSrZsoqG7NeV3Ox9BWfRbN/UCfDFNfK5e9R+o0zr80vulkbgr4GK4UZFjrTkLbR1rhd3Y0kcX/YcLQbHb0pwvrtWGJ7+sKvt+bShKS4Fl/nGsuZeKsavtaiMgwiDQnBf3wAFhLFZlg7l1X6nUMEAEErPpaHa5sRt23FVzwcbiyxx+jeSj6ef/gIrdniwtDWLRWifPlYw8fZ8CRM1esFqNimLvPE0tpgMvy/CNM95dZ9II+6pXfIeaOMeStxD9hrt4su92s9R2D2kixBVlASnZMegLOiiubByfUK+RsjJZFchLqckllj0/e97WzDhXqiI9TALF8sZd1aHd0v4cQslB/mBlkpBO28NgOFD+NC0Dod99wfhiky1uobtVZ/viSMnNUDC0DUUKTIFlkxBq13Ap9O4xMsI23K8p6o5sRQ/RTw1e8q3uWP5kKd2aZEKKivDUFeKb7bw== jaime@osxRubiks
# ANDROID TERMUX
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDGzOhzyeXLe0wzl3dW6fdhakn/2tSZArR5gG6iLB9rWpoFiaLl+rkqUVO144msKlyzMvrBqos4Q2ENW70IbZAcGUtkF4BxFySXU/mh2B51/qm6vwktO+Xyj0HQGL499nz5z/XlXtGDibOLSa/d4ix712K5cji3iwZ7SkWuWoTWJBCf/TaFkCIR4CepRIGHy+/t1WTXV+r2JPqZ9O1mkV2rhRpmq
@jaimehrubiks
jaimehrubiks / surfingkeys.config
Last active January 14, 2022 14:51
Jaimehrubiks Surfingkeys config
// Jaimehrubiks
api.map('?', 'u');
api.map('u', 'e');
api.map('J', 'E');
api.map('K', 'R');
api.map('F', 'gf');
api.map('H', 'S');
api.map('L', 'D');
@jaimehrubiks
jaimehrubiks / PortableGNS3.md
Created April 30, 2017 10:54
GN3 Portable USB

Cómo preparar un entorno Linux portable para GNS3

Author

Jaime Hidalgo García @ 11/03/2017 via pandoc (markdown)

Qué ganamos

  • Podremos arrancar nuestro propio entorno linux en cualquier ordenador y seguir exactamente como lo dejamos. (Ej. ordenador uni)
  • Podremos arrancar la maqueta de GNS3 directamente en windows/osx y trabajar sin arrancar el linux. (Ej. ordenador casa / portátil)
  • Si hay cualquier error en linux, reinstalamos la misma u otra distribución similar y seguirá todo exactamente igual que como lo dejamos. (reinstalar sobre / sin formatear el resto)