Skip to content

Instantly share code, notes, and snippets.

View waynew's full-sized avatar
💭
Making the world a little Saltier - one grain at a time

Wayne Werner waynew

💭
Making the world a little Saltier - one grain at a time
View GitHub Profile
@waynew
waynew / whoa.jinja
Last active May 10, 2022 20:22
Just a ridiculous thing to check jinja template stuff in Salt
{% from 'derp' import derp %}
{%- set x = 42 %}
Hello {{ x }} {{ derp }}
@waynew
waynew / cert.txt
Created April 27, 2020 20:47
bad fidelity cert
CONNECTED(00000003)
---
Certificate chain
0 s:C = --, ST = SomeState, L = SomeCity, O = SomeOrganization, OU = SomeOrganizationalUnit, CN = localhost.localdomain, emailAddress = root@localhost.localdomain
i:C = --, ST = SomeState, L = SomeCity, O = SomeOrganization, OU = SomeOrganizationalUnit, CN = localhost.localdomain, emailAddress = root@localhost.localdomain
-----BEGIN CERTIFICATE-----
MIIDPzCCAqigAwIBAgICE70wDQYJKoZIhvcNAQEFBQAwgbsxCzAJBgNVBAYTAi0t
MRIwEAYDVQQIDAlTb21lU3RhdGUxETAPBgNVBAcMCFNvbWVDaXR5MRkwFwYDVQQK
DBBTb21lT3JnYW5pemF0aW9uMR8wHQYDVQQLDBZTb21lT3JnYW5pemF0aW9uYWxV
bml0MR4wHAYDVQQDDBVsb2NhbGhvc3QubG9jYWxkb21haW4xKTAnBgkqhkiG9w0B
@waynew
waynew / Fun wrapping times
Created August 20, 2019 20:48
Just some samples about wrapping code with decorators
import functools
def bloop(arg):
def wrapper(func):
@functools.wraps(func)
def f(*args, **kwargs):
print('le func name:', func.__name__, 'le func:', func)
return func(*args, **kwargs)
return f
@waynew
waynew / threadfun.py
Created April 30, 2019 16:54
Fun Thread-a-licious
import time
import random
from threading import Thread, currentThread, Event
lines = 1
def show_stuff(evt):
global lines
count = 0
while not evt.is_set():
@waynew
waynew / keybase.md
Created October 4, 2018 14:22
Privacy is better

Keybase proof

I hereby claim:

  • I am waynew on github.
  • I am waynew (https://keybase.io/waynew) on keybase.
  • I have a public key ASD0J56XI7kxpwVxCDdqZfA8fL3vXApRTmKgIs-2eqzMdAo

To claim this, I am signing this object:

@waynew
waynew / ftpserver.py
Created October 3, 2018 23:40 — forked from scturtle/ftpserver.py
simple ftp server by python
#!/usr/bin/env python2
# coding: utf-8
import os,socket,threading,time
#import traceback
allow_delete = False
local_ip = socket.gethostbyname(socket.gethostname())
local_port = 8888
currdir=os.path.abspath('.')
@waynew
waynew / something.py
Created March 27, 2018 13:53
Helping someone on SO
import io
f = io.StringIO('''
Subnet - 2.48.2.0:
51=691200
3=2.48.2.1
15=dc.xyz.com
6=2.48.113.188,165.72.12.2
5=2.48.113.188,165.72.12.2
43=3a020064ff
#from math import floor
#
#LIMIT = 1000
#
#prime_list = []
#list_primes2 = [True for x in range(LIMIT)]
#list_primes2[0], list_primes2[1] = False, False
#
#for index, value in enumerate(list_primes2):
# if value:
clone-dev-repo:
git.latest:
- name: git@gitlab.com:myrepo/website.git
- rev: dev
- target: /srv/mything/dev
- user: mything
- identity: /srv/mything/.ssh/id_rsa