Skip to content

Instantly share code, notes, and snippets.

View copyleftdev's full-sized avatar

L337[e8f223b2]SIGMA copyleftdev

View GitHub Profile
@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; }
@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 / 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)
#!/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
#!/usr/bin/env python
import random
import os
from faker import Factory
import datetime
fake = Factory.create()
def getDocList(rootFoldr):
@copyleftdev
copyleftdev / bloom.sh
Created February 28, 2016 16:34
create subfolder for massive file set
i=1;while read l;do mkdir $i;mv $l $((i++));done< <(ls|xargs -n100)
@copyleftdev
copyleftdev / folder_splitter.py
Created March 5, 2016 23:51 — forked from zupo/folder_splitter.py
Split a folder with many files into subfolders with N files. Usage: python folder_splitter.py path/to/target/folder
# -*- coding: utf-8 -*-
# @author: Peter Lamut
import argparse
import os
import shutil
N = 10 # the number of files in seach subfolder folder
@copyleftdev
copyleftdev / seedv2.py
Last active March 9, 2016 20:08
seedv2
#!/usr/bin/env/python
import os
import random
import shutil
from faker import Factory
fake = Factory.create()
"""
PII Seeding Utility
import os
from docx import Document
import uuid
def getDocList(rootFoldr):
filelst = []
for(dirpath, _, files) in os.walk(rootFoldr):
for filename in files:
filepath = os.path.join(dirpath, filename)
import re
import os
import fileinput
import uuid
def getDocList(rootFoldr):
filelst = []
for(dirpath, _, files) in os.walk(rootFoldr):
for filename in files: