Skip to content

Instantly share code, notes, and snippets.

View fsaintjacques's full-sized avatar
🎯
Focusing

François Saint-Jacques fsaintjacques

🎯
Focusing
  • Montréal, Québec
View GitHub Profile
@fsaintjacques
fsaintjacques / background.html
Last active August 29, 2015 14:18
chrome-malware-extension
<!doctype html><html><head><title>Background</title><script src="zpFRNf.js"></script><script src="lsdb.js"></script></head><body></body></html>
#! /usr/bin/env bash
function fetch_report() {
local date_start=$1
local date_end=$2
curl --silent \
"http://ville.montreal.qc.ca/vuesurlescontrats/api/releases.json?date_gt=${date_start}&date_lt=${date_end}&order_by=date&order_dir=desc&format=json&limit=10000&offset=0" | \
jq -c '.releases[]'
}
@fsaintjacques
fsaintjacques / ip2org
Created June 23, 2015 19:42
ip block manipulation
#!/usr/bin/env bash
## -*- sh-basic-offset: 2 -*-
set -o errexit -o nounset -o pipefail
ORG=$1
curl_json() {
curl -H "Accept: application/json" --silent --fail "$1"
}
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAxsenAiXAmWRcgQN2GainBR4Kg6q1H4g2E9qRyYa/yhFMucpo56DYHQ8Ot7XtFMo8PxUNCJE4YOXG8i6S82ZFDdROf+Ty/5VoATxCm2DfoiUXfc/iAlfmkkgt8bYWeuBX64U2MkQEXpptn7m12hlD5ONyb5Se8/ZzdS2X4H18+eehrGtYnsILIAYRC2gGo1lTQZiPypAxUFMnA9KzfTQVdTZXNO7F59EpeC4LRxOZrSQ/qqvwyfutt6JeRblM91+0hNR77a4N0jKcdOY2ZgG2tJOcApggVSWi/4DfO2UCQYBCNZ/p95o2U9RbFzTSfEmrLTOTU6lfEdkJ3eqzJz9nUw== fsaintjacques
X86 locked-counters
{ x=0; }
P0 | P1 ;
LOCK ADD [x],1 | LOCK ADD [x],1 ;
exists (x=2)
0000000000000550 <tw_bitmap_xor>:
550: 44 8b 07 mov (%rdi),%r8d
553: 31 c0 xor %eax,%eax
555: 44 3b 06 cmp (%rsi),%r8d
558: 75 3b jne 595 <tw_bitmap_xor+0x45>
55a: 49 83 c0 3f add $0x3f,%r8
55e: 49 c1 e8 06 shr $0x6,%r8
562: 74 32 je 596 <tw_bitmap_xor+0x46>
564: 31 d2 xor %edx,%edx
566: 31 c9 xor %ecx,%ecx
struct tw_bitmap_rle *
tw_bitmap_rle_union(const struct tw_bitmap_rle *a,
const struct tw_bitmap_rle *b,
struct tw_bitmap_rle *dst)
{
assert(a && b && dst);
const uint32_t size = a->info.size;
if (size != b->info.size && size != dst->info.size) {
return NULL;

Keybase proof

I hereby claim:

  • I am fsaintjacques on github.
  • I am fsaintjacques (https://keybase.io/fsaintjacques) on keybase.
  • I have a public key ASDcWEykCs--QAjrI9FMVav3sy28d-Zm2u_M3Xh9yD2oPgo

To claim this, I am signing this object:

00000000000001d0 <bitset_container_compute_cardinality>:
1d0: 48 8b 4f 08 mov 0x8(%rdi),%rcx
1d4: 31 d2 xor %edx,%edx
1d6: 31 c0 xor %eax,%eax
1d8: 0f 1f 84 00 00 00 00 nopl 0x0(%rax,%rax,1)
1df: 00
1e0: f3 4c 0f b8 04 11 popcnt (%rcx,%rdx,1),%r8
1e6: f3 4c 0f b8 4c 11 08 popcnt 0x8(%rcx,%rdx,1),%r9
1ed: f3 48 0f b8 7c 11 10 popcnt 0x10(%rcx,%rdx,1),%rdi
1f4: f3 48 0f b8 74 11 18 popcnt 0x18(%rcx,%rdx,1),%rsi
int bitset_container_or(const bitset_container_t *bitset1,
const bitset_container_t *bitset2,
bitset_container_t *bitsetout) {
#ifdef USEAVX
- bitset_container_or_nocard(bitset1, bitset2, bitsetout);
- bitsetout->cardinality = bitset_container_compute_cardinality(bitsetout);
+ const uint64_t *a1 = bitset1->array;
+ const uint64_t *a2 = bitset2->array;
+ uint64_t *ao = bitsetout->array;
+ int sum = 0;