This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat sneakers.log.1 | grep deadlock | grep -o ".* p-10831" > deadlocks.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn a() { | |
let name = b(); | |
println!("Here the output is '()' Why? {:?}", name); | |
} | |
fn b() { | |
let reader = env.get_reader().unwrap(); | |
let db = reader.bind(&db_handle); | |
let name = db.get::<&str>(&"Some-Key"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lua ~os.execute('chmod 660 /tmp/1') | |
lua ~os.rename('/tmp/1', '/tmp/2') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Adhearsion.router do | |
route 'Special origin', SpecialOriginController, from: ['sip:[email protected]', 'sip:[email protected]'] | |
route 'Special destination', SpecialDestinationController, to: 'sip:[email protected]' | |
route 'Unavailable hours', UnavailableHoursController, lambda { |call| Time.now.hour > 20 } | |
route 'default', DefaultController | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find_probe: | |
=========== | |
handle_call({find_probe, ProbeId}, _From, State) -> | |
{_Sup, {Mongo, _Redis}} = State, | |
ProbeOid = binary_string_to_objectid(ProbeId), | |
{R} = mongo:find_one(Mongo, <<"nodes">>, {'probes._id', ProbeOid}), | |
[Res|_] = lists:filter(fun(V) -> bson:at('_id', V) == ProbeOid end, bson:at(probes, R)), | |
{reply, Res, State}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- local s = event:serialize("xml") | |
local name = event:getHeader("Event-Name") | |
freeswitch.consoleLog("NOTICE", "Got event! " .. name) | |
if name == "DTMF" then | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# | |
# Testing multipart uploads into s3 with threads | |
# Tested with Ruby 1.8 and 1.9 | |
# This is proof of concept code, it works, but is not suitable for production, and may even have nasty bugs in the | |
# threading section | |
# Refs: | |
# http://docs.amazonwebservices.com/AmazonS3/latest/API/index.html?mpUploadInitiate.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'http' | |
require 'celluloid/io' | |
class HttpFetcher | |
include Celluloid::IO | |
def fetch(url) | |
context = ctx | |
# context = nil if rand(2) == 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 #!/bin/ruby | |
2 | |
3 tema = ARGV[0] | |
4 | |
5 solos = { | |
6 'domination' => [180, 60] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# line format | |
# id(int,auto) setid(int) destination(string) flags(int) priority(int) attrs(string) description(string) | |
1 sip:10.0.0.9:5060 | |
1 sip:10.0.0.10:5060 |