Skip to content

Instantly share code, notes, and snippets.

View pioz's full-sized avatar
🧙‍♂️
[object Object]

Enrico pioz

🧙‍♂️
[object Object]
View GitHub Profile
@pioz
pioz / gist:403137
Created May 16, 2010 20:28
gstreamer-properties: remove blue color
videobalance hue=-1 ! autovideosink
ffmpegcolorspace ! video/x-raw-yuv,format=(fourcc)YV12 ! xvimagesink
@pioz
pioz / gist:403496
Created May 17, 2010 07:28
Adding system user
adduser --system --no-create-home --group --shell /bin/false runner
@pioz
pioz / gist:655455
Created October 30, 2010 16:06
Copy partitions table
$ sfdisk -d /dev/sda > partitions.txt
$ sfdisk /dev/sdb < partitions.txt
@pioz
pioz / gist:707537
Created November 20, 2010 02:00
Nifty color
Nifty color: #4B7399
@pioz
pioz / autoclick.c
Last active July 10, 2023 15:24
Autoclick
// Written by Pioz.
// Compile with: gcc -o autoclick autoclick.c -lX11
#include <stdio.h> // printf, fprintf and fflush
#include <string.h> // memset
#include <unistd.h> // sleep and usleep
#include <X11/Xlib.h> // X11
#include <X11/Xutil.h> // XGetPixel and XDestroyImage
// Simulate mouse click
@pioz
pioz / gist:727212
Created December 3, 2010 16:56
Text 2 Speech
mplayer -really-quiet "http://translate.google.com/translate_tts?tl=LOCALE&q=TEXT"
@pioz
pioz / campfire.rb
Created February 17, 2011 10:12 — forked from tenderlove/campfire.rb
require 'uri'
require 'psych'
require 'net/http'
require 'meme' # Install meme_generator
module Campfire
class API
attr_reader :uri, :token, :pass
@pioz
pioz / gist:843754
Created February 25, 2011 13:02
init.d script to run solr
#!/bin/sh
PATH=/opt/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
NAME=solr
DESC=apache-solr
VERSION=1.4.1
SOLR_PATH=/opt/solr-$VERSION
COMMAND=/usr/bin/java
OPTIONS="-Dsolr.solr.home=$SOLR_PATH/solr -Djetty.home=$SOLR_PATH -jar $SOLR_PATH/start.jar"
PIDFILE=/var/run/$NAME.pid
@pioz
pioz / gist:850764
Created March 2, 2011 10:51
Convert all HTML files in . to HAML
find . -type f -name '*.html' | sed s/html// | xargs -I {} html2haml {}html {}haml
@pioz
pioz / gist:850939
Created March 2, 2011 13:36
Convert latin1 database in UTF8
mysqldump DBNAME -u USER -p > backup.sql
cat backup.sql | sed s/latin1/utf8/ > converted.sql
mysql -u USER -p --execute="drop database DBNAME;"
mysql -u USER -p --execute="create database DBNAME character set utf8 collate utf8_general_ci;"
mysql DBNAME -u USER -p < converted.sql