Skip to content

Instantly share code, notes, and snippets.

@gnufied
gnufied / iptables_rules.sh
Created December 5, 2016 02:23 — forked from virtualstaticvoid/iptables_rules.sh
25 Most Frequently Used Linux IPTables Rules Examples
# Modify this file accordingly for your specific requirement.
# http://www.thegeekstuff.com
# 1. Delete all existing rules
iptables -F
# 2. Set default chain policies
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT DROP
#!/bin/bash
#
# Copyright 2013 John Leach <[email protected]>
#
# Distributed under terms of the MIT license
#
# Takes a screeshot using scrot and uploads it via scp and sticks the
# url on the clipboard as quickly as possible.
#
# For speed, it cheats and puts the url on the clipboard *before*
@gnufied
gnufied / supportbee_form.html
Created December 7, 2011 14:26 — forked from avinasha/supportbee_form.html
Embed SupportBee Form
Add the following code block with the correct options to embed SupportBee in any website
<script src="http://sbassets.s3.amazonaws.com/widget/script.js" type="text/javascript"></script>
<script>
var sb_form = SupportBee.Form.initialize({
company: 'techfolder',
height: '400px',
base_domain: 'supportbee.com',
position: 'bottom'
});
@gnufied
gnufied / literalparser.rb
Created August 15, 2011 12:09 — forked from apeiros/literalparser.rb
Parse literals to ruby objects
require 'strscan'
# This is copied and slightly refactored from BareTest::TabularData
#
# Example
# LiteralParser.parse("nil") # => nil
# LiteralParser.parse(":foo") # => :foo
# LiteralParser.parse("123") # => 123
c = (HttpConnection)Connector.open(url, Connector.READ_WRITE, false);
c.setRequestMethod(HttpConnection.POST);
c.setRequestProperty("Content-Language", "en-US");
c.setRequestProperty( "User-Agent", "Mozilla/4.0");
c.setRequestProperty( "Content-Type", "application/x-www-form-urlencoded");
c.setRequestProperty( "Content-Length", encodedData.length() );
os = c.openOutputStream();
String rStr = this.req.toString();
os.write(("mobile_request=" +rStr).getBytes());
class QueueWorker < BackgrounDRb::MetaWorker
set_worker_name :queue_worker
QUEUE_WORKER_LIMIT = 2
def create(args = nil)
start_correct_number_of_workers
end
def start_correct_number_of_workers
1.upto(QUEUE_WORKER_LIMIT) do |worker_key|
/usr/lib/ruby/1.8/timeout.rb:54:in `rbuf_fill': execution expired (Timeout::Error)
from /usr/lib/ruby/1.8/timeout.rb:56:in `timeout'
from /usr/lib/ruby/1.8/timeout.rb:76:in `timeout'
from /usr/lib/ruby/1.8/net/protocol.rb:132:in `rbuf_fill'
from /usr/lib/ruby/1.8/net/protocol.rb:116:in `readuntil'
from /usr/lib/ruby/1.8/net/protocol.rb:126:in `readline'
from /usr/lib/ruby/1.8/net/http.rb:2029:in `read_status_line'
from /usr/lib/ruby/1.8/net/http.rb:2018:in `read_new'
from /usr/lib/ruby/1.8/net/http.rb:1059:in `request'
... 24 levels...
def dispatch_action(klass, action, status = 200)
controller = klass.new(self, status)
- if Dispatcher.use_mutex then
+ if nil then
@@mutex.synchronize { controller._dispatch(action) }
else
controller._dispatch(action)
end
controller
end