Skip to content

Instantly share code, notes, and snippets.

View copyleftdev's full-sized avatar
🎯
Focusing

Don Johnson copyleftdev

🎯
Focusing
View GitHub Profile
#!/usr/bin/env python
# This tool will radom select articles from a wikipedia article select
# and radomly seed it with PII data
import random
import os
from faker import Factory
@copyleftdev
copyleftdev / rec_b2z.py
Last active February 19, 2016 20:39
recursivly decompress bz2 file
for filename in files:
filepath = os.path.join(dirpath, filename)
newfilepath = os.path.join(dirpath, filename + '.decompressed')
with open(newfilepath, 'wb') as new_file, bz2.BZ2File(filepath, 'rb') as file:
for data in iter(lambda : file.read(100 * 1024), b''):
new_file.write(data)
@copyleftdev
copyleftdev / Json.cs
Created November 24, 2015 20:39
C# des json
public void LoadJson()
{
using (StreamReader r = new StreamReader("file.json"))
{
string json = r.ReadToEnd();
List<Item> items = JsonConvert.DeserializeObject<List<Item>>(json);
}
}
public class Item
@copyleftdev
copyleftdev / TaskStatus.cs
Created November 14, 2015 17:02
TaskParser
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
namespace TaskManagerParser
{
public class TaskStatus
{
[XmlArrayItem("Id")]
public List<string> TaskIds { get; set; }
# Ansible playbook to install Java 7 on Debian
#
# Thanks to http://www.sysadminslife.com/linux/howto-oracle-sun-java-7-installation-unter-debian-6-squeeze/
#
# Author: Gabriel Birke <gb@birke-software.de>
- hosts: devroot
vars:
java_download: http://download.oracle.com/otn-pub/java/jdk/7u45-b18/jdk-7u45-linux-x64.tar.gz
java_name: jdk1.7.0_45

Transparent Git Encryption

This document has been modified from its [original format][m1], which was written by Ning Shang (geek@cerias.net). It has been updated and reformatted into a [Markdown][m2] document by [Woody Gilk][m3] and [republished][m4].

Description

When working with a remote git repository which is hosted on a third-party storage server, data confidentiality sometimes becomes

@copyleftdev
copyleftdev / gist:8fc7d682839e9941089b
Created December 11, 2014 04:01
encrypt & Decrypt via openssl
Encrypt
openssl enc -aes-256-cbc -salt -in dons_cool_file.tgz -out dons_output.dat
Decrypt
openssl enc -d -aes-256-cbc -in dons_output.dat >dons_cool_file.tgz
@copyleftdev
copyleftdev / gist:f7acdaba18ba01647451
Created December 7, 2014 19:29
Install OpenCV Ubuntu 14.04 LTS

Installing OpenCV with Python Bindings

Ubuntu 14.04

upgrade

sudo apt-get update sudo apt-get upgrade

install dependencies

@copyleftdev
copyleftdev / gist:a66d9b132a1cec5a28ea
Last active August 29, 2015 14:10
Install OpenCV on OSX with python bindings

Installing OpenCV with Python Bindings

OSX Install instructions

Install Homebrew

$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# MICROSOFT DOCX GENERATOR
# REQUIRMENTS
# https://github.com/mikemaccana/python-docx.git
# pip install lxml PIL
from docx import *
import os
import tarfile
import time
import shutil