Skip to content

Instantly share code, notes, and snippets.

@xrl
xrl / connection.hs
Created March 27, 2012 22:40
The maybe monad with IO?
connect_uri :: U.URI -> Identity -> IO (Maybe Socket)
connect_uri uri id = do
auth <- U.uriAuthority uri
sock <- socktype
let host = U.uriRegName auth
let port = U.uriPort auth
return $ connect host port sock id
where socktype
| U.uriScheme uri == "tcp:" = Just S.Stream
| otherwise = Nothing
@xrl
xrl / script.py
Created March 23, 2012 08:44
Mr. JC's fabulous script
#!/usr/bin/python
"""
This class is used to search the av.db file generated by Memoryze by Mandiant.
#ProTip: Ensure you enumerate strings in memory when you run Memoryze for best results.
This class takes two arguments:
The path to the av.db file
The string you are searching for
"""
from optparse import OptionParser
@xrl
xrl / config.log
Created March 6, 2012 07:50
Suricata Build Config
Suricata Configuration:
AF_PACKET support: no
PF_RING support: no
NFQueue support: no
IPFW support: no
DAG enabled: no
Napatech enabled: no
Prelude support: no
PCRE jit: yes
@xrl
xrl / rake.log
Created October 17, 2011 01:58
RVM rbx build error
one:~ xavierlange$ cat rake.log
[2011-10-16 18:49:53] /Users/xavierlange/.rvm/wrappers/ruby-1.8.7-p352/rake install
/Users/xavierlange/.rvm/rubies/ruby-1.8.7-p352/bin/ruby vm/codegen/config_vars.rb vm/gen/config_variables.h
GEN vm/gen/config_variables.h
/Users/xavierlange/.rvm/rubies/ruby-1.8.7-p352/bin/ruby vm/codegen/encoding_extract.rb /Users/xavierlange/.rvm/src/vendor/onig vm/gen/encoding_database.cpp
/Users/xavierlange/.rvm/rubies/ruby-1.8.7-p352/bin/ruby vm/codegen/field_extract.rb vm/builtin/basicobject.hpp vm/builtin/object.hpp vm/builtin/integer.hpp vm/builtin/fixnum.hpp vm/builtin/array.hpp vm/builtin/bignum.hpp vm/builtin/executable.hpp vm/builtin/access_variable.hpp vm/builtin/alias.hpp vm/builtin/block_environment.hpp vm/builtin/block_as_method.hpp vm/builtin/bytearray.hpp vm/builtin/chararray.hpp vm/builtin/io.hpp vm/builtin/channel.hpp vm/builtin/module.hpp vm/builtin/class.hpp vm/builtin/compiledmethod.hpp vm/builtin/data.hpp vm/builtin/dir.hpp vm/builtin/exception.hpp vm/builtin/float.hpp v
@xrl
xrl / current_utc_time.c
Created August 17, 2011 00:02 — forked from jbenet/current_utc_time.c
work around lack of clock_gettime in os x
/*
author: jbenet
os x, compile with: gcc -o testo test.c
linux, compile with: gcc -o testo test.c -lrt
*/
#include <time.h>
#include <sys/time.h>
#include <stdio.h>
@xrl
xrl / output.log
Created August 9, 2011 02:43
merb-core/active_support false positives expanded
Finished in 52.6 seconds
1343 examples, 113 failures, 5 pending
Failed examples:
rspec ./spec/test/multipart_request_helper_spec.rb:51 # Merb::Test::MultipartRequestHelper#multipart_post should post to the create action
rspec ./spec/test/multipart_request_helper_spec.rb:56 # Merb::Test::MultipartRequestHelper#multipart_post should post to the create action with params
rspec ./spec/test/multipart_request_helper_spec.rb:62 # Merb::Test::MultipartRequestHelper#multipart_post should upload a file to the action using multipart
rspec ./spec/test/multipart_request_helper_spec.rb:83 # Merb::Test::MultipartRequestHelper#multipart_put should put to the update action multipart
rspec ./spec/test/multipart_request_helper_spec.rb:88 # Merb::Test::MultipartRequestHelper#multipart_put should put to the update action with multipart params
tureus_production@Crawler:~/app$ RBXOPT="-Xprofile -Xprofiler.graph" bundle exec rackup config.ru --env production
NOTE: Gem.cache is deprecated, use Gem::source_index. It will be removed on or after 2011-08-01.
Gem.cache called from /home/tureus_production/app/gems/rbx/1.8/gems/templater-1.0.0/lib/templater/discovery.rb:62.
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /usr/local/rvm/rubies/rbx-head/lib/rubygems.rb:1128.
NOTE: Gem::SourceIndex#each is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#each called from /home/tureus_production/app/gems/rbx/1.8/gems/templater-1.0.0/lib/templater/discovery.rb:62.
Loading init file from ./config/init.rb
Loading ./config/environments/production.rb
Logging to file at ./log/production.log
@xrl
xrl / so_slow.txt
Created July 3, 2011 07:44
Merb app startup
tureus_production@Crawler:~/app$ RBXOPT=-Xprofile bundle exec rackup config.ru --env production
NOTE: Gem.cache is deprecated, use Gem::source_index. It will be removed on or after 2011-08-01.
Gem.cache called from /home/tureus_production/app/gems/rbx/1.8/gems/templater-1.0.0/lib/templater/discovery.rb:62.
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /usr/local/rvm/rubies/rbx-head/lib/rubygems.rb:1128.
NOTE: Gem::SourceIndex#each is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#each called from /home/tureus_production/app/gems/rbx/1.8/gems/templater-1.0.0/lib/templater/discovery.rb:62.
Loading init file from ./config/init.rb
Loading ./config/environments/production.rb
Logging to file at ./log/production.log
@xrl
xrl / rubinius_profiler_show
Created July 3, 2011 06:19
Profiling merb's boot
Total running time: 0.000362175s
% cumulative self self total
time seconds seconds calls ms/call ms/call name
------------------------------------------------------------
96.44 0.00 0.00 1 0.08 0.08 Object::__script__<28> {}
3.56 0.00 0.00 1 0.00 0.00 Class#allocate
2 methods called a total of 2 times
Total running time: 0.000362175s
exp = functioncall | prefixexp | function | tableconstructor | exp binop exp | unop exp | "nil" | "false" | "true" | number | string | "..."