Skip to content

Instantly share code, notes, and snippets.

@mauromarano
mauromarano / docker_quick_install.sh
Created July 4, 2023 09:10
Quick install docker on ubuntu server
#!/bin/bash
# curl -s https://gist.githubusercontent.com/gagginaspinnata/0c90b246d31b71de1c413e812dc787e7/raw/569fe2a9ea2fdc211ba0d82e47f040709f76ad5a/docker_quick_install.sh | bash
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
@mauromarano
mauromarano / screener.py
Created June 19, 2017 09:06
Get a screenshot of a webpage with python
#to install PyQt4 on mac brew install cartr/qt4/pyqt
#to remove javascripts tag from html https://stackoverflow.com/questions/8554035/remove-all-javascript-tags-and-style-tags-from-html-with-python-and-the-lxml-mod
import sys
import time
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.QtWebKit import *
import lxml
from lxml.html.clean import Cleaner
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mauromarano
mauromarano / passwords_downloader
Last active October 16, 2021 12:21
# Download the top used passwords from passwordrandom.com
#!/bin/sh
# Download the top used passwords from passwordrandom.com
#Set Script Name variable
SCRIPT=`basename ${BASH_SOURCE[0]}`
URL="http://www.passwordrandom.com/most-popular-passwords/page/"
OUTPUT="top_password.txt"
@mauromarano
mauromarano / desktop_organizer.sh
Last active August 2, 2021 13:18
Script per tenere organizzato il desktop
#!/bin/bash
###########################################################################
# AUTHOR: Mauro Marano
# SITE: mauromarano.it/com
# Questo script serve per tenere organizzato il desktop
# Una volta impostate le variabili lui andrà a creare delle cartelle
# Per ogni tipo di file specificato.
# La cosa migliore è farlo girare con un cronjob.
# crontab -e
@mauromarano
mauromarano / getotps.sh
Created March 23, 2016 20:13
Esempio di come utilizzare i flags in uno script bash
#!/bin/bash
######################################################################
#This is an example of using getopts in Bash. It also contains some
#other bits of code I find useful.
#Author: Linerd
#Website: http://tuxtweaks.com/
#Copyright 2014
#License: Creative Commons Attribution-ShareAlike 4.0
#http://creativecommons.org/licenses/by-sa/4.0/legalcode
@mauromarano
mauromarano / updater.sh
Last active February 15, 2017 14:40
Updates the dreambox's settings
#!/bin/sh
####################
##### HOW TO USE####
####################
# 1) crontab -e
# 2) paste: 30 21 * * * sh updater.sh
# 3) chmod +x updater.sh
@mauromarano
mauromarano / spider.py
Last active August 29, 2015 14:03
Controlla su subito se è stata inserita una moto che risponde a determinati criteri. Se la trova ti notifica via email
#! /usr/bin/env python
#-*- coding: utf-8 -*-
# HOW TO:
# set the top class variables
# crontab -e and add the command to auto-lounch this command each hour: 1 * * * * * python spider.py
from bs4 import BeautifulSoup
import requests
import re
@mauromarano
mauromarano / calgenerator.php
Created January 12, 2014 15:58
classe per generare un calendario sportivo
<?php
/*
// ==============================
// = Realizzato da Mauro Marano =
//= Sito web mauromarano.it =
//= email [email protected] =
// ==============================
@mauromarano
mauromarano / osxbootableusb.sh
Created January 8, 2014 14:33
Makes a mac osx bootable USB dongle
clear
echo '
____ ______ __ __ __ __ __ __ _______ ____
/ __ \/ ___/ |/ / / /_ ____ ____ / /_____ _/ /_ / /__ / / / / ___// __ )
/ / / /\__ \| / / __ \/ __ \/ __ \/ __/ __ `/ __ \/ / _ \ / / / /\__ \/ __ |
/ /_/ /___/ / | / /_/ / /_/ / /_/ / /_/ /_/ / /_/ / / __/ / /_/ /___/ / /_/ /
\____//____/_/|_| /_.___/\____/\____/\__/\__,_/_.___/_/\___/ \____//____/_____/ '
echo ''