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
pragma solidity ^0.4.11; | |
contract EcRecover { | |
function verify(bytes32 hash, uint8 v, bytes32 r, bytes32 s) returns (address) { | |
bytes32 prefixedHash = sha3("\x19Ethereum Signed Message:\n32", hash); | |
return ecrecover(prefixedHash, v, r, s); | |
} | |
} |
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
0xbb14b3d84229e9702fdd0a73056f0bd19236873d |
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 aiohttp | |
import asyncio | |
def async_http_get(urls, extractor=None, json_response=True): | |
tasks = [] | |
sem = asyncio.Semaphore(32) | |
async def fetch(session, url): | |
async with session.get(url) as response: | |
if json_response: |
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
#!/bin/bash | |
readonly ASN1_PREFIX='3056301006072a8648ce3d020106052b8104000a03420004' | |
if [ -z "$1" ] | |
then | |
echo "Hex key should be supplied as first argument!" | |
exit 1 | |
fi | |
key=$ASN1_PREFIX$1 |
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
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
const processes int = 4 | |
func Chunkate(data []int, fn func([]int, chan int)) []int { |
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
! Appearance | |
URxvt*font: xft:terminus:size=10:antialias=true | |
URxvt*cursorColor: #DCDCCC | |
! General | |
URxvt*scrollBar: false | |
URxvt*secondaryScroll: true | |
URxvt*saveLines: 65535 | |
URxvt*cursorBlink: true | |
URxvt*urgentOnBell: true |
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
pragma solidity ^0.4.6; | |
contract KobyShop { | |
struct Item { | |
string name; | |
uint price; | |
bool forSale; | |
address owner; | |
bool initialized; | |
} |
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 newWall = eth.contract([{"constant":false,"inputs":[{"name":"message","type":"string"}],"name":"publish","outputs":[],"payable":false,"type":"function"},{"payable":false,"type":"fallback"},{"anonymous":false,"inputs":[{"indexed":false,"name":"message","type":"string"},{"indexed":false,"name":"addr","type":"address"}],"name":"LogMessage","type":"event"}]).at("0xfFf537A2E812B0Cd738bf913a476FE45Bd5484bE"); | |
var msgEvt = newWall.LogMessage({}, {fromBlock: 0, toBlock: 'latest'}); | |
function getLogs(){ | |
msgEvt.get(function(err, logs){ | |
for(var k in logs){ | |
console.log(logs[k].args.message); | |
} | |
}) |
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
cat $1 | egrep "/search-results.*/" | | |
sed -n 's/.*id=\(.\{6\}\).*client=\([^{ ,"}]*\).*/\1 \2/p' | | |
sort -u -k1,1 | sort -k2,2 | uniq -f 1 -c | awk '{ print $3 ";" $1 }' |
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
#!/bin/bash | |
# filter on 2 colums (id=... and datetime) then sort and uniq by the first col only (id) the sort by datetime | |
cat /var/log/nginx/access.log | sed -n 's/.*\[\(.\+\)\].*id=\(.\{6\}\).*/\2 -> \1/p' | sort -u -k1,1 | sort -k3 | |
# output would look like: | |
# d77ea4 -> 13/Sep/2016:07:17:36 +0200 | |
# 11ff21 -> 13/Sep/2016:07:45:10 +0200 | |
# 628bf5 -> 13/Sep/2016:07:52:09 +0200 | |
# 9d8a4c -> 13/Sep/2016:07:56:53 +0200 |