This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var jQuery = window.aaa$; | |
// using jQuery | |
function getCookie(name) { | |
var cookieValue = null; | |
if (document.cookie && document.cookie != '') { | |
var cookies = document.cookie.split(';'); | |
for (var i = 0; i < cookies.length; i++) { | |
var cookie = jQuery.trim(cookies[i]); | |
// Does this cookie string begin with the name we want? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ADD RULE with PORT and IPADDRESS | |
sudo iptables -A INPUT -p tcp -m tcp --dport port_number -s ip_address -j ACCEPT | |
ADD RULE for PORT on all addresses | |
sudo iptables -A INPUT -p tcp -m tcp --dport port_number --sport 1024:65535 -j ACCEPT | |
DROP IPADRESS | |
sudo iptables -I INPUT -s x.x.x.x -j DROP | |
VIEW IPTABLES with rule numbers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gcc -o endinanness endinanness.c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print unichr(0x0158)+unichr(0x0065)+unichr(0x0070)+unichr(0x0061) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://notmysock.org/blog/hacks/a-twisted-dns-story.html | |
# http://blog.inneoin.org/2009/11/i-used-twisted-to-create-dns-server.html | |
# twistd -y dns.py | |
import socket | |
from twisted.internet.protocol import Factory, Protocol | |
from twisted.internet import reactor | |
from twisted.names import dns | |
from twisted.names import client, server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import Mapping | |
from twisted.names import dns, server, client, cache | |
from twisted.application import service, internet | |
class MapResolver(client.Resolver): | |
def __init__(self, mapping, servers): | |
client.Resolver.__init__(self, servers=servers) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from functools import update_wrapper | |
from django.contrib import admin | |
from django.contrib.admin import ModelAdmin | |
from django.contrib.admin.templatetags.admin_urls import add_preserved_filters | |
from django.core.exceptions import PermissionDenied | |
from django.shortcuts import render | |
from myapp.models import Widget | |
from myapp.forms import ManageWidgetForm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hashlib | |
import struct | |
####http://python-bitcoinlib.readthedocs.org/en/latest/_modules/bitcoin/core/serialize.html | |
def uint256_from_str(s): | |
"""Convert bytes to uint256""" | |
r = 0 | |
t = struct.unpack(b"<IIIIIIII", s[:32]) | |
for i in range(8): | |
r += t[i] << (i * 32) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div style="width:135px; height: 135px; padding: 15px; border: solid 1px; color: white; background-color: black; font-size: 30px; font-family: monospace"> | |
Bitcoin | |
Blog | |
</div> | |
<hr> | |
<div> | |
<div style="width:135px; height: 135px; padding: 15px; border: solid 1px; color: white; background-color: black; font-size: 30px; font-family: monospace"> | |
Python |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# coding: utf-8 | |
# http://musta.sh/2012-03-04/twisted-tcp-proxy.html | |
import sys | |
from twisted.internet import defer | |
from twisted.internet import protocol | |
from twisted.internet import reactor | |
from twisted.python import log |
OlderNewer