Skip to content

Instantly share code, notes, and snippets.

@teopost
teopost / gist:577704870ca97cf27071
Created August 28, 2014 16:33
Truncate table from csv with csvfix
csvfix sql_insert -en -sep "|" -ifn -hdr "TRUNCATE TABLE dbo.IGM_IMP_CLIFOR_TESTDOCremo" -s "\ngo\n" -f 1:CHIAVE,27:DES_DOC,28:DES_NOTE -t IGM_IMP_CLIFOR_TESTDOC -o a.txt io_clifor_testdoc.dat
@teopost
teopost / gist:a40e9c18e33e3119872c
Created August 28, 2014 16:35
Weblate installation notes
sudo apt-get install python-django
sudo apt-get install python-django-registration
sudo apt-get install python-django-south
sudo apt-get install python-imaging
sudo apt-get install python-pyicu python-git python-lxml
sudo apt-get install python-cairo python-gtk2 python-libravatar
sudo apt-get install python-pip
@teopost
teopost / FuckMiniclip.py
Created September 19, 2014 19:51
Fuck Miniclip
#!/usr/bin/python
import os
import time
def sposta_mouse(x,y):
os.system('xdotool mousemove ' + str(x) + ' ' + str(y))
def click_sinistro():
os.system('xdotool click 1')
@teopost
teopost / unsplash_downloader.py
Last active August 29, 2015 14:06
Unsplash Downloader
#!/usr/bin/env python
# this is better : https://github.com/mkzero/unsplash-download
import urllib
import pprint
import os
def getImageURLs(pageIndex):
f = urllib.urlopen('http://unsplash.com/page/' + str(pageIndex))
@teopost
teopost / nasa_image_day.sh
Created September 19, 2014 20:07
Nasa image day
#!/bin/sh -x
#cambia lo sfondo del desktop
#mettendo l'immagine del giorno prelevata dal sito della nasa
#change wallpaper with nasa image day
DIR=$HOME/Immagini/WALL
if [ ! -d "$HOME/Immagini" ]; then
mkdir "$HOME/Immagini"
if [ ! -d "$DIR" ]; then
mkdir "$DIR"
fi
@teopost
teopost / uie_image_day.sh
Created September 19, 2014 20:09
uie_image_day.sh
#!/bin/sh
# Scarica dal cafe' la foto piu' recente e la mette come sfondo di gnome
# Prerequisiti:
# 1. Installare xmlstarlet e imagemagik (Ubuntu:sudo apt-get install curl xmlstarlet imagemagick / Fedora:yum install xmlstarlet)
# 2. Mettere nel crontab (se si vuole)
# Note:
# http://www.ioncannon.net/linux/81/5-imagemagick-command-line-examples-part-1/
# http://www.fmwconcepts.com/imagemagick/autocaption/index.php
# http://imagemagick.org/script/color.php
@teopost
teopost / store_git_pwd.sh
Created September 20, 2014 20:53
store password ti osx keychain
git config --global credential.helper osxkeychain
@teopost
teopost / gist:e9666c08ee7639ba5815
Created November 28, 2014 20:17
Send push notification to prowl with curl
curl https://prowl.weks.net/publicapi/add -F apikey=a357c85c7dc3bb866d9f7a1d145ae76d1ed91e47 -F description="Errore in aggiornamento file banca" -F application="Facebook"
@teopost
teopost / gist:9a5d3c747c779d1ec6e4
Created November 28, 2014 20:19
Copie su NAS con rsync daemon
#!/bin/bash
export RSYNC_PASSWORD=mypassword
rsync -av --delete --progress /media/teopost/Stage_1000/Fotografie teopost@192.168.1.79::nasrs
rsync -av --delete --progress /media/teopost/Stage_1000/Immagini teopost@192.168.1.79::nasrs
rsync -av --delete --progress /media/teopost/Stage_1000/Musica teopost@192.168.1.79::nasrs
rsync -av --delete --progress /media/teopost/Stage_1000/Montaggi\ Video teopost@192.168.1.79::nasrs
rsync -av --delete --progress /media/teopost/Stage_1000/Video teopost@192.168.1.79::nasrs
@teopost
teopost / copie_su_nas_con_rsync.sh
Last active August 29, 2015 14:10
Copie su NAS con rsync
#!/bin/bash
export sourcedir=/media/teopost/Stage_1000
export destdir=/media/NAS/dati
rsync -av --delete --progress $sourcedir/Fotografie $destdir
rsync -av --delete --progress $sourcedir/Immagini $destdir
rsync -av --delete --progress $sourcedir/Musica $destdir