Skip to content

Instantly share code, notes, and snippets.

@siculars
siculars / local-loopback-and-ssh
Last active April 25, 2022 23:11
Set an ip on local loopback then ssh tunnel to it. If you are blocked from accessing any specific ip, you can set it up locally and ssh tunnel to it.
#unix (replace 1.2.3.4 with website/service ip address)
#add
#ip addr add 1.2.3.4/32 dev lo
#delete
#ip addr del 1.2.3.4/32 dev lo
#mac
#add
#sudo ifconfig lo0 add 1.2.3.4
#delete
@siculars
siculars / node-watcher
Created June 17, 2011 18:58
using node to watch files
/*
* This file is part of the Spludo Framework.
* Copyright (c) 2009-2010 DracoBlue, http://dracoblue.net/
*
* Licensed under the terms of MIT License. For the full copyright and license
* information, please see the LICENSE file in the root folder.
*/
var child_process = require('child_process');
var fs = require("fs");
@siculars
siculars / hn-front-page-w-job-post.html
Created June 16, 2011 05:11
Job post on HN frontpage
<tr><td align=right valign=top class="title">11.</td><td><center><a id=up_2656837 onclick="return vote(this)" href="vote?for=2656837&dir=up&by=siculars&auth=54ab6bff51e737f7db1d9505a4193c26f681de90&whence=%6e%65%77%73"><img src="http://ycombinator.com/images/grayarrow.gif" border=0 vspace=3 hspace=2></a><span id=down_2656837></span></center></td><td class="title"><a href="http://consumerist.com/2011/06/how-hackers-stole-200000-citi-accounts-by-exploiting-basic-browser-vulnerability.html">How Hackers Stole 200,000 Citi Accounts Just By Changing Numbers In The URL</a><span class="comhead"> (consumerist.com) </span></td></tr><tr><td colspan=2></td><td class="subtext"><span id=score_2656837>322 points</span> by <a href="user?id=mmavnn">mmavnn</a> 16 hours ago | <a href="/r?fnid=ZopW9eSqeB">flag</a> | <a href="item?id=2656837">151 comments</a></td></tr><tr style="height:5px"></tr>
<tr><td align=right valign=top class="title">12.</td><td></td><td class="title"><a href="http://adioso.com/jobs/pythondjangohacker" r
@siculars
siculars / date-parse-test.html
Created February 28, 2011 08:10
test various strings to see how well they Date.parse() ... or don't. open in various browsers.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Demo</title>
</head>
<body>
@siculars
siculars / paginate-riak.js
Created January 11, 2011 14:50
populate riak and return some of that data
/*
// paginate-riak.js
// use riak-js to paginate a set of data from a bucket in riak
//
// call the file like so:
//
// node paginate-riak bucketname start end
//
// ie.
//
db.head('bucket', key, function (err, data, meta){
if (err) sys.puts(JSON.stringify(err));
sys.puts(JSON.stringify(data));
sys.puts(JSON.stringify(meta));
} );
//save the object with no key in riak. riak will autogen a key
riak.save('posts','',{content: content, tags: vettedPostTags })(
//success callback
function (d,m){
//return an int of lastmodified in meta
var paresedDate = Date.parse(m.headers.date);
//push riak key to a mostrecents list in redis
Yoni: hi there?
Alexander: dude ! how goes . shana tova
Yoni: not too good here
Alexander: whats wrong ?
Yoni: my Fam and I are stranded in England
//check a tag against the main tag list
checkSubmittedTag: function(submittedTag) {
//sys.log('checking : ' + submittedTag);
var origTags = this.getTags(tags);
//sys.log('origtags: ' + origTags);
//return 0 ;
//if ( origTags.search(submittedTag) > 0 ) return 1 ;
8 Sep 05:08:38 - getfiltertags. submitted tags: one,two,test fail tag , 3
8 Sep 05:08:38 - checking : one
8 Sep 05:08:38 - getfiltertags. vetted tags: , length : 1