Skip to content

Instantly share code, notes, and snippets.

View ironcamel's full-sized avatar

Naveed Massjouni ironcamel

  • Blacksburg, VA, USA
View GitHub Profile
@ironcamel
ironcamel / README.md
Last active August 29, 2015 13:58 — forked from dolmen/README.md
Check if you are vulnerable to the OpenSSL heartbleed bug.

Check if you are vulnerable to the OpenSSL « heartbleed » bug.

curl -s https://gist.githubusercontent.com/ironcamel/10223348/raw/ssl-heartbleed-check.pl | perl
@ironcamel
ironcamel / SimpleRequest.java
Created October 27, 2010 04:14
This is a comparison of making a simple http request with basic/digest authentication in perl and java. I was porting a perl app to the android platform (java) and was struck by the different amount of complexity and effort required.
import java.io.BufferedReader;
import java.io.InputStreamReader;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.impl.client.BasicCredentialsProvider;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.HttpRequest;
import org.apache.http.HttpResponse;
public class SimpleRequest {
use LWP::UserAgent;
my $agent = LWP::UserAgent->new();
$agent->credentials($host, $realm, $user, $pass);
print $agent->get($uri)->content();
@ironcamel
ironcamel / index.tt
Created December 20, 2010 09:01
A simple websocket web app using the Dancer web framework http://perldancer.org
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script>
var socket;
$(function() {
// ws_path should be of the form ws://host/_hippie/ws
var ws_path = "ws:<% request.base.opaque %>_hippie/ws";
x = 0
[1,2,3].each{|x| puts x}
puts x
@ironcamel
ironcamel / freenode.yml
Created March 29, 2011 22:14
IRC bot that notifies via libnotify popups and festival text-to-speech converter
conn_info:
server: irc.freenode.net
port: 6667
channels:
- '#foo'
- '#bar'
nick: foobot
username: foobot
name: defender of the universe
ignore_list:
/*
Treewidth is a class that reduces a graph by a series of "safe" rules.
It also generates a minimum value for the treewidth of the graph.
The rules that have been implemented so far are:
* Islet Rule
* Twig Rule
* Series Rule
* Triangle Rule
* Simplicial Rule
* Almost Simplicial Rule
@ironcamel
ironcamel / JSON-Schema.diff
Created September 10, 2011 23:22
JSON::Schema bugfix patch
235c235
< checkProp($value, $type, $path, undef, $_changing);
---
> $self->checkProp($value, $type, $path, undef, $_changing);
283c283
< checkProp($value, $schema->{'extends'}, $path, $i, $_changing);
---
> $self->checkProp($value, $schema->{'extends'}, $path, $i, $_changing);
304,306c304,307
< if (ref $schema->{'items'} eq 'ARRAY')
@ironcamel
ironcamel / script-runner.vim
Created September 15, 2011 04:47
vim script runner
nmap <F5> :call Run('perl')<CR>
cabbrev pyx call Run('python')
cabbrev perlx call Run('perl')
cabbrev rubyx call Run('ruby')
fu! NewThrowawayBuffer()
new
setlocal noswapfile
setlocal buftype=nowrite
setlocal bufhidden=delete
@ironcamel
ironcamel / p
Created September 25, 2011 02:12 — forked from mfontani/raptor.sh
steroids for your perl one-liners.
#!/usr/bin/env perl
# Based on Randy Stauner's http://blogs.perl.org/users/randy_stauner/2011/06/exploratory-one-liners-with-less-typing.html
# and Marco Fontani's https://gist.github.com/1042504.
# To install all dependencies:
# sudo cpanm File::Slurp JSON::XS Data::Dump YAML::XS utf8::all Class::Autouse
# Installation:
# copy this file to ~/bin/p
# Example usage:
# p 'dd [File::Spec->path]' # dynamically load arbitrary modules
# p -pe 's/foo/bar/' foo.txt # use your favorite options like -lane