Skip to content

Instantly share code, notes, and snippets.

@wils0ns
wils0ns / stubs.py
Last active September 16, 2023 16:02
pytest monkeypatch mock stub asyncio.create_subprocess_exec
import asyncio
import re
from dataclasses import dataclass
from os import PathLike
from typing import List
class StubAsyncProcess(asyncio.subprocess.Process):
predefined_returncode = 0
predefined_communicate_return = (b"", b"")
@wils0ns
wils0ns / gist:29c3e4d13050c264f22e77d710eae93d
Last active June 30, 2018 17:23
pacman: remove outdated orphan packages
pacman -Rns $(pacman -Qtdq)
@wils0ns
wils0ns / download_cacert
Created March 26, 2018 16:04
download cert from https server
openssl s_client -showcerts -connect example.com:443 </dev/null 2>/dev/null|openssl x509 >the_cert.crt
@wils0ns
wils0ns / .vimrc
Last active April 2, 2018 16:28
arch workstation setup
syntax on
filetype plugin indent on
set expandtab
set nopaste
set autoindent
set clipboard+=unnamed
set colorcolumn=120
set nocompatible
set path+=**
apt-get install apt-transport-https software-properties-common
wget -O - https://erepo.saltstack.com/sse/4.2/ubuntu/SALTSTACK-GPG-KEY.pub | sudo apt-key add -
echo "deb https://erepo.saltstack.com/sse/4.2/ubuntu/ xenial main" >> /etc/apt/sources.list.d/saltstack.list