Skip to content

Instantly share code, notes, and snippets.

View lucarin91's full-sized avatar

Luca Rinaldi lucarin91

View GitHub Profile
@lucarin91
lucarin91 / sign.html
Last active July 25, 2016 17:53
my email sign
<table cellpadding="0" cellspacing="0" border="0" style="background: none; border-width: 0px; border: 0px; margin: 0; padding: 0;">
<tr>
<td colspan="2" style="padding-bottom: 4px; color: #F7751F; font-size: 16px; font-family: Arial, Helvetica, sans-serif;">Luca Rinaldi</td>
</tr>
<tr>
<td colspan="2" style="color: #333333; font-size: 14px; font-family: Arial, Helvetica, sans-serif;"><i>Computer Science & Networking Student</i></td>
</tr>
<tr>
<td colspan="2" style="color: #333333; font-size: 14px; font-family: Arial, Helvetica, sans-serif;">
<strong>University of Pisa and Scuola Superiore Sant'Anna</strong>
@lucarin91
lucarin91 / Rotate_a_PDF.md
Created September 2, 2016 09:19
the pdftk command to rotate a pdf file
pdftk <file-path> cat 1-endleft output <file-path-rotated>
@lucarin91
lucarin91 / tosker-slide.md
Last active November 18, 2016 11:02
slide set to describe tosker

tosKer


Feature

  • descrizione del deployment attraverso un subset di TOSCA yaml
  • supporta il deployment di docker container e docker volumes
  • supporta il deployment di componenti software generici attraverso il TOSCA lifecycle
  • permette la connessione delle varie componenti in rete
@lucarin91
lucarin91 / tree_visits_with_yield.py
Last active August 16, 2017 16:49
Tree visit made using yield and new from keywords of python 3
from pprint import PrettyPrinter
from random import randrange
def post_order(t, deep=0):
if isinstance(t, dotdict):
# is a node
yield deep, t.value
yield from post_order(t.left, deep+1)
yield from post_order(t.right, deep+1)
@lucarin91
lucarin91 / example_group.completed.yaml
Created September 27, 2017 15:23
example toskeriser
tosca_definitions_version: tosca_simple_yaml_1_0
description: "TOSCA simple profile with wordpress, web server and mysql on the same\
\ server.\n"
repositories:
docker_hub: https://registry.hub.docker.com/
imports:
- tosker: ../tosker-types.yaml
@lucarin91
lucarin91 / get_abs_path.sh
Last active August 11, 2020 10:17
Shell command to retrive the absolute of the script
abs_path=$(cd "$(dirname "$0")" && pwd)
@lucarin91
lucarin91 / sleep.js
Created May 6, 2018 14:56
A simple JavaScript implementation of sleep using the yield command.
/* jshint esversion:6 */
function * main (){
console.log('Every time you need a sleep, you can yield the number of seconds that you want to wait..');
yield 5;
console.log('..this will be executed 5 seconds later');
yield 1.5;
console.log('[long wait]');
yield 10;
console.log('..and, this after 10 seconds.\n');
@lucarin91
lucarin91 / hot_change.erl
Created May 31, 2018 15:46
A simple example of an Erlang server that can dynamically change the code to process new requests.
-module(hot_change).
-export([start/0, send/1, update_code/1]).
start() ->
F = fun(Str) -> string:lowercase(Str) end,
register(hot_change_server, spawn(fun () -> loop(F) end)).
loop(F) ->
receive
{request, Pid, Q} ->
@lucarin91
lucarin91 / tsend
Last active November 3, 2018 16:50
Send a telegram message when something happens on a remote server
#!/bin/sh
###
# Send message to your telegram chat when something happens to a remote server.
# Before use the sript update the TOKEN and CHAT_ID variable with your data.
#
# Usage:
# tsend 'ALL DONE!'
# cat myfile.txt | tsend
#
# license: MIT
@lucarin91
lucarin91 / .inputrc
Last active August 28, 2018 08:44
The .inputrc configuration file to enable a zsh-like completion mechanism in bash.
##
# The .inputrc configuration file to enable a zsh-like completion mechanism in bash.
# Features:
# - Press tab to cycle throw all possible completions in a case-insensitive fashion.
# - Use the up and down arrow to search throw the history for all matches of the typed string.
#
# DISCLAIMER: Use only when you cannot install zsh :)
#
# Put together by lucarin91.
##