Skip to content

Instantly share code, notes, and snippets.

@kazkansouh
kazkansouh / cookie.py
Created September 28, 2018 14:30
Calculate password from cookie for Cisco router
@kazkansouh
kazkansouh / svgtopngs.sh
Created July 27, 2018 23:16
Generate a range of PNG images of varying sizes from an SVG image
#! /bin/bash
WIDTHS="32 64 128 256 512 1024"
if test -z "$#" -o "$#" -ne 1 -o ! -f "$1" ; then
1>&2 echo "Usage: " `basename $0` " <SVGFILE>"
exit 1
fi
@kazkansouh
kazkansouh / blender_extrude.py
Created May 28, 2018 08:30
Python function for Blender to automate the process of repeated extruding, rotation and scaling of a given face.
def extrude(step = 5, start = 0, end = 360, minimum_width = 0.5, hstep = 1, rotation = 2) :
"""Extrude, rotate and scale at same time. Before calling, select the
face that this should be applied in the 3d view.
"""
K = (sin(radians(start)) + 1 + minimum_width)
for x in range(start + step, end, step) :
bpy.ops.mesh.extrude_region_move(TRANSFORM_OT_translate={"value":(0,0,hstep)})
bpy.ops.transform.rotate(value=radians(rotation), axis=(0, 0, 1))
L = (sin(radians(x)) + 1 + minimum_width)