Skip to content

Instantly share code, notes, and snippets.

View evandrix's full-sized avatar
💭
offline

evandrix evandrix

💭
offline
View GitHub Profile
@evandrix
evandrix / rudix.py
Created July 15, 2011 23:38
/usr/local/bin/rudix fix
# add try-catch block to ignore exceptions raised from re.findall()
def get_versions_for_package(pkg):
'Get a list of available versions for package'
pkg = denormalize(pkg)
content = urlopen('http://code.google.com/p/rudix/downloads/list?q=Filename:%s' % pkg).read()
try:
urls = re.findall('(rudix.googlecode.com/files/(%s-([\w.]+(?:-\d+)?(?:.i386)?)(\.dmg|\.pkg)))' % pkg, content)
versions = sorted(list(set(urls)), cmp=lambda x, y: version_compare(x[2], y[2]))
@evandrix
evandrix / README
Created July 21, 2011 13:17
TracPlugin: "Hello World" (/helloworld-plugin) @ http://trac-hacks.org/wiki/EggCookingTutorialTrac0.11
=== Directory tree structure
+-helloworld-plugin/
|
+-helloworld/
| |
| +-__init__.py
| |
| +-templates/
| | |
@evandrix
evandrix / README
Created July 22, 2011 15:05
TracPlugin: Minimal implementation
+-plugin-log/
|
+-logpackage/
| |
| +-__init__.py
| |
| +-logplugin.py
|
+-setup.py
Select Transformation
Invert Transformation
End Transformation
Empty Transformation
Remove Transformation
Unwrap Transformation
Wrap Transformation
Trace Transformation
Filter Transformation
Map Transformation
How to use Google Charts API with 6 examples
Few months ago I had a good look into Google Charts API and it was great! If you are not aware, Google Charts API basically allows you to create pretty graphs simply by using an URL with correct parameters specified. It is fairly flexible, with many things you can change and customise - which is where it becomes bit complicated. It is quite easy to generate a chart, but it wasn't as easy to generate the exact chart I needed. So below are 6 examples charts with explanations and tips that will hopefully help you understand Google Charts better.
A few notes before I start
The data/labels for all the graphs here have no meaning at all - just examples that I have come up with.
I'll explain each parameter probably only once (since they are generally the same across all graphs). If something is different or special I'll explain it again.
If you have any other tips/hints please share
Netragard’s Hacker Interface Device (HID). Category: Hardware, Healthcare,
penetration test, Realistic Threat, Research, Software, Total Infrastructure
Compromise / Tag: Adrian Crenshaw, Healthcare, malware, Mouse, Netragard,
penetration test, Prion, Teensy, USB / Add Comment Author: Adriel Desautels We
(Netragard) recently completed an engagement for a client with a rather restricted
scope. The scope included a single IP address bound to a firewall that offered no
services what so ever. It also excluded the use of social attack vectors based on
social networks, telephone, or email and disallowed any physical access to the
campus and surrounding areas. With all of these limitations in place, we were
tasked with penetrating into the network from the perspective of a remote threat,
@evandrix
evandrix / solution.pl
Created July 29, 2011 22:44 — forked from dmn001/Dropbox-Diet Solution
Dropbox Challenge - 3 The Dropbox Diet
#!/usr/bin/perl
use strict;
# dmn001 <at> gmail
# 31/01/2011
my %pos;
my %neg;
my $num_lines = <STDIN>;
while (<STDIN>){
@evandrix
evandrix / solution.py
Created July 29, 2011 22:33
Dropbox Challenge - 1 Packing Your Dropbox
#!/usr/bin/python
"""
Amar Pai (jcruelty@gmail.com)
Solution to Dropbox challenge - Packing Your Dropbox
http://www.dropbox.com/jobs/challenges#packing-your-dropbox
I've had this problem on the brain and have been unable to
stop thinking about it, so I finally hacked out a rudimentary
@evandrix
evandrix / gist:1124922
Created August 4, 2011 10:30
Python String API
# a look at strings and methods
# tested with Python23 vegaseat 23jan2005
print "Fill an empty string:"
empty_string = ""
for k in range(65, 91):
empty_string += chr(k)
print empty_string
print "\nOriginal string (California humor):"
This grid shows the restaurants in Hamburg which have E la Carte units ("Prestos") installed in
them. The Ps in the grid represent restaurants with Prestos installed ("Prestorants"). Os
represent restaurants without prestos.
Alyssa P. Hacker from the E la Carte ops team wants to count the number of restaurants in the
largest contiguous rectangular block of Prestorants. What is the number that she comes up with?
Answer: __44__
top-left corner: (15, 5742)