Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View gubi's full-sized avatar

Alessandro Gubitosi gubi

View GitHub Profile
@gubi
gubi / README.md
Last active January 27, 2024 19:19
@gubi
gubi / wget.sh
Created June 1, 2023 04:40 — forked from crittermike/wget.sh
Download an entire website with wget, along with assets.
# One liner
wget --recursive --page-requisites --adjust-extension --span-hosts --convert-links --restrict-file-names=windows --domains yoursite.com --no-parent yoursite.com
# Explained
wget \
--recursive \ # Download the whole site.
--page-requisites \ # Get all assets/elements (CSS/JS/images).
--adjust-extension \ # Save files with .html on the end.
--span-hosts \ # Include necessary assets from offsite as well.
--convert-links \ # Update links to still work in the static version.
@gubi
gubi / discover_network.sh
Created September 17, 2022 01:36
Discover the local network and list available devices (and their IP address)
#!/bin/bash
is_alive_ping()
{
ping -b -c 1 $1 > /dev/null
[ $? -eq 0 ] && echo Node with IP: $i is up.
}
for i in 192.168.{1..255}.{1..255}
@gubi
gubi / README.md
Last active April 30, 2021 08:08
Elenco templates Bootstrap per BestGolf
@gubi
gubi / _parser.php
Last active November 1, 2018 10:58
PHP script that extract data from the `resultAgrovoc_filled_20181029.xlsx` file
<?php
header("Content-type: text/plain");
require 'vendor/autoload.php';
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\IOFactory;
use Monolog\Logger;
use Monolog\Handler\StreamHandler;
@gubi
gubi / sample.json
Created October 25, 2018 15:04
Bioversity sample metadata
{
"metadataBlocks": {
"citation": {
"fields": [{
"typeName": "title",
"multiple": false,
"value": "Manual para la evaluacion agronomica",
"typeClass": "primitive"
},
{
@gubi
gubi / fix_network_manager_ubuntu.txt
Created November 14, 2017 06:14 — forked from devcfgc/fix_network_manager_ubuntu.txt
fix network-manager ubuntu resolv.conf
http://askubuntu.com/questions/627899/nameserver-127-0-1-1-in-resolv-conf-wont-go-away
NetworkManager is the program which (via the resolvconf utility) inserts address 127.0.1.1 into resolv.conf. NM inserts that address if an only if it is configured to start an instance of the dnsmasq program to serve as a local forwarding nameserver. That dnsmasq instance listens for queries at address 127.0.1.1.
If you do not want to use a local forwarding nameserver then configure NetworkManager not to start a dnsmasq instance and not to insert that address. In /etc/NetworkManager/NetworkManager.conf comment out the line dns=dnsmasq
sudo nano /etc/NetworkManager/NetworkManager.conf
[main]
plugins=ifupdown,keyfile,ofono
@gubi
gubi / README.md
Last active February 9, 2017 00:32
Basic API routing with klein. For HTTP Status Codes see https://github.com/gubi/HTTP-Error-Codes

Basic API routing

PHP klein config for a basic API routing

@gubi
gubi / README.md
Last active February 9, 2017 00:34

Node ARGV

@gubi
gubi / bootstrap-3_responsiveness.css
Created May 16, 2016 08:36
Bootstrap 3 Media Queries
/*==================================================
= Bootstrap 3 Media Queries =
==================================================*/
/*========== Mobile First Method ==========*/
/* Less than mobile (col-xs) */
@media only screen and (min-width: 0px){
}