Skip to content

Instantly share code, notes, and snippets.

View lorello's full-sized avatar
🏠
Working from home

LoreLLo lorello

🏠
Working from home
View GitHub Profile
@lorello
lorello / syncthing-ids.txt
Last active December 12, 2016 23:30
syncthing-ids
rainbowdash DLOQPHP-2DZH5D4-XAG2EV3-24QMXUD-LZCJ76K-MFXYKEM-XLQDFIQ-YLTYIQ5
landi03 A3YHUBY-7HYDSWA-C7L7SLY-QQFPDL2-W3C74ID-BBC6CXD-CWEXOHQ-6JTBNQ2
landi04 RWTPXHR-ELIA43E-XUSFGZB-OTRHLEX-7YUMZSD-7WF3I36-6MVSXHX-7CP4ZAG
tamaki MPEYPUT-ZG2THYP-XJCVBJS-UCKU23C-ZZLVKF2-VLTOYOG-FGEBPNQ-EDFFCQC
maccio Y3IT2C5-Q2AZ3GW-QYRDBKC-FG26Q4R-L5JBWSV-QTN57X6-V35M2CU-UUOGRAL
moto-x 54OMV3J-BXK4XXA-JIF5VLU-F57ARPQ-3GAHQ3E-GLQB53R-Q6NQLUZ-2LROHQJ
batou GJVF6AV-YOWT3JX-GMHIMBO-P5TC67P-JDDHZAC-7D52PAQ-TWP2KLV-C6QWHAA
lucy DAEUL6D-R2BLFW3-5VHX2PQ-6HSENZ2-5WZ2QDE-UIOISPF-R7WXC6Y-J5G6WAO
@lorello
lorello / swapping-processes.sh
Created November 18, 2015 11:38
swapping processes
#!/usr/bin/env bash
SUM=0
OVERALL=0
for DIR in `find /proc/ -maxdepth 1 -type d -regex "^/proc/[0-9]+"`
do
PID=`echo $DIR | cut -d / -f 3`
PROGNAME=`ps -p $PID -o comm --no-headers`
for SWAP in `grep Swap $DIR/smaps 2>/dev/null| awk '{ print $2 }'`
do
let SUM=$SUM+$SWAP
@lorello
lorello / purge-old-kernels
Created November 16, 2015 15:43
purge-old-kernels
#!/bin/sh
#
# purge-old-kernels - remove old kernel packages
# Copyright (C) 2012 Dustin Kirkland <kirkland@ubuntu.com>
#
# Authors: Dustin Kirkland <kirkland@ubuntu.com>
# Kees Cook <kees@ubuntu.com>
# Lorenzo Salvadorini <lorello@openweb.it>
#
# This program is free software: you can redistribute it and/or modify
@lorello
lorello / gist:17becc4834159bacda6e
Created June 3, 2015 14:06
API Verbs from RFC 7231
+---------+-------------------------------------------------+-------+
| Method | Description | Sec. |
+---------+-------------------------------------------------+-------+
| GET | Transfer a current representation of the target | 4.3.1 |
| | resource. | |
| HEAD | Same as GET, but only transfer the status line | 4.3.2 |
| | and header section. | |
| POST | Perform resource-specific processing on the | 4.3.3 |
| | request payload. | |
| PUT | Replace all current representations of the | 4.3.4 |
@lorello
lorello / puppet-masterless-setup.sh
Last active August 29, 2015 14:21
Puppet masterless setup (not inside a vagrant host)
#!/bin/bash
# Setup ricette vagrant su una macchina non vagrant
#
# mi aspetto di fare il clone di repository stile vagrant
#
# /Puppetfile
# /setup/manifests/default.pp
# /setup/modules
# /setup/hiera/*.yaml
#
@lorello
lorello / after_push
Created May 25, 2015 22:44
GIT-Push Deploy scripts
#!/usr/bin/env bash
set -e
OLDREV=$1
NEWREV=$2
run() {
[ -x $1 ] && $1 $OLDREV $NEWREV
}
@lorello
lorello / octohost-cookbook-setup.sh
Last active August 29, 2015 14:17
octohost cookbook setup
apt-add-repository ppa:brightbox/ruby-ng
apt-get install git curl vim unattended-upgrades build-essential ruby2.1 ruby-switch ruby2.1-dev libxml2-dev libxslt-dev zlib1g-dev
ruby-switch --set ruby2.1
gem install bundle rake
# libgecode 4.x broken on trusty
apt-get install -y -q libqtcore4 libqtgui4 libqt4-dev libboost-dev
wget "http://us.archive.ubuntu.com/ubuntu/pool/universe/g/gecode/libgecode30_3.7.1-3_amd64.deb"
wget "http://us.archive.ubuntu.com/ubuntu/pool/universe/g/gecode/libgecode-dev_3.7.1-3_amd64.deb"
wget "http://us.archive.ubuntu.com/ubuntu/pool/universe/g/gecode/libgecodegist30_3.7.1-3_amd64.deb"
@lorello
lorello / gitlab-ci-runner.pp
Created March 3, 2015 23:25
puppet-gitlab-ci-runner
Exec {
path => $path,
}
file { '/home/gitlab-runner':
ensure => directory,
}->
user { 'gitlab-runner':
shell => '/bin/false',
#!/bin/bash
#
# Disable UFW
ufw disable
# Cleanup to shrink vagrant images.
#apt-get update
#apt-get upgrade -y
apt-get -y autoremove
apt-get -y clean
dd if=/dev/zero of=/EMPTY bs=1M
@lorello
lorello / dkim-domain.sh
Created October 18, 2014 09:23
Add DKIM to IspConfig3 domain on Ubuntu Pricise 12.04 LTS
DOMAIN=$1
PEMPATH=/var/db/dkim
cd $PEMPATH
amavisd-new genrsa $DOMAIN.key.pem
chown amavis:amavis $PEMPATH/$DOMAIN.key.pem
echo "Add to /etc/amavis/conf.d/51-dkim"