Skip to content

Instantly share code, notes, and snippets.

View moozer's full-sized avatar

moozer moozer

View GitHub Profile
@moozer
moozer / config_example.py
Created June 9, 2018 22:40
Example of using yaml file as config file
# if not installed, use
# apt-get install python3-yaml
# or
# pip3 install python-yaml
import yaml
def read_config( filename ):
with open(filename, 'r') as f:
return yaml.load(f)
@moozer
moozer / check-domain.sh
Created February 23, 2018 19:06
bash script for mail related DNS lookups
#!/bin/sh
if [ "x" = "x$1" ]; then
echo "usage: $0 <domain>"
exit 1
fi
DOMAIN=$1
echo "Mail servers (MX)"
@moozer
moozer / install_vmware.sh
Created January 9, 2018 21:46
An install script to install vmware workstation with modules on debian
#!/bin/sh
echo Download the latest vmware workstation from here:
echo https://my.vmware.com/web/vmware/info?slug=desktop_end_user_computing%2Fvmware_workstation_pro%2F12_0
echo Installing latest bundle from current dir
BUNDLEFILE=$(ls -1tr VMware-Workstation-Full-*| tail -n 1)
if [ "x$BUNDLEFILE" == "x" ];
then
@moozer
moozer / gist:96d9118c03d1742b3e18ad1e15edb346
Created December 15, 2017 23:58
Setting colors on a Cosna LED speaker
# -*- coding: utf-8 -*-
import bluetooth
import serial
import time
import binascii
# bytes:
# 1 length: 0x0a
# 2 random: r
# 3 c_-94 xor r
@moozer
moozer / matrix-post-msg.py
Last active September 29, 2017 08:54
script for posting messages on matrix
#
# matrix-post-msg
# minimal csript to post stuff on matrix
#
# Uses a yml config file:
# user: someuser
# password: somepass
# server: https://matrix.org
#
# To send a message
@moozer
moozer / Docker
Last active May 10, 2017 18:17
testtest
Test
@moozer
moozer / gist:773439d45b4bf645583632e708c6dbe5
Created August 18, 2016 21:11
Disk space error when installing a box
$ vagrant box add moozer/win10==> box: Loading metadata for box
'moozer/win10'
box: URL: https://atlas.hashicorp.com/moozer/win10
==> box: Adding box 'moozer/win10' (v0.1.2) for provider: libvirt
box: Downloading:
https://atlas.hashicorp.com/moozer/boxes/win10/versions/0.1.2/providers/libvirt.box
The box failed to unpackage properly. Please verify that the box
file you're trying to add is not corrupted and try again. The
output from attempting to unpackage (if any):

Keybase proof

I hereby claim:

  • I am moozer on github.
  • I am moozer (https://keybase.io/moozer) on keybase.
  • I have a public key whose fingerprint is 8849 BF92 E149 EEAB B2BD A019 1D6B 8D39 DF5E 05A8

To claim this, I am signing this object:

- name: handler B
debug: msg="Handler B"
@moozer
moozer / pingcheck.sh
Created January 13, 2016 10:27
ping check - simple bash script to ping host list from file
#!/bin/bash
# googling
# "bash read line by line from file"
# gave me this:
# http://stackoverflow.com/questions/10929453/bash-scripting-read-file-line-by-line
# file which contains one hostname or ip per line
FILENAME="hosts"