This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# EasyColors | |
if [ ${libout_color:-1} -eq 1 ]; then | |
DEF_COLOR="\x1b[0m" | |
BLUE="\x1b[34;01m" | |
CYAN="\x1b[36;01m" | |
GREEN="\x1b[32;01m" | |
RED="\x1b[31;01m" | |
GRAY="\x1b[37;01m" | |
YELLOW="\x1b[33;01m" | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"variables": { | |
"vsphere_host": "vcenter65-1.vghetto.local", | |
"vsphere_user": "administrator@vghetto.local", | |
"vsphere_pass": "VMware1!", | |
"vsphere_datacenter": "Datacenter", | |
"vsphere_cluster": "\"VSAN-Cluster\"", | |
"vsphere_datastore": "virtual_machines", | |
"vsphere_network": "\"VM Network\"" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- 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 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM arm32v6/alpine:latest | |
RUN apk --no-cache add \ | |
bash \ | |
python3 \ | |
python3-dev \ | |
build-base \ | |
vim \ | |
git \ | |
curl \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -x | |
# Localse, uncomment if user-data didn't fix these | |
export LANGUAGE=en_US.UTF-8; export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8; locale-gen en_US.UTF-8 | |
# Set locale to en_US.UTF-8 | |
sudo cp /etc/locale.gen /etc/locale.gen.dist | |
sudo sed -i -e "/^[^#]/s/^/#/" -e "/en_US.UTF-8/s/^#//" /etc/locale.gen |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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 |