Skip to content

Instantly share code, notes, and snippets.

@mauromarano
mauromarano / ubuntu_install.sh
Last active May 13, 2016 14:46
This is a simple bash script who initialize a new ubuntu OS
#!/bin/bash
#TO INSTALL: wget https://goo.gl/DgqH0H; mv DgqH0H ubuntu_install.sh; chmod +x ubuntu_install.sh; sudo bash ubuntu_install.sh
function say(){
clear
echo $1
sleep $2
@mauromarano
mauromarano / client.py
Created December 12, 2013 18:57
This is a simple irc python bot
# ________ ______ ____ ____ ______
# / _/ __ \/ ____/ / __ )/ __ \/_ __/
# / // /_/ / / / __ / / / / / /
# _/ // _, _/ /___ / /_/ / /_/ / / /
# /___/_/ |_|\____/ /_____/\____/ /_/
# Author: Mauro Marano
# site: mauromarano.it
import socket
@mauromarano
mauromarano / ovpn2tblk.py
Last active December 30, 2015 17:08
A script who converts the file.ovpn to a valid tblk file
#! /usr/bin/env python
#-*- coding: utf-8 -*-
import re
import os
import sys
def read_file(name):
@mauromarano
mauromarano / xbet.js
Last active December 27, 2015 14:19
Calcola quando si spende e quando si puo' guadagnare con il metodo di scommessa dell X.
/**
* Calcola quanto si spende e quanto si puo' guadagnare
* con il metodo di scommessa dell X.
* L'utilizzo è molto semplice si fa:
*
* console.log(cal(6,2));
*
* @param {int} partite Numero di partite dopo quanto esce l'X
* @param {int} puntata Numero di puntata con cui si inizia il ciclo
* @return {array} Array che contiene tutte le informazioni

Introduction

  • This script lets you set up and use a temporary DigitalOcean droplet to download torrent files.
  • Once downloaded, they can be streamed down to your local machine.
  • This uses transmission-cli for the torrent client, and nginx to serve files.

Setup on Local Machine

  • This assumes that you have a DigitalOcean account and tugboat set up, as well as seedbox-setup.sh present in the current directory.
@mauromarano
mauromarano / remove_from_array.js
Created May 7, 2013 15:51
Search and remove an item from an array
var remove = function(array, value) {
var index = null;
while ((index = array.indexOf(value)) !== -1)
array.splice(index, 1);
return array;
};
@mauromarano
mauromarano / copy_and_backup_settings.sh
Last active December 12, 2015 09:09
Script che copia i settings con numerazione sky nel decoder
#!/bin/bash
echo "*****************************************"
echo "****Script powered by mauromarano.it****"
echo "*****************************************"
echo "This script will use scp to copy the files into your decoder."
echo "Be sure tu run this script from the folder with the right settings."
echo "[*] Enter the local ip adresses of your decoder: "
@mauromarano
mauromarano / typeahead.js
Created December 6, 2012 09:36
Esempio typeahead twitter bootstrap
$(function(){
// nome della classe di input ad esempio:
// <input type="text" class="ajax-typeahead">
$('.ajax-typeahead').typeahead({
// specifico da dove prendere i dati
source: function(typeahead,cb){
// questo url ad esempio ritorna un oggetto json
@mauromarano
mauromarano / milliseconds.py
Created November 15, 2012 16:21
Funzione che ritorna l'ora attuale in millisecondi
from datetime import datetime
def microsends():
dt = datetime.now()
return dt.microsecond
@mauromarano
mauromarano / contact.php
Last active October 12, 2015 17:57
Una contact page con twitter bootstrap e recaptcha
<?php
/**
*
* Author: Mauro Marano
* eMail: http://www.mauromarano.it/contact.php
* Date: 13/11/2012
*
* Prima di iniziare
* =================