Skip to content

Instantly share code, notes, and snippets.

@asears
asears / Get-Types.ps1
Created April 19, 2020 10:47
Get Powershell Types
# Encapsulate custom definitions in Powershell XML
# https://blog.mwpreston.net/2020/01/06/working-with-custom-typenames-in-powershell/
# https://blog.mwpreston.net/2017/08/01/consuming-the-veeam-rest-api-in-powershell/
dir $pshome\*types.ps1xml -Recurse | Select-String System.Diagnostics.Process
@asears
asears / gpg_git_signing.md
Last active April 9, 2020 11:23 — forked from alopresto/gpg_git_signing.md
Steps to enable GPG signing of git commits.

On windows, git config --global gpg.program "C:\Program Files (x86)\GnuPG\bin\gpg.exe"

If anyone is interested in setting up their system to automatically (or manually) sign their git commits with their GPG key, here are the steps:

  1. Generate and add your key to GitHub
  2. $ git config --global commit.gpgsign true ([OPTIONAL] every commit will now be signed)
  3. $ git config --global user.signingkey ABCDEF01 (where ABCDEF01 is the fingerprint of the key to use)
  4. $ git config --global alias.logs "log --show-signature" (now available as $ git logs)
  5. $ git config --global alias.cis "commit -S" (optional if global signing is false)
  6. $ echo "Some content" >> example.txt
@asears
asears / tmux-cheatsheet.markdown
Created February 24, 2020 03:51 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@asears
asears / gen_video_interpolation.py
Created February 13, 2020 02:14 — forked from lzhbrian/gen_video_interpolation.py
generate interpolation video from stylegan2
"""
Author: lzhbrian (https://lzhbrian.me)
Date: 2020.1.20
Note: mainly modified from: https://github.com/tkarras/progressive_growing_of_gans/blob/master/util_scripts.py#L50
"""
import numpy as np
from PIL import Image
import os
import scipy
# git clone https://github.com/NVlabs/stylegan2
import os
import numpy as np
from scipy.interpolate import interp1d
from scipy.io import wavfile
import matplotlib.pyplot as plt
import PIL.Image
import moviepy.editor
import dnnlib
@asears
asears / rand.sh
Created February 6, 2020 01:51
Random Generator
#!/bin/sh
echo $RANDOM
openssl rand -base64 32
@asears
asears / projectfolders.md
Last active February 1, 2020 15:02
Project Folder Structure - from Initiation to Support, Training and Management - Scrumfall'ish

/Company/Client/Project/

01-Initiation
02-Requirements
03-Design
04-Develop
05-Test
06-Deploy
08-Training
09-Support

@asears
asears / fastimport.ipynb
Last active January 24, 2020 02:15
Fast import into Google colab
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@asears
asears / cudnn.ipynb
Created January 24, 2020 02:12
Get the cuDNN files
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@asears
asears / servit.py
Last active January 18, 2020 04:29
Simple local http.server with https enabled
from http.server import HTTPServer, SimpleHTTPRequestHandler
import ssl
httpd = HTTPServer(('localhost', 4443), SimpleHTTPRequestHandler)
httpd.socket = ssl.wrap_socket(httpd.socket, certfile='/tmp/cert-and-key.pem', server_side=True)
httpd.serve_forever()