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
use HTTP::Request::Common qw(POST); | |
use LWP::UserAgent; | |
use JSON; | |
my $webhook_url = 'your-webhook-url'; | |
my $default_channel = '#your-channel'; | |
my $ua = LWP::UserAgent->new; | |
$ua->timeout(15); |
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
self.address_list = [ | |
'221B Baker St.//London/OH', # Sherlock Holmes | |
'1313 Mockingbird Lane//Mockingbird Heights/CA', # The Munsters | |
'0001 Cemetery Lane//Chicago/IL', # The Adams Family | |
'344 Clinton St./Apt 3B/Metropolis/NY', # Clark Kent | |
'112.5 Beacon St.//Boston/MA', # Cheers | |
'742 Evergreen Terrace//Springfield/OR', # The Simpsons | |
'42 Wallaby Way//Sydney/WA', # Clownfish (Finding Nemo) | |
'508 Saint Cloud Road//Bel Air/CA', # Fresh Prince |
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
### Keybase proof | |
I hereby claim: | |
* I am darkpixel on github. | |
* I am darkpixel (https://keybase.io/darkpixel) on keybase. | |
* I have a public key whose fingerprint is 3ADF CE15 BA18 FA79 DB4A 4C9B F11F 3E8D DE4B A04C | |
To claim this, I am signing this object: |
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
# If you have a box running ZFS serving your Windows file shares, and someone gets hit with CryptoLocker, here's an easy way to restore individually encrypted files. | |
# Assuming your infected dataset is named 'tank/officeshare' | |
# Find a snapshot of your data before cryptolocker infected it and clone it (something like zfs clone tank/officeshare@good tank/officesharegood | |
# Find a snapshot of your data after cryptolocker infected everything, but *after* the infected machines were removed from the network and clone it (something like zfs clone tank/officeshare@bad tank/officesharebad) | |
#Go into the tank/officesharebad directory and run the following command to scan through the bad clone for the 'DECRYPT_INSTRUCTION.TXT' file left behind by cryptolocker, gather 'bad' directories, then grab all the files from them to restore to the current 'officeshare'. | |
#This command works on FreeNAS or BSD-ish boxes | |
find . -type f -name 'DECRYPT_INSTRUCTION.TXT' | sed 's/\/DECRYPT_INSTRUCTION.TXT//' | sed 's/^\.\///' | grep -v |
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
def cycle_key(self): | |
#TODO: Errors here will tank the system, probably need some better handling... | |
old_session_key = self.session_key | |
old_session = Session.objects.get(session_key=old_session_key) | |
try: | |
cart = Cart.objects.get(session=old_session) | |
super(SessionStore, self).cycle_key() | |
new_session_key = self.session_key | |
new_session = Session.objects.get(session_key=new_session_key) | |
cart.session = new_session |
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
def GenericCSVExport(qs, fields=None): | |
from django.db.models.loading import get_model | |
from django.http import HttpResponse, HttpResponseForbidden | |
from django.template.defaultfilters import slugify | |
import csv | |
model = qs.model | |
response = HttpResponse(mimetype='text/csv') | |
response['Content-Disposition'] = 'attachment; filename=%s.csv' % slugify(model.__name__) | |
writer = csv.writer(response) |
NewerOlder