This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os,sys | |
| people = [x.split(" ") for x in """1 10 name""".split("\n")] | |
| print (people) | |
| for f,n,name in people: | |
| f = int(f) | |
| n = int(n) | |
| print (f,f+n-1,name) | |
| os.system("gs -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -dSAFER -dFirstPage=%d -dLastPage=%d -sOutputFile=%s.pdf \"%s\"" % (f,f+n-1,name,sys.argv[1])) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # parses KML from Google Timeline to obtain places | |
| # Emanuele Ruffaldi 2018 | |
| import os,sys | |
| import csv | |
| import datetime | |
| import xml.etree.ElementTree as ET | |
| from collections import defaultdict | |
| import time | |
| from dateutil import tz | |
| from_zone = tz.tzutc() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| find / -mtime -1 -not \( -path "/proc/*" -o -path "/sys/*" -o -path "/dev/*" \) -print |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Sub ListComments() | |
| Dim x As Document | |
| Set doc = Word.ActiveDocument | |
| For k = 1 To doc.Comments.Count | |
| Dim co As Comment | |
| Set co = doc.Comments(k) | |
| co.Range.Select | |
| t = Selection.Text | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| RESTORE='\033[0m' | |
| RED='\033[00;31m' | |
| GREEN='\033[00;32m' | |
| YELLOW='\033[00;33m' | |
| BLUE='\033[00;34m' | |
| PURPLE='\033[00;35m' | |
| CYAN='\033[00;36m' | |
| LIGHTGRAY='\033[00;37m' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| IP=XXXXX | |
| USERNAME="Emanuele%20Ruffaldi" | |
| SHARE_NAME="Emanuele%20Ruffaldi" | |
| MOUNT_POINT=$HOME/mnt/smb | |
| # ask for password | |
| read -s -p "Password: " PASSWD | |
| if [ ! -d "$MOUNT_POINT" ] | |
| then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Emanuele Ruffaldi 2018 | |
| import argparse,socket,socket,json,time | |
| def str2bool(v): | |
| if v.lower() in ('yes', 'true', 't', 'y', '1'): | |
| return True | |
| elif v.lower() in ('no', 'false', 'f', 'n', '0'): | |
| return False | |
| else: | |
| raise argparse.ArgumentTypeError('Boolean value expected.') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import json | |
| import sys | |
| def main(): | |
| if len(sys.argv) < 2: | |
| print "requires JSON file" | |
| else: | |
| try: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # e.g. setgov performance or setgov powersave | |
| function setgov () | |
| { | |
| for i in {0..7}; | |
| do | |
| cpufreq-set -c $i -g $1; | |
| done | |
| } | |
| # setfreq 3.5GHz 3.5GHz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .L ./lib/libopencv_videoio.dylib | |
| .L ./lib/libopencv_highgui.dylib | |
| //.L /usr/local/Cellar/opencv/3.3.0_3/lib/libopencv_highgui.3.3.0.dylib | |
| //.L /usr/local/Cellar/opencv/3.3.0_3/lib/libopencv_videoio.3.3.0.dylib | |
| #include <opencv2/core.hpp> | |
| #include <opencv2/imgproc.hpp> | |
| #include <opencv2/highgui.hpp> | |
| #include <opencv2/videoio.hpp> | |
| #include <math.h> |