This file contains hidden or 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
// ==UserScript== | |
// @name HexTweets | |
// @version 1 | |
// @grant none | |
// @match https://twitter.com/* | |
// ==/UserScript== | |
var re = /^#[a-fA-F0-9]{6}$/; | |
var hashtags = document.querySelectorAll("div.tweet a.twitter-hashtag"); | |
for(var i in hashtags) { |
This file contains hidden or 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
<?php | |
// Include this in your scripts where REMOTE_ADDR is used | |
function check_ip_range($ip, $rangeFile) { | |
$bin = inet_pton($ip); | |
$adrlen = strlen($bin); | |
if ($adrlen == 16) { //IPv6 | |
$rangeFile.=".ipv6"; | |
} else { | |
$rangeFile.=".ipv4"; |
This file contains hidden or 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
# Definitions from the exercise | |
avg_packet_size = 400 | |
edge_def = """ | |
Edge Dist C_bps | |
AB 1 20000 | |
BC 3 10000 | |
AD 2 20000 | |
BE 5 20000 | |
CE 2 30000 |
This file contains hidden or 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
function http(url, method, data){ | |
return new Promise(function(resolve, reject) { | |
var xhr; | |
if(method == undefined) method = data ? "POST" : "GET"; | |
try { | |
xhr = new XMLHttpRequest(); | |
} catch (e) { | |
xhr = new ActiveXObject("Msxml2.XMLHTTP"); | |
} |
This file contains hidden or 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
mikrotik rooten | |
wget -c https://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/mikrotik/openwrt-ar71xx-mikrotik-vmlinux-initramfs.elf | |
wget -c https://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/mikrotik/openwrt-15.05-ar71xx-mikrotik-vmlinux-lzma.elf | |
wget -c https://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/mikrotik/openwrt-15.05-ar71xx-mikrotik-DefaultNoWifi-rootfs.tar.gz | |
ln -s openwrt-15.05-ar71xx-mikrotik-vmlinux-lzma.elf openwrt-ar71xx-mikrotik-vmlinux-lzma.elf | |
ln -s openwrt-15.05-ar71xx-mikrotik-DefaultNoWifi-rootfs.tar.gz openwrt-ar71xx-mikrotik-rootfs.tar.gz | |
wget https://busybox.net/downloads/binaries/1.21.1/busybox-mips | |
python -m http.server & |
This file contains hidden or 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
#include <openssl/blowfish.h> | |
#include <openssl/md5.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <inttypes.h> | |
#define TOKENS "\r \n " | |
#define DIRECTION 1 | |
#define SRCDATA 2 |
This file contains hidden or 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
openssl genrsa -out rootCA.key 2048 -nodes | |
openssl req -x509 -new -nodes -key rootCA.key -sha256 -days 1024 -out rootCA.pem | |
openssl pkcs12 -export -in rootCA.pem -out rootCA.pkcs12 -inkey rootCA.key -name "fooCA" | |
certhash=$(openssl x509 -in rootCA.pem -subject_hash_old -noout) | |
cat rootCA.pem > $certhash.0 | |
openssl x509 -inform PEM -text -in rootCA.pem -out /dev/null >> $certhash.0 |
This file contains hidden or 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
#!/bin/sh | |
CHOICES="Rock Paper Scissors Lizard Spock" | |
check_rule() { | |
user="$1"; computer="$2"; draw="yes" | |
while read rulestr ; do | |
rule="$rulestr" | |
winner="${rule%% *}"; rule="${rule#* }" | |
verb="${rule%% *}"; rule="${rule#* }" |
This file contains hidden or 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
#!/bin/bash | |
if [[ $EUID != 0 ]] ; then | |
echo This must be run as root! | |
exit 1 | |
fi | |
for xhci in /sys/bus/pci/drivers/?hci_hcd ; do | |
if ! cd $xhci ; then |
This file contains hidden or 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
def drawbars(img, width, height): | |
x=0 | |
while x<width: | |
img.paste((255,0,0), (x,0,x+1,height)) | |
x+=2 | |
img.paste((255,0,0), (x,0,x+3,height)) | |
x+=6 | |
img.paste((0,255,0), (x,0,x+1,height)) | |
x+=2 |