Skip to content

Instantly share code, notes, and snippets.

@libcrack
libcrack / libvirtctl.py
Created May 11, 2016 20:58
libvirtctl.py
#!/usr/bin/env python
# coding: utf-8
# mié may 11 22:01:32 CEST 2016
# http://pylint-messages.wikidot.com/all-codes
# pylint: disable-msg=C0103
# pylint: disable-msg=C0301
# pylint: disable-msg=W0611
# pylint: disable-msg=W0612
# pylint: disable-msg=W0702
# pylint: disable-msg=W0703
#!/usr/bin/env perl
use strict;
use warnings;
while (<STDIN>){
$_ =~ s/([;<>\*\|`&\$!#\(\)\[\]\{\}:'"])/\\$1/g;
print $_;
}
escapestr_sed() {
sed -e 's/\//\\\//g' -e 's/\&/\\\&/g'
}
@libcrack
libcrack / serv.js
Created May 15, 2016 09:31
Simple nodejs HTTP server with exceptions & URL handling
#!/usr/bin/env node
// [email protected]
// http://jessie.z.je/serv.js
// Sun May 15 01:38:52 CEST 2016
// Missing modules? npm install <name>
//
// user@libcrack:~$ url="http://127.0.0.1:3003"
// user@libcrack:~$ for i in {0..9}; do msg "$url/$i"; curl -s "$url/$i"; done
// [*] http://127.0.0.1:3003/0
// [*] http://127.0.0.1:3003/1
@libcrack
libcrack / telegramd.service
Created May 16, 2016 05:57
Telegram daemon systemd user unit
# [email protected]
# Sun may 15 23:39:17 CEST 2016
# ~/.local/share/systemd/user/telegramd.service
[Unit]
Description=Telegram systemd service
ConditionPathExists=/home/%u/.telegram-cli
After=network.target
; ===========================================================
@libcrack
libcrack / msf-docker.sh
Created May 16, 2016 11:15
Bash wrapper around docker and Metasploit
#!/usr/bin/env bash
# [email protected]
# vie may 13 22:57:30 CEST 2016
# docker run -d --name msf \
# -p 127.0.0.1:1443:443 \
# -v ~/.msf4:/root/.msf4 \
# -v /tmp/msf:/tmp/data \
# remnux/metasploit
#
@libcrack
libcrack / rsyslog.conf
Created May 28, 2016 03:21
Rsyslog quick config
# /etc/rsyslog.d/00-libcrack.conf
# Local rsyslog data {{{
if ($msg contains "xauth: file list does not exist") or \
($msg contains "COMMAND=/usr/sbin/hddtemp") or \
($msg contains "Sensor alarm:") or \
($msg contains "telegram") then stop
# }}}
# Local iptables {{{
@libcrack
libcrack / database.py
Created May 28, 2016 04:30
Minimal DB abstraction layer
# coding: utf-8
# [email protected]
# Mon Jul 27 20:04:26 CEST 2015
# pylint: disable-msg=C0103
# pylint: disable-msg=C0301
# pylint: disable-msg=W0611
# pylint: disable-msg=W0612
# pylint: disable-msg=W0702
# pylint: disable-msg=W0703
# pylint: disable-msg=W0621
@libcrack
libcrack / travelodge.py
Created May 28, 2016 05:46
Free wifi interface for Travel Lodge hotel client
#!/usr/bin/env python
# coding: utf-8
# vim:ts=4 sts=4 tw=100:
# pylint: disable=C0103
# pylint: disable=C0301
# pylint: disable=C0411
# pylint: disable=C0413
# pylint: disable=W0611
# pylint: disable=W0612
# pylint: disable=W0702
@libcrack
libcrack / virtualenv.sh
Last active July 4, 2016 21:33
Python virtual environment bash helper
#!/usr/bin/env bash
# 28/05/2016 16:24:27
# [email protected]
VENV="venv"
V=2
[[ -n "${1}" ]] && V="${1}"
[[ "$BASH_SOURCE" == "${0}" ]] && {
myself="$(readlink -m ${0#-*})"
echo "Usage: . ${myself}" > /dev/stderr