This file contains hidden or 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
[ | |
{ | |
"title": "Bye, privacy: Evernote will let its employees read your notes", | |
"date": "2016-12-14 21:44:00", | |
"link": "http://www.computerworld.com/article/3150291/security/bye-privacy-evernote-will-let-its-employees-read-your-notes.html", |
This file contains hidden or 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/bash | |
apt-get install libxml2-dev libssl-dev libffi-dev libxslt1-dev python-dev libjpeg-dev | |
pip freeze --local >pipfreeze.txt | |
tr '\n' ' ' < pipfreeze.txt >pipfreeze2.txt | |
pip install --upgrade --force-reinstall `cat pipfreeze2.txt` |
This file contains hidden or 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/bash | |
echo "Attempting to install debsums package" | |
apt-get install --reinstall -y debsums | |
echo "." | |
echo "." | |
echo "." | |
echo "Running debsums to look for bad files. This will take a while." | |
debsums -cs 2>&1 >badfiles.txt | |
echo "." | |
echo "." |
This file contains hidden or 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 os | |
sourcedir = "h:\\D\\video" | |
destdir = "d:\\video" | |
def getfilelist(dirname): | |
filelist = {} | |
count = 0 | |
for root, dirs, files in os.walk(dirname): | |
for file in files: |
This file contains hidden or 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 optimize_css(directory): | |
import os | |
from csscompressor import compress | |
print("\tOptimizing CSS in " + directory) | |
file_paths = [] # List which will store all of the full filepaths. | |
# Walk the tree. | |
for root, directories, files in os.walk(directory): | |
for filename in files: | |
# Join the two strings in order to form the full filepath. | |
filepath = os.path.join(root, filename) |
This file contains hidden or 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 similar(a, b): | |
from difflib import SequenceMatcher | |
return SequenceMatcher(None, a, b).ratio() | |
def list_match(key, mylist): | |
mylist = list(set(mylist)) # Get unique values to speed processing | |
top_score = -1 | |
top_name = "" |
This file contains hidden or 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
=substitute(substitute(substitute(substitute(lower(B2) & "-" & lower(A2) & text(C2, "mmddyyyy"), " ", "-"), "’", ""), "'", ""),".", "") & ".jpg" | |
photofilename = (row['First name'] + "-" + row['Last name']).lower() | |
photofilename = photofilename + datetime.datetime.strftime(datetime.datetime.strptime(row['Date'], "%m-%d-%Y"), "%m%d%Y") | |
photofilename = photofilename.replace(" ", "-").replace("'", "").replace('"', '').replace("’", "").replace(".", "") | |
photofilename = photofilename + ".jpg" |
This file contains hidden or 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(B2<1000000,"$"&(ROUND((B2/1000000),1)&" thousand"),IF(B2>1000000000,"$"&(ROUND((B2/1000000000),1)&" billion"),"$"&(ROUND((B2/1000000),1)&" million"))) |
This file contains hidden or 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 csv | |
# data source is here https://dev.maxmind.com/geoip/geoip2/geoip2-csv-databases/ | |
# lat column = -2 | |
# long column = -1 | |
# Set up bounding box in a very bad way | |
minlat = 26.3 | |
maxlat = 27.52 |
This file contains hidden or 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/bash | |
### Note: Script for 12.02 linked from the docs is at a bad URL. Should be: | |
### https://raw.githubusercontent.com/pandaproject/panda/master/setup_panda.sh | |
# PANDA Project server setup script for Ubuntu 12.04 | |
# Must be executed with sudo! | |
set -x |