Skip to content

Instantly share code, notes, and snippets.

View pixline's full-sized avatar

Paolo T. pixline

View GitHub Profile
@pixline
pixline / inky-unsplash.py
Last active November 17, 2020 22:23
Inky Impression test script (via pimoroni/inky and unsplash.com)
#!/usr/bin/env python3
import sys
from PIL import Image
from inky.inky_uc8159 import Inky, CLEAN
import urllib
import requests
from io import BytesIO
import time
import signal
@pixline
pixline / squid.conf
Last active June 29, 2020 11:38
pfsense 2.1 squid3 proxy + adblock setup
# http://aacable.wordpress.com/tag/squid-maximum-cache-hit/
# https://calomel.org/squid_adservers.html
http_port 192.168.3.254:3128
http_port 10.0.0.253:3128
http_port 127.0.0.1:3128 intercept
icp_port 7
dns_v4_first off
pid_filename /var/run/squid.pid
cache_effective_user proxy
@pixline
pixline / guest-account.sh
Created October 14, 2013 20:30
/usr/sbin/guest-account script (debian version)
#!/bin/bash
# (C) 2008 Canonical Ltd.
# Author: Martin Pitt <martin.pitt@ubuntu.com>
# License: GPL v2 or later
# modified by David D Lowe and Thomas Detoux
# Debian 7 support by pixline <pixline@gmail.com>
# It NEEDS /bin/bash, dash won't work (sed issues).
#
# Setup user and temporary home directory for guest session.
@pixline
pixline / ftp.json
Last active May 5, 2017 01:29
lnav.org FTP log format (work in progress).
{
"ftp_log" : {
"title" : "FTP XFER log format",
"description" : "The default FTP/XFERLOG server log.",
"url" : "http://www.proftpd.org/docs/howto/Logging.html",
"multiline" : false,
"regex" : {
"core": {
"pattern" : "^(?<timestamp>\\w{3}\\ \\w{3}\\ \\d{2}\\ \\d{2}\\:\\d{2}\\:\\d{2}\\ \\d{4})\\ (?<xfer_time>\\d{1,9})\\ (?<remote_ip>\\d{1,3}\\.\\d{1,3}.\\d{1,3}.\\d{1,3})\\ (?<file_size>\\d{1,})\\ (?<file_name>\/\\S{1,})\\ (?<xfer_type>\\w{1})\\ (?<xfer_flag>\\S{1,})\\ (?<xfer_direction>\\w{1,})\\ (?<xfer_mode>\\w{1,})\\ (?<xfer_user>\\S{1,})\\ (?<xfer_service>\\w{1,})\\ (?<xfer_auth_method>\\w{1,})\\ (?<xfer_auth_id>\\S{1,})\\ (?<xfer_status>\\w{1,})$"
}
@pixline
pixline / imapsync.sh
Created June 28, 2013 04:24
IMAP to IMAP batch mailbox migration. Requires imapsync (http://imapsync.lamiral.info/)
#!/usr/bin/php
#
# Usage: ./imapsync.sh accounts.csv
#
# CSV account schema:
# old_username;old_password;new_username;new_password
#
<?php
define('HOST_FROM', 'imap.example.com');
@pixline
pixline / .scrutinizer.yml
Created September 28, 2013 17:22
sample scrutinizer.yml config file for WordPress plugin
filter:
paths:
- 'lib/*'
- '/*'
excluded_paths:
- 'tests/*'
- 'examples/*'
tools:
php_mess_detector:
filter:
@pixline
pixline / colorbash-escape.sh
Created October 23, 2013 06:11
color bash techniques
# Text color variables
txtred='\e[0;31m' # red
txtgrn='\e[0;32m' # green
txtylw='\e[0;33m' # yellow
txtblu='\e[0;34m' # blue
txtpur='\e[0;35m' # purple
txtcyn='\e[0;36m' # cyan
txtwht='\e[0;37m' # white
bldred='\e[1;31m' # red - Bold
@pixline
pixline / wheezypoint.sh
Last active December 25, 2015 13:18
debian7 raw internet point setup. of course it doesn't work, but it should :-) 1) debootstrap + kernel + grub 2) script 3) internet point!
#!/bin/bash
# running time measure
start_seconds=`date +%s`
# network check
ping_result=`ping -c 2 8.8.8.8 2>&1`
# architecture
arch=`uname -m`
# Script URLs
GUEST_URL="https://gist.github.com/pixline/6981710/raw/5bcc702616a8253b0ed90889dd31529962a89c37/guest-account.sh"
@pixline
pixline / lightdm.conf
Created October 14, 2013 20:37
lightdm.conf guest support (sample)
[LightDM]
start-default-seat=true
guest-account-script=guest-account
[SeatDefaults]
xserver-command=Xorg
xserver-allow-tcp=false
greeter-session=lightdm-greeter
greeter-hide-users=true
greeter-allow-guest=true
@pixline
pixline / osxlocal.sh
Last active December 24, 2015 08:39
homebrew local setup
#!/bin/bash
homebrew_packages=(
freetype
jpeg
libpng
gd
zlib
openssl
unixodbc