Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# Exec "nc -l -p 8080 -vvv" on server
host=cac.noip.me
port=8080
while [ 1 ]
do
@teopost
teopost / mount_sshfs.md
Last active November 27, 2017 14:08
Mount a remote linux filesystem via SSH on Mac

Only the first time

  1. brew install sshfs *. mkdir mount

Mount filesystem

  1. mkdir -pv ~/mount/ci.tecla.it
  2. sshfs [email protected]:/ ~/mount/ci.tecla.it
  3. ls ./mount/ci.tecla.it/
@teopost
teopost / get_issue_from_jira.py
Created January 18, 2018 10:43
get_issue_from_jira.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
import csv
from jira import JIRA
options = {'server': 'https://acme.atlassian.net'}
jira = JIRA(options, basic_auth=('<<username>>', '<<password>>'))
size = 1000
initial = 0
import glob
import ConfigParser, io
import StringIO
import re
BEGIN_TAG="BEGIN METADATA"
END_TAG="END METADATA"
#script_list=glob.glob("*.sh")
script_list=glob.glob("Daily_catalogue_extraction.sh")
@teopost
teopost / lumix-emulator.py
Created November 16, 2018 14:53
Lumix cam api emulator (for esp8266 development purpose)
#!/usr/local/bin/python
# -*- coding: utf-8 -*-
# http://www.wedoit.io:8080/cam.cgi?mode=camcmd&value=recmode
# http://www.wedoit.io:8080/cam.cgi?mode=camcmd&value=capture
# http://www.wedoit.io:8080/cam.cgi?mode=camcmd&value=capture_cancel
# http://www.wedoit.io:8080/cam.cgi?mode=getinfo&type=curmenu
# http://www.wedoit.io:8080/cam.cgi?mode=getinfo&type=allmenu
from bottle import route, run, request, response, template, static_file
while read line; do
row=$(echo $line | grep CST | wc -l)
if [ $row -eq 1 ];then
code=$(echo $line | cut -d"]" -f 1 | cut -d"[" -f 2)
code=${code%\:???*CST*}
codesec=$(date -d "$code" +%s)
secdiff=$((( $codesec - ${precsec:=0})))
if [ $secdiff -gt 20 ];then
diskutil list | grep -v disk0 | tail +2
diskutil unmountDisk /dev/disk2
sudo dd if=/dev/zero of=/dev/rdisk2 bs=1024 count=1
sudo dd if=./debian-9.6.0-amd64-netinst.iso of=/dev/rdisk2 bs=4m
function displaytime {
local T=$1
local D=$((T/60/60/24))
local H=$((T/60/60%24))
local M=$((T/60%60))
local S=$((T%60))
printf "%s days, %s hours, %s mins, %s secs" "$D" "$H" "$M" "$S"
}
* https://www.ccworld.it/2015/10/retropie-stazione-di-emulazione-retrogaming-con-raspberry-pi/
* https://romsmania.cc
* https://archive.org/details/MAME2003_Reference_Set_MAME0.78_ROMs_CHDs_Samples