Skip to content

Instantly share code, notes, and snippets.

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

Silvio Giunge a.k.a kanazuchi kanazux

🏠
Working from home
View GitHub Profile
@kanazux
kanazux / list_gists.py
Created June 18, 2014 14:01
list your gists
#!/usr/bin/python
# -*- coding: utf-8 -*-
# psychographed by kanazuchi <[email protected]>
import re
import argparse
from urllib2 import urlopen
def set_parser():
parser = argparse.ArgumentParser()
@kanazux
kanazux / proxy_monitor.sh
Last active August 29, 2015 14:05
proxy monitor
#!/bin/sh
# $Id$ */
#
# proxy_monitor.sh
# Copyright (C) 2006 Scott Ullrich
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
@kanazux
kanazux / netwatch.py
Last active August 29, 2015 14:05
Brincando com o scapy
#!/usr/local/bin/python
#-*- coding: utf-8 -*-
#
# Silvio Giunge a.k.a Kanazuchi <[email protected]>
# 1403614686
#
import os
import sys
import MySQLdb
@kanazux
kanazux / path_halt_vip_interface.sh
Last active August 29, 2015 14:05
path shutdown carp
#!/bin/sh
if [ ! -f /usr/local/bin/shutdown_interface_vip.php ]; then
cat <<EOF >/usr/local/bin/shutdown_interface_vip.php
<?php
require_once('interfaces.inc');
require_once('config.inc');
@kanazux
kanazux / add_cep_csv.py
Created September 5, 2014 13:17
add cep to csv file
#!/usr/local/bin/python
#
# -*- coding: utf-8 -*-
#
import re
from unicodedata import normalize
from pprint import pprint as pp
print 'Reading files'
@kanazux
kanazux / get_files_squid33.py
Last active October 2, 2017 19:26
Install squid3 + samba4 + krb5 + pfsense2.2
#!/usr/local/bin/python
# -*- coding: utf-8 -*-
#
# Get files for squid33 on packages server of the pfSense
# Author: Silvio Giunge a.k.a Kanazuchi
# 1410180880
# a2FuYXp1Y2hpQGFsdm9saXZyZS5jb20=
#
import os
@kanazux
kanazux / remove_accents.php
Last active August 29, 2015 14:06
remove accents php
<?php
function removeAccents($str) {
$a = array('À', 'Á', 'Â', 'Ã', 'Ä', 'Å', 'Æ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 'ż', 'Ž', 'ž', 'ſ', 'ƒ', 'Ơ', 'ơ', 'Ư', 'ư', 'Ǎ', 'ǎ', 'Ǐ', 'ǐ', 'Ǒ', 'ǒ',
@kanazux
kanazux / killcat.sh
Created September 26, 2014 12:48
kill cat process opened by syslog
#!/bin/bash
PKILL=`which pkill`
PGREP=`which pgrep`
DATE=`which date`
WC=`which wc`
getCat=`$PGREP -fl "cat -u" | $WC -l`
if [ $getCat -gt 5 ]; then
@kanazux
kanazux / ERR_ACCESS_DENIED
Created October 8, 2014 20:00
erros page squid custom
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
<TITLE>ERROR: Access Denied</TITLE>
<style type="text/css">
BODY {
background: white;
}
#titles {
background: white url("http://127.0.0.1/themes/images/logo.png");
@kanazux
kanazux / check_black_list.py
Created October 9, 2014 16:42
remove tag html, chack ip on blacklist
#!/usr/local/bin/python
import sys, re
from urllib2 import urlopen
print ''.join([ re.sub(r'<[^>]+>','',x) for x in urlopen('http://spamcop.net/w3m?action=checkblock&ip={}'.format(sys.argv[1])).read().split('\n') if re.match(r'^{}.*'.format(sys.argv[1]),re.sub(r'<[^>]+>','',x))])