Skip to content

Instantly share code, notes, and snippets.

View tatic0's full-sized avatar

fran varas tatic0

View GitHub Profile
# -*- coding: utf-8 -*-
"""Test using the InfluxDB client."""
import time
import colorsys
import os
import sys
import socket
import ST7735
import ltr559
@tatic0
tatic0 / 2mov.sh
Created September 9, 2018 20:15
convert files from my action cameras to .mov for DaVinci Resolve
file=`basename $1`
ffmpeg -i "$1" -c:v mpeg4 -q:v 5 -c:a pcm_s16le "${file%.*}.mov"
@tatic0
tatic0 / compare.sh
Created September 9, 2018 20:14
nice one liners to compare/delete files with the same name but different extension in bash
for i in $(ls *.mov); do echo "$i --> `ls ${i%.*}.MP4`"; done
for i in $(ls *.mov); do echo "$i --> `rm -vf ${i%.*}.MP4`"; done
@tatic0
tatic0 / thread-subprocess.py
Created December 29, 2016 16:02
Python thread + subprocess example
# it will calculate the md5sum of
# all files in the arborescence
from threading import Thread
import subprocess
import os
def slowthing(i):
cmd = ["md5sum", i]
print(cmd)
@tatic0
tatic0 / udp.sh
Created March 18, 2016 15:37
launch vlc for multicast streams (to be used as an alias)
udp(){
if [ ! -z "$2" ] ; then
vlc udp://@$1:$2
else
vlc udp://@$1:1234
fi
}
@tatic0
tatic0 / fnexp.sh
Created March 13, 2016 21:56
explode filename and extension
#!/bin/bash
filename=file.png
echo "${filename:0:(-4)} <--> ${filename:(-4)}"
#!/usr/bin/ptyhon
# coding: utf-8
import sys
from TwitterFollowBot import TwitterBot
say = sys.argv[1] + " #RaspberryPi powered"
my_bot = TwitterBot()
from twython import Twython
import linecache
import os
import sys
HOME = os.path.expanduser('~/')
passfile= HOME + '.passfile.text'
APP_KEY = linecache.getline(passfile,1).strip()
APP_SECRET = linecache.getline(passfile,2).strip()
@tatic0
tatic0 / pyreference.py
Created September 10, 2015 11:34
ugly scritp to search for Wordreference translations from the command line
#!/usr/bin/env python
# -*- coding=utf-8 -*-
# F Varas 09 2015
# works:
# wget --user-agent="User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12" "http://www.wordreference.com/fres/sournois" -O sournois2.html
import sys
@tatic0
tatic0 / fcfgg.s
Created July 28, 2015 16:12
generates false color images from grayscale images from Flir Dev Kit (Lepton) infrared sensor
#!/bin/bash
# put all grayscale images on ~/gs
# and create ~/fc for new false color images from this script
# needs imagemagick installed
function gradientgen {
#convert xc:white xc:yellow xc:red xc:green xc:cyan xc:blue xc:violet xc:black +append -filter Cubic -rotate 90 -resize 20x80\! gradient_IR_4-rainbow.jpg