Skip to content

Instantly share code, notes, and snippets.

View jgmel's full-sized avatar
🏠
Working from home

Juan Gómez Melero jgmel

🏠
Working from home
  • Phicus Tecnologia SL
View GitHub Profile
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
menuentry 'Start Fedora-Workstation-Live 32' --class fedora --class gnu-linux --class gnu --class os {
set isofile="/iso/Fedora-Workstation-Live-x86_64-32-1.6.iso"
set isolabel="Fedora-WS-Live-32-1-6"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jgmel
jgmel / .bash_aliases
Created October 9, 2019 00:25
bash_aliases
# Column N
c() { awk "{print \$$1}"; }
# find
alias f="find . -name "
# Editor
alias e="code"
alias e-="code -"
e.() { cat | sed -n "${1}p" | ( read file; e $file; ); }
def dim(value):
return "dim value"
@jgmel
jgmel / winbox.url
Created May 20, 2019 11:16
Winbox URL Handler
#!/usr/bin/env python
import encodings
import sys
from urlparse import urlparse
import os
import subprocess
import configparser
# info https://kb.vmware.com/s/article/2146460
openssl req -new -x509 -newkey rsa:2048 -keyout MOK.priv -outform DER -out MOK.der -nodes -days 36500 -subj "/CN=VMware/"
/usr/src/linux-headers-`uname -r`/scripts/sign-file sha256 ./MOK.priv ./MOK.der $(modinfo -n vmmon)
/usr/src/linux-headers-`uname -r`/scripts/sign-file sha256 ./MOK.priv ./MOK.der $(modinfo -n vmnet)
mokutil --import MOK.der
@jgmel
jgmel / alpine-install.sh
Created October 1, 2017 04:18 — forked from thde/alpine-install.sh
A script to install alpine linux on a dedicated server. Tested on Hetzner, Kimsufi / OVH
#!/bin/sh
set -ex
PATH=/bin:/sbin:/usr/bin:/usr/sbin
KEYMAP="us us"
HOST=alpine
USER=anon
ROOT_FS=ext4
BOOT_FS=ext4
bc56c00f5c1e70f4968a35f80790c03a0bce8572
@jgmel
jgmel / chromecast-ssdp.xml
Last active August 20, 2017 00:04
FirewallD Chromecast RHEL7/Centos7
<?xml version="1.0" encoding="utf-8"?>
<service>
<short>chromecast-ssdp</short>
<port protocol="udp" port="1900"/>
<destination ipv4="239.255.255.250/32"/>
</service>
@jgmel
jgmel / phoenix.sh
Last active November 9, 2017 15:50
Phoenix Card Reader-USB Smartcard Reader
#!/bin/sh
main(){
NCARD=0
PREFIX=phoenix
rm -f /etc/udev/rules.d/99-usb-serial.rules
for n in /dev/ttyUSB*; do
let NCARD++
UDEV_SERIAL=`udevadm info -a -p $(udevadm info -q path -n ${n}) | grep -B 12 'FT232R USB UART' | grep 'ATTRS{serial}'`
cat >> /etc/udev/rules.d/99-usb-serial.rules <<EOT