Skip to content

Instantly share code, notes, and snippets.

View 0x9900's full-sized avatar
📻
Coding

Fred Cirera 0x9900

📻
Coding
View GitHub Profile
@0x9900
0x9900 / dnstest.py
Last active February 15, 2017 20:07
Quick and dirty speed test for public DNS services.
#!/usr/bin/env python
#
import DNS
import time
import sys
from collections import defaultdict
services = {
#'local': ['192.168.10.1'],
@0x9900
0x9900 / whitelist.py
Last active January 22, 2022 12:09
Extract the IP addresses from SPF records.
#!/usr/bin/env python
#
# Author: Fred C.
# Email:
#
from __future__ import print_function
from collections import defaultdict
import sys
import DNS
@0x9900
0x9900 / roll.css
Last active December 10, 2015 19:19
Rolling effect on links. <a class="roll-link" href="...
/* ROLL LINKS */
.roll-link {
display: inline-block;
overflow: hidden;
vertical-align: top;
-webkit-perspective: 600px;
-moz-perspective: 600px;
-ms-perspective: 600px;
@0x9900
0x9900 / tmux.conf
Last active August 29, 2015 14:05
tmux.conf
# Reload key
bind-key R source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded"
# make tmux display things in 256 colors
set -g default-terminal "screen-256color"
# utf8
set-window-option -g utf8 on
set -g status-utf8 on
@0x9900
0x9900 / setlog.py
Created August 21, 2014 04:46
Python: Simple logging setup.
def set_logging(level=logging.INFO):
level = logging.getLevelName(os.getenv('LOG_LEVEL', 'INFO').upper())
logger = logging.getLogger(__name__)
logger.setLevel(level)
handler = logging.StreamHandler()
handler.setLevel(level)
handler.setFormatter(logging.Formatter(
'%(asctime)s %(name)s: %(funcName)s %(levelname)s[%(lineno)d]: %(message)s'
))
@0x9900
0x9900 / spamtrap.sh
Last active August 29, 2015 14:13
Check spamdb whitelisted addresses agains RBLs.
#!/usr/local/bin/bash
#
# (c) Sometime in 2015 by Fred C. @0x9900
#
# Checks whitelisted IPs in spamdb and if they are known by any of the
# follwing DNSBL lists, tag them as trapped. This script only check
# the IP addresses whitelisted since the last run. Therefore the date
# of the last run is stored in a file called /tmp/spamtrap.status.
#
# - abuseat.org
@0x9900
0x9900 / silence_output.py
Created January 28, 2015 22:38
Silence stdout (python)
#
# Sometime, specifically in your tests, you want to silence the
# standard output or be able to read the standard output of a function
# to test what's printed. Here is some recipe to do that.
#
#
import cStringIO as StringIO
import sys
@0x9900
0x9900 / dictattr.py
Last active July 8, 2022 01:26
Dictionary were the elements can be accessed as attributes.
class DictAttr(dict):
def __getattr__(self, key):
if key not in self:
raise AttributeError(key)
return self[key]
def __setattr__(self, key, value):
self[key] = value
def __delattr__(self, key):
@0x9900
0x9900 / keybase.md
Created January 31, 2015 22:22
keybase.md

Keybase proof

I hereby claim:

  • I am 0x9900 on github.
  • I am 0x9900 (https://keybase.io/0x9900) on keybase.
  • I have a public key whose fingerprint is D7BB 551B BB16 BC3F A3F1 5591 0172 317A F80F 70A7

To claim this, I am signing this object:

@0x9900
0x9900 / wsconsctl.conf
Last active August 29, 2015 14:16
OpenBSD console config.
# $OpenBSD: wsconsctl.conf,v 1.2 2007/05/14 05:06:03 tedu Exp $
#
# wscons configurable parameters
#
keyboard.repeat.deln=25 # I like the repeat to ve a little more reactive.
keyboard.encoding=us.swapctrlcaps
#
# Sometime I have an USB keyboard plugged in
keyboard1.repeat.deln=25 # I like the repeat to ve a little more reactive.
keyboard1.encoding=us.swapctrlcaps