Skip to content

Instantly share code, notes, and snippets.

View RobinStamer's full-sized avatar

Robin Stamer RobinStamer

  • Xiennith Software
  • Edmonton, Alberta
View GitHub Profile
@RobinStamer
RobinStamer / gist:950723
Created May 1, 2011 18:45
Demo of getting seconds ago from DB
mysql> SELECT time, NOW() - time as seconds_ago FROM time_test;
+---------------------+-------------+
| time | seconds_ago |
+---------------------+-------------+
| 2011-05-01 12:43:58 | 142 |
| 2011-05-01 12:44:04 | 96 |
| 2011-05-01 12:44:24 | 76 |
+---------------------+-------------+
3 rows in set (0.00 sec)
@RobinStamer
RobinStamer / gist:977886
Created May 18, 2011 02:31
jslinux proof of function
~ # cat tmp.c
#include <tcclib.h>
int main(int argc, char ** argv) {
int i;
for (i = 0; i < argc; ++i) {
printf("[%02d] %s\n", i, argv[i]);
}
return 0;
}
@RobinStamer
RobinStamer / gist:979353
Created May 18, 2011 19:35
Single M/R pass example
genoce:PRIMARY> m
function () {
emit(this.from + ":" + this.to, {amount:this.amount});
}
genoce:PRIMARY> r
function (k, values) {
var r = {amount:0};
values.forEach(function (v) {r.amount += v.amount;});
return r;
}
genoce:PRIMARY> db.tmp.save({_id:1, session: 100, events: [{eventID: 1}]})
genoce:PRIMARY> db.tmp.find()
{ "_id" : 1, "session" : 100, "events" : [ { "eventID" : 1 } ] }
genoce:PRIMARY> db.tmp.update({_id:1}, {$set: {"events.0.date": "2011-01-01", "events.0.title": "abc"}})
genoce:PRIMARY> db.tmp.find()
{ "_id" : 1, "events" : [ { "date" : "2011-01-01", "eventID" : 1, "title" : "abc" } ], "session" : 100 }
genoce:PRIMARY>
@RobinStamer
RobinStamer / gist:995319
Created May 27, 2011 14:11
Mongo shell script to scan database sizes.
var s = {}
var d = db.getMongo()
var dbnames = d.getDBNames()
for (var i = 0; i < dbnames.length; ++i) {
var dbh = d.getDB(dbnames[i])
var cnames = dbh.getCollectionNames()
s[dbnames[i]] = 0
//print("Scanning: " + dbnames[i])
<bad_trotsky> Hmmn I don't know what you do but oneious will not chase me here.
<bad_trotsky> He chased me across all of slashnet./
<factnfiction101> :(((
<factnfiction101> why not get other people to move to another network
<bad_trotsky> I know of you fan fiction.
<factnfiction101> i'm from idiots-club
<bad_trotsky> That must be it.
<bad_trotsky> Lemmer keeps tossing the stupid bans so I leave.
<-- Jesus ([email protected]) has quit (Quit:)
<bad_trotsky> I went to APU after I got tired of lemmner.
[14:04:48] --> srknc ([email protected]) has joined #snort
[14:06:40] <srknc> i installed snort from ubuntu repos but can't use resp option with "ERROR: /etc/snort/snort.conf(2) Unknown rule option: 'resp'." error. what should i do?
[14:07:46] <srknc> any idea?
[14:08:23] <-- srknc ([email protected]) has quit (Client Quit)
[14:19:55] <enhanced> yeah, you should not ask a question then leave 45 seconds later
[14:19:59] <enhanced> asshat
[14:21:01] <rawplayer> :D
[14:22:46] --> srknc ([email protected]) has joined #snort
[14:23:51] <srknc> i installed snort from ubuntu repos and couldn't user resp option with ERROR: /etc/snort/snort.conf(2) Unknown rule option: 'resp'. error.
[14:23:59] <srknc> what should i do?
[08:42:11] -*- pcaddict pokes Sthebig
[09:31:33] <-- Sthebig ([email protected]) has quit (Ping timeout)
[12:47:21] <enderst> good going
[12:58:25] <pcaddict> yeah
[12:58:36] <pcaddict> i poked him right out of the channel
[18:34:19] <enderst> go down to the first answer. found this on that server http://stackoverflow.com/questions/3328235/how-does-this-giant-regex-work
[18:40:07] <pcaddict> interesting
[18:42:56] <enderst> we put it on a vm and it is some cool shit
[18:46:46] <pcaddict> so its a php backdoor?
[18:47:05] <enderst> pretty much
A xkcd.com logo
S http://imgs.xkcd.com/s/9be30a7.png
===
A Worst-Case Shopping
T Wait a minute. If I'm escaping from a submarine at 50 meters, then I'll *definitely* need a flashlight to find air pockets for gradual decompression on the way up. Time to start shopping professional dive lights.
S http://imgs.xkcd.com/comics/worst_case_shopping.png
===
A Selected Comics
S http://imgs.xkcd.com/s/a899e84.jpg
===
http://2kinds.com/ Twokinds - Updates Wednesdays
http://2ndshiftcomic.com/ 2nd Shift - 74. Non-Date
http://70-seas.com/ 70-Seas
http://agirlandherfed.com/ A Girl and Her Fed
http://amr.comicgenesis.com/index.html A Magical Roommate: The Weird, Wacky Webcomic
http://aquapunk.net/ Aquapunk - "Stone and Sand" - page 11
http://ataraxiatheatre.com/ Ataraxia Theatre
http://attilathe.com/ AttilaThe.com - the art of attila – aka – 600poundgorilla
http://avernyght.com/ The Chronicles of Avernyght: Whisp's Journey - Part of the SpiderForest.com Network
http://bash.org.ru/comics/20091106 bash.org.ru - �������� ������