Skip to content

Instantly share code, notes, and snippets.

bunchc

Block or report user

Report or block bunchc

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:50596421c9ba8bd4f4696991a9e3d05f
---
- name: Create a partition with drive letter D and size 1020 GiB
hosts: "{{host}}"
tasks:
- name: do the thing
win_partition:
drive_letter: D
partition_size: 1020 GiB
disk_number: 2
@bunchc
bunchc / hub_ctrl.py
Created Feb 11, 2019
There Are Door Lights - hub_ctrl mods
View hub_ctrl.py
def send_command(listing, busnum, devnum, hub, port, value, verbose):
""" send_command(self, parameter_list)
Sends the power control command to the USB hub.
"""
if hub == None and busnum == None:
hub = 0 # Default hub = 0
cmd = COMMAND_SET_POWER
@bunchc
bunchc / door_sensor.py
Last active Feb 11, 2019
There Are Door Lights - Light Sensor
View door_sensor.py
from gpiozero import LightSensor
import hub_ctrl
sensor = LightSensor(4)
print(sensor.light_detected)
while True:
# sensor.when_light = hub_ctrl.send_command(listing=True, busnum=1, devnum=2, hub=None, port=2, value=1, verbose=False)
sensor.wait_for_light()
hub_ctrl.send_command(listing=True, busnum=1, devnum=2, hub=None, port=2, value=1, verbose=False)
@bunchc
bunchc / hub_ctrl.py
Created Feb 11, 2019
There Are Four Lights - USB Control
View hub_ctrl.py
#! /usr/bin/python
"""
hub_ctrl.py - a tool to control port power/led of USB hub
Copyright (C) 2006, 2011, 2016 Free Software Initiative of Japan
Author: NIIBE Yutaka <gniibe@fsij.org>
This file is a part of Gnuk, a GnuPG USB Token implementation.
@bunchc
bunchc / Dockerfile
Last active Feb 11, 2019
There Are Door Lights
View Dockerfile
FROM arm32v6/alpine:latest
RUN apk --no-cache add \
bash \
python3 \
python3-dev \
build-base \
vim \
git \
curl \
@bunchc
bunchc / ansible_python_interpreter
Created Oct 11, 2018
Using /etc/ansible/group_vars/all
View ansible_python_interpreter
```
2018-10-11 16:23:40 ⌚ bunchc in ~
○ → ansible -m setup 10.208.135.122 | grep ansible_python_version
"ansible_python_version": "3.6.6",
2018-10-11 16:24:00 ⌚ bunchc in ~
○ → cat /etc/ansible/group_vars/all
---
ansible_python_interpreter: /usr/bin/python3
View gist:8afce8a4fe2f1bbaf352512a6a23a2bc
1) Create a branch with the tag
git branch {tagname}-branch {tagname}
git checkout {tagname}-branch
2) Include the fix manually if it's just a change ....
git add .
git ci -m "Fix included"
or cherry-pick the commit, whatever is easier
git cherry-pick {num_commit}
@bunchc
bunchc / cloudbase-init.conf
Created Jun 14, 2018
My cloudbase-init.conf file
View cloudbase-init.conf
[DEFAULT]
# If set to true, the logging level will be set to DEBUG instead of
# the default INFO level.
debug=true
# If set to false, the logging level will be set to WARNING instead
# of the default INFO level.
verbose=true
@bunchc
bunchc / install_adfs.ps1
Created May 9, 2018
Install and configure adfs with powershell
View install_adfs.ps1
$domainName = "{{ windows_domain_info['dns_domain_name'] }}"
$password = "{{ windows_domain_info['domain_admin_password'] }}"
$securePassword = ConvertTo-SecureString $password -AsPlainText -Force
$fqdn = [System.Net.Dns]::GetHostByName(($env:computerName)) | FL HostName | Out-String | %{ "{0}" -f $_.Split(':')[1].Trim() };
$filename = "C:\$fdqn.pfx"
$user = "{{ windows_domain_info['dns_domain_name'] }}\{{ windows_domain_info['domain_admin_user'] }}"
$credential = New-Object `
-TypeName System.Management.Automation.PSCredential `
-ArgumentList $user, $securePassword
View solarized-slack.js
function applycss(css){
var head = document.getElementsByTagName('head')[0];
var s = document.createElement('style');
s.setAttribute('type', 'text/css');
s.appendChild(document.createTextNode(css));
head.appendChild(s);
}
applycss(`
body { background: #002b36; color: #839496; }
a { color: #90939b; }
You can’t perform that action at this time.