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
# 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])) |
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
=== Directory tree structure | |
+-helloworld-plugin/ | |
| | |
+-helloworld/ | |
| | | |
| +-__init__.py | |
| | | |
| +-templates/ | |
| | | |
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
+-plugin-log/ | |
| | |
+-logpackage/ | |
| | | |
| +-__init__.py | |
| | | |
| +-logplugin.py | |
| | |
+-setup.py |
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
Select Transformation | |
Invert Transformation | |
End Transformation | |
Empty Transformation | |
Remove Transformation | |
Unwrap Transformation | |
Wrap Transformation | |
Trace Transformation | |
Filter Transformation | |
Map Transformation |
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
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 |
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
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, |
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/perl | |
use strict; | |
# dmn001 <at> gmail | |
# 31/01/2011 | |
my %pos; | |
my %neg; | |
my $num_lines = <STDIN>; | |
while (<STDIN>){ |
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/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 |
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
# 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 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
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) |