Skip to content

Instantly share code, notes, and snippets.

View silicontrip's full-sized avatar
💭
Less for Powershell

Mark Heath silicontrip

💭
Less for Powershell
View GitHub Profile
@silicontrip
silicontrip / jpg2exr.py
Created February 12, 2018 06:05
convert jpg 2 exr with ability to apply brightness curve
#!/usr/bin/python
import OpenEXR
import cv2
import sys
import array
def srgb2lin(px):
ft = px / 255.0
if ft < 0.04045:
@silicontrip
silicontrip / jpg2exr.py
Created February 12, 2018 06:05
convert jpg 2 exr with ability to apply brightness curve
#!/usr/bin/python
import OpenEXR
import cv2
import sys
import array
def srgb2lin(px):
ft = px / 255.0
if ft < 0.04045:
@silicontrip
silicontrip / repo_cp.py
Created January 6, 2018 02:12
copy utility that checks that the file doesn't exist within the destination directory tree
#!/usr/bin/python
import sys
import os
import json
import shutil
import hashlib
import atexit
from threading import Thread
@silicontrip
silicontrip / gist:740ec68ee124a567bdd6e0aad6476d3e
Last active January 15, 2019 07:03
Freecad python Dalek shoulders
from FreeCAD import Base
import Part
import Sketcher
def xsection(obj,height):
wires=[]
for i in obj.slice(Base.Vector(0,0,1),height):
wires.append(i)
return Part.Wire(wires)
from FreeCAD import Base
import Part
import Sketcher
import time
def xsection(obj,height):
wires=[]
for i in obj.slice(Base.Vector(0,0,1),height):
wires.append(i)
#!/usr/bin/python
import os
import sys
import hashlib
def get_files(path):
fl = os.walk(path)
allfiles=[]
for pp,pd,pf in fl:
task 1 remove duplicates;
make list of duplicates
duplicate_list[] = file[2]
for duplicate_list:
# get both parents of each file.
path1 = file[0].parent
path2 = file[1].parent
#/bin/bash
while true
do
homeuuid=$(grep '/home' /etc/fstab | awk '{print $1}' | cut -d = -f 2)
ssd=$(lsblk -o KNAME,MODEL | grep SSD | cut -d ' ' -f 1)
mounted=$(mount | grep /home | cut -d ' ' -f 1 )
ssduuid=$(ls -la /dev/disk/by-uuid | grep bcache0 | awk '{print $9}')
formatted=$( ls /dev/bcache0 )
base:
pkg.installed:
- pkgs:
- python-software-properties
- python
- g++
- make
- ruby1.9.1
- libav-tools
- npm