pyvenv-3.3 venvdir
venvdir/bin/python -c 'import sys; print(sys.path)'
# This should print the venvdir in sys.path.
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
#!/bin/sh | |
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the | |
# CREATE block and create them in separate commands _after_ all the INSERTs. | |
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk. | |
# The mysqldump file is traversed only once. | |
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite | |
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite |
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
import ldap | |
def check_credentials(username, password): | |
"""Verifies credentials for username and password. | |
Returns None on success or a string describing the error on failure | |
# Adapt to your needs | |
""" | |
LDAP_SERVER = 'ldap://xxx' | |
# fully qualified AD user name | |
LDAP_USERNAME = '%s@xxx.xx' % username |
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
Questa è una traduzione in italiano del celebre Hacker Manifesto. Tutte quelle | |
esistenti contengono grossolani errori, perlopiù dovuti ad una carente | |
comprensione della materia e del periodo, o in ogni caso sono poco fedeli al | |
contenuto e allo spirito dell'originale. Mi auguro che questa mia traduzione non | |
soffra degli stessi problemi. Sail strong. | |
-- FiloSottile | |
**** | |
Da: Phrack, Volume Uno, Issue 7, Phile 3 of 10 |
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.install gource using HomeBrew | |
$ brew install gource | |
# 2.install avconv | |
git clone git://git.libav.org/libav.git | |
cd libav | |
# it will take 3-5 minutes to complie, be patient. | |
./configure --disable-yasm | |
make && make install |
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 is the background code... | |
// listen for our browerAction to be clicked | |
chrome.browserAction.onClicked.addListener(function (tab) { | |
// for the current tab, inject the "inject.js" file & execute it | |
chrome.tabs.executeScript(tab.ib, { | |
file: 'inject.js' | |
}); | |
}); |
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
<html> | |
<head> | |
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" /> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.js"></script> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/openlayers/2.13.1/OpenLayers.js"></script> | |
<script> | |
var map = null; | |
var macroarea = null; |
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
""" | |
Model of a Zombie outbreak in France, starting in Grenoble | |
This is a rewrite from this blog post by Max Berrgren: | |
http://maxberggren.github.io/2014/11/27/model-of-a-zombie-outbreak/ | |
with a different country, a slightly different model, and different | |
libraries. The map of population density is taken from Wikimedia Commons |
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
import requests # http://docs.python-requests.org/en/latest/ | |
import json | |
def upsert_records(records, ckan_url, resource_id, ckan_api_key=None): | |
"""Send a list of records to CKAN Datastore and return a requests.Response | |
object (see http://docs.python-requests.org/en/latest/api/#requests.Response). | |
Example: | |
url = "http://mysite.org/ckan" | |
resource_id = "7d33cafe-0118-4b9a-8d8d-e82d1935e2ea" |
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
FRAME_COUNT = 10 ; constant for the nbr of sprite frames you have | |
.frame_counter !byte .FRAME_COUNT ; variable to keep track of how far through the animation we are | |
SPRITE_INITIAL_DATA_POINTER = 128 ; sprite data will be read by VIC-II at 128*64 ($2000) | |
on_screen_refresh | |
dec .frame_counter ; frame_counter variable -= 1 | |
bne .increment_sprite_pointer ; if frame_counter > 0, goto .increment_sprite_pointer... | |
lda #SPRITE_INITIAL_DATA_POINTER ; ... otherwise, we should reset to the start of the animation | |
sta $07f8 ; reset the sprite pointer to start of sprite data | |
ldx #FRAME_COUNT |
OlderNewer