Skip to content

Instantly share code, notes, and snippets.

View gil-obradors's full-sized avatar

Gil Obradors gil-obradors

View GitHub Profile
@gil-obradors
gil-obradors / nginx redirec.conf
Last active February 11, 2018 18:19
nginx redirect
server {
listen 80;
server_name h135;
return 301 https://h135:8006;
}
server {
listen 443;
ssl on;
@gil-obradors
gil-obradors / WINBOX
Last active November 10, 2019 17:58
Winbox installer, launcher and web mimo executer for debian/ubuntu
#/bin/bash
sudo apt-get update
sudo apt-get install wine-stable ttf-mscorefonts-installer
sudo mkdir -p /opt/winbox/
sudo wget https://mt.lv/winbox64 -O /opt/winbox/winbox.exe
sudo chmod 777 /opt/winbox -R
cat << EOF | sudo tee /opt/winbox/winbox.desktop
[Desktop Entry]
Version=1.1
@gil-obradors
gil-obradors / configurador.sh
Last active September 28, 2019 15:05
Configuracions especials meves
#!/bin/bash
[[ "$TRACE" ]] && { set -x; set -o functrace; }
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
logfile="/tmp/$(basename $0).$$.log"
exec > >(tee -ia $logfile)
exec 2> >(tee -ia $logfile >&2)
is_root_user() {
# Function to check that the effective user id of the user running
# the script is indeed that of the root user (0)
@gil-obradors
gil-obradors / SSL cheats
Created March 21, 2015 10:19
SSL cheats
# Create CA
openssl genrsa -out ca.key 4096
openssl req -new -x509 -nodes -sha1 -days 1825 -key ca.key -out ca.crt
# Create Intermediate
openssl genrsa -out intermediate.key 4096
openssl req -new -sha1 -key intermediate.key -out intermediate.csr
# CA signs Intermediate
openssl x509 -req -days 1825 -in intermediate.csr -CA ca.crt -CAkey ca.key -set_serial 01 -out intermediate.crt
@gil-obradors
gil-obradors / Llistat sectorials bages
Created March 9, 2015 14:53
llistat sectorials bages, dades antenes
#!/bin/bash
for i in 10.228.17.6 10.228.17.7 10.228.17.8 10.228.34.66 10.228.20.247 10.228.20.246 10.228.20.99 10.228.21.232 10.228.21.229 10.228.20.197 10.228.20.198 10.228.17.130 10.228.21.130 10.228.33.35 10.228.21.197 10.228.20.131 10.228.18.130 10.228.20.229 10.228.32.132 172.25.128.170 ; do /guifibages/bin/clients-rocket $i ; done
### MNBFBagesNord (10.228.17.7 AirOS v5.5.8)
Airmax
Name IP Priority Quality CCQ Signal Distance
MNRamonFarguel 10.228.17.163 None 52 98 -72.00 0.1Km
SFBPinedaRevol 10.228.17.196 None 56 99 -78.00 5.4Km
MNCanAlberti 10.228.17.208 None 61 99 -72.00 4.2Km