Skip to content

Instantly share code, notes, and snippets.

View cecchisandrone's full-sized avatar

Alessandro Dionisi cecchisandrone

View GitHub Profile
INFO[0000] updated log level logLevel=debug
DEBU[0000] os.args time=1490179700955 val=[rexray volume create test --size=1]
DEBU[0000] activating libStorage cmd=create time=1490179700956
DEBU[0000] read spec file host=unix:///var/run/libstorage/019760198.sock path=/var/run/rexray/rexray.spec time=1490179700958
DEBU[0000] is local unix server active sock=/var/run/libstorage/019760198.sock time=1490179700958
DEBU[0000] set host in context host=unix:///var/run/libstorage/019760198.sock time=1490179700958
DEBU[0000] set host in config host=unix:///var/run/libstorage/019760198.sock time=1490179700959
DEBU[0000] not starting embedded server; already running host=unix:///var/run/libstorage/019760198.sock time=1490179700959
DEBU[0000] creating libStorage client cmd=create host=unix:///var/run/libstorage/019760
@cecchisandrone
cecchisandrone / connection_check.sh
Created December 27, 2017 08:29
Connection check for Raspberry PI
#!/bin/bash
echo Started connection check at $(date)
COUNTER=0
while true
do
ping -c 4 libero.it > /dev/null
if [ $? -ne 0 ]; then
echo Connection lost at $(date)
COUNTER=`expr $COUNTER + 1`
fi
{"hostname":"{"hostname":"raspberrypi","level":30,"msg":"Connect Handler Got: ssid:|Tp-Link| psk:|aaaaaaaa|","name":"iotwifi","pid":0,"time":"2018-03-24T15:52:01.778Z","v":0}
{"cmd":"/usr/sbin/dnsmasq","cmd_id":"dnsmasq","hostname":"raspberrypi","is_error":true,"level":30,"msg":"dnsmasq[18]: query[A] www.netvibes.com from 192.168.27.119","name":"iotwifi","pid":0,"time":"2018-03-24T15:52:01.754Z","v":0}
{"cmd":"/usr/sbin/dnsmasq","cmd_id":"dnsmasq","hostname":"raspberrypi","is_error":true,"level":30,"msg":"dnsmasq[18]: config www.netvibes.com is 192.168.27.1","name":"iotwifi","pid":0,"time":"2018-03-24T15:52:01.805Z","v":0}
{"hostname":"raspberrypi","level":30,"msg":"WPA add network got: 1","name":"iotwifi","pid":0,"time":"2018-03-24T15:52:01.813Z","v":0}
{"hostname":"raspberrypi","level":30,"msg":"WPA add ssid got: OK","name":"iotwifi","pid":0,"time":"2018-03-24T15:52:01.83Z","v":0}
{"cmd":"/sbin/wpa_supplicant","cmd_id":"wpa_supplicant","hostname":"raspberrypi","is_error":false,"level":30,"msg":"wlan0: Contr
@cecchisandrone
cecchisandrone / iptables.sh
Last active November 2, 2018 16:19
iptables for Docker with iptables=false in /etc/docker/daemon.json
# IPv4
*nat
:PREROUTING ACCEPT [14027:843854]
:INPUT ACCEPT [322:18496]
:OUTPUT ACCEPT [117:7122]
:POSTROUTING ACCEPT [112:6753]
-A POSTROUTING -o eth0 -j MASQUERADE
COMMIT
*filter
:INPUT DROP [35:2029]
@cecchisandrone
cecchisandrone / program.cs
Created December 12, 2019 16:37
.NET JWT token generation
using Microsoft.IdentityModel.Tokens;
using System;
using System.IdentityModel.Tokens.Jwt;
using System.Security.Claims;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
@cecchisandrone
cecchisandrone / fcpx-clean.sh
Created March 23, 2022 15:44
Final Cut Pro X Render Files removal script
#!/bin/bash
# Usage ./fcpx-clean.sh /Users/user/Movies
find $1 -name \"Render Files\" -type d -exec rm -rf {} +"