Skip to content

Instantly share code, notes, and snippets.

View i80and's full-sized avatar
🦨
SKUNKS

Heli Aldridge i80and

🦨
SKUNKS
View GitHub Profile

Keybase proof

I hereby claim:

  • I am i80and on github.
  • I am i80and (https://keybase.io/i80and) on keybase.
  • I have a public key whose fingerprint is C580 AF99 A368 3B0D D1BD E831 2377 F819 DA1D E078

To claim this, I am signing this object:

systemLog:
destination: file
path: "/var/log/mongodb/mongodb.log"
logAppend: true
processManagement:
fork: true
storage:
dbPath: /var/lib/mongodb
replication:
replSetName: "rs0"
description "The MongoDB database engine."
version 2.8.0-rc2
respawn
setuid mongodb
setgid mongodb
expect fork
exec /usr/local/bin/mongod --config /etc/mongod.conf
/*
* Copyright (C) 2011 Hans Petter Selasky. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
#!/bin/bash
set -e
emailAddress=<USERNAME>@mongodb.com
# get the commit message
msg=`git log -1 --oneline | cut -d' ' -f2-`
hash=`git rev-parse HEAD`
hash=`git rev-parse HEAD~`..${hash}
@i80and
i80and / gist:3426705
Created August 22, 2012 15:21
Rust array corruption?
struct Element {
vals: &[float];
}
impl Element {
fn test() {
// Prints a random value close to, but not exactly equal to, 0.
// e.g. 9.52676e-317, 1.43533e-316
// Optimization flags make it exactly 0.
log(info, self.vals[0]);
'use strict';
let x = 0;
for(let i = 0; i < 10000000; i += 1) {
(function() {
x += 1;
})();
}
x = 0
for _ in range(100000):
f = lambda: x += 1
f()

Keybase proof

I hereby claim:

  • I am i80and on github.
  • I am i80and (https://keybase.io/i80and) on keybase.
  • I have a public key whose fingerprint is 6845 D667 E1D5 6652 D750 8B0F 3450 34CF B36A 363F

To claim this, I am signing this object:

@i80and
i80and / get-deps.sh
Last active March 30, 2017 17:25
Extracts the RPM package dependencies for a directory of executables, prefering 64-bit
getdeps_rpm() {
for dep in $(readelf -d ./* | grep NEEDED | awk '{print $5}' | cut -c 2- | rev | cut -c 2- | rev | sort | uniq); do
rpm -qf "/usr/lib64/${dep}" 2>/dev/null || rpm -qf "/lib64/${dep}" 2>/dev/null || rpm -qf "/usr/lib/${dep}" 2>/dev/null || rpm -qf "/lib/${dep}"
done | sort | uniq | rev | cut -d - -f 1-2 --complement | rev
}
getdeps_deb() {
for f in $(readelf -d ./* | grep NEEDED | awk '{print $5}' | cut -c 2- | rev | cut -c 2- | rev | sort | uniq); do
apt-file search "$f"
done | cut -d ':' -f 1 | sort | uniq