Skip to content

Instantly share code, notes, and snippets.

View AlessandroVaccarino's full-sized avatar

Alessandro Vaccarino AlessandroVaccarino

View GitHub Profile
@AlessandroVaccarino
AlessandroVaccarino / svn2git.sh
Last active June 15, 2018 15:29 — forked from mlocati/svn2git.sh
Convert SVN repository to GIT
#!/bin/bash
# This script was written for Ubuntu 14.04, Ubuntu 16.04 and MacOS 10.13.5
# Other operating systems may need a few changes
WORK_DIR=~/svn2git_`date "+%Y%m%d-%H%M%S"`
AUTHORS_FILE=$WORK_DIR/authors.txt
GITDIR_DIRTY=$WORK_DIR/dirty
GITDIR_FINAL=$WORK_DIR/final
@AlessandroVaccarino
AlessandroVaccarino / dockerInstall_ubuntu.sh
Last active July 17, 2022 09:59
A simple shell to install the last version of Docker CE on Ubuntu
#!/bin/bash
# Process aimed to make a fast and clean installation of the last version of Docker CE
# This script was written and tested on Ubuntu 14.04
sudo apt-get update
sudo apt-get install \
ca-certificates \
curl \
gnupg \
@AlessandroVaccarino
AlessandroVaccarino / docker_elastickibanastack.sh
Last active March 28, 2021 09:27
A simple shell to run ElasticSearch and Kibana docker images
#!/bin/bash
#Some variables
ELASTICSEARCH_VERSION="6.5.3"
KIBANA_VERSION="6.5.3"
ELASTICSEARCH_PWD="secret"
#Define a "wait for service" function
WaitForService () {
while (true);
@AlessandroVaccarino
AlessandroVaccarino / docker_neo4j.sh
Last active March 19, 2019 08:26
A simple shell to run Neo4j docker image
docker create \
--restart always \
--publish=7473:7473 \
--publish=7474:7474 \
--publish=7687:7687 \
--volume=/srv/neo4j/data:/data \
--volume=/srv/neo4j/logs:/logs \
--volume=/srv/neo4j/conf:/var/lib/neo4j/conf \
--env=NEO4J_AUTH=none \
--env=NEO4J_dbms_memory_pagecache_size=8G \
@AlessandroVaccarino
AlessandroVaccarino / docker_jupyter.sh
Created December 13, 2018 09:37
A simple shell to run Jupyter datascience notebook docker image
docker run \
--detach \
--restart always \
--publish 8888:8888 \
--volume=/srv/jupyter:/home/jovyan/work \
--env=GEN_CERT=yes \
--env=JUPYTER_ENABLE_LAB=yes \
--name jupyter \
jupyter/datascience-notebook start-notebook.sh
@AlessandroVaccarino
AlessandroVaccarino / MongoEnterprise_install_ubuntu.sh
Created May 9, 2019 13:24
A simple shell to install the last version of Ubuntu Enterprise on Ubuntu
# Install MongoDB Enterprise on Ubuntu
# https://docs.mongodb.com/manual/tutorial/install-mongodb-enterprise-on-ubuntu/#install-mongodb-enterprise-on-ubuntu
# Specify MongoDB version (leave blank for latest version)
export MONGODB_VERSION=""
# Get OS Version
. /etc/os-release
echo "----> $PRETTY_NAME ($ID - $VERSION)"
@AlessandroVaccarino
AlessandroVaccarino / AmazonDashButton_monitoring.py
Created July 30, 2019 21:25
Fast Python code, aimed to detect Amazon Dush button pressings. Please note: needs to be run as root
from scapy.layers.dhcp import DHCP
from scapy.layers.l2 import Ether
from scapy.sendrecv import sniff
MAC_ADDRESS_BTN1 = "xx:xx:xx:xx:xx:xx"
def detect_button(pkt):
if pkt.haslayer(DHCP):
if pkt[Ether].src.upper() == MAC_ADDRESS_BTN1.upper():
print("Plasmon button pressed! What to do, now?")
@AlessandroVaccarino
AlessandroVaccarino / airprint_rpi_setup.sh
Created March 19, 2020 09:45
A script that installs and configures AirPrint on a Raspberry PI. Tested on Raspbian
# System setup
sudo apt-get update
sudo apt-get -y upgrade
# Software setup
sudo apt-get -y install cups
sudo apt-get -y install python-cups
sudo apt-get -y install avahi-daemon
sudo apt-get -y install system-config-printer
# Software configuration
sudo usermod -aG lpadmin $USER
@AlessandroVaccarino
AlessandroVaccarino / slideshare_downloader.py
Created June 13, 2020 21:37
A simple script to download SlideShare slides (as images)
import requests
import scrapy
import os.path
presentationLink = '...'
presentationId = presentationLink.split("/")[-1]
userAgent = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36'
presentationResponse = requests.get(presentationLink, headers = {'User-agent': userAgent})
@AlessandroVaccarino
AlessandroVaccarino / docker_apachesuperset.sh
Created July 17, 2022 10:02
A simple shell to run Apache Superset docker container
#!/bin/bash
# Ref: https://hub.docker.com/r/apache/superset
docker run -d -p 8080:8088 --name superset apache/superset
docker exec -it superset superset fab create-admin \
--username admin \
--firstname Superset \
--lastname Admin \
--email [email protected] \