Skip to content

Instantly share code, notes, and snippets.

View stemid's full-sized avatar

Stefan Midjich stemid

View GitHub Profile
@stemid
stemid / tsm.pm
Created May 27, 2015 13:45
Simple TSM perl interface made by an old co-worker
#!/usr/bin/perl -w
# Oskar Liljeblad 2008-10-17
package TSM;
use strict;
use Encode;
$TSM::dsmadmc = 'dsmadmc';
$TSM::username = 'admin';
@stemid
stemid / siptrack.py
Last active July 11, 2019 15:12
Ansible inventory script for Siptrack (https://github.com/sii/siptrackweb)
#!/usr/bin/env python
# Siptrack dynamic inventory script for Ansible.
# Depends on siptracklib
# * https://github.com/sii/siptracklib
#
#http://docs.ansible.com/ansible/latest/dev_guide/developing_inventory.html
#
# by Stefan Midjich <swehack at gmail dot com>
@stemid
stemid / password.go
Last active September 4, 2020 08:26
Create encrypted versions of passwords in go
// build: go build password.go
// run: ./password -password='clear text'
// use HISTCONTROL=ignoreboth and indent commands with one space to avoid
// saving passwords in your shell history.
package main
import (
"os"
"fmt"
@stemid
stemid / sex.c
Last active January 13, 2024 11:49
/*sex.c*/
/* Original author unknown. Presumably this is public domain by now.
* If you are the original author or know the original author, please
* contact <freebsd@spatula.net>
*
* Orphan code cleaned up a bit by Nick Johnson <freebsd@spatula.net>
* Completely rewrote how word wrapping works and added -w flag.
*/
@stemid
stemid / brew.py
Created July 24, 2012 14:07
Homebrew module for ansible
#!/usr/bin/python -tt
# (c) 2012, Stefan Midjich
# Written by Stefan Midjich <swehack@gmail.com>
#
# This module was written for Ansible.
# It doesn't support all of Homebrew yet.
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
@stemid
stemid / make_backup.sh
Created June 25, 2018 12:30
Backup script for my personal laptop
#!/usr/bin/env bash
# Simple backup script for borg. http://borgbackup.readthedocs.io/en/stable/
# Install on Fedora: sudo dnf install borgbackup
#
# Configure BORG_REPO below to match some path on your own system. In my case
# it points to an autofs mount on my network backup device.
# Configure your own borg_excludes.
# by Stefan Midjich <swehack at gmail dot com>
export BORG_REPO="/media/nas/backups/$(hostname -s)-borgbackup"