Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)
First one found from of
sudo dnf install cmake libusb-devel rtl-sdr-devel | |
git clone https://github.com/merbanan/rtl_433.git | |
cd rtl_433/ | |
mkdir build | |
cd build | |
cmake ../ | |
make | |
cd src | |
./rtl_433 |
while true | |
do | |
lsof -i -P -n ':389 ' | |
sleep 1 | |
done |
lsof | grep nginx | grep /var/ | sed 's|.* /|/|' | sort -u |
Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)
First one found from of
#! /bin/env python | |
# | |
# USAGE | |
# $ python ad_utils.py "My Group Name" | |
# | |
# Author: | |
# Trinh Nguyen | |
# dangtrinhnt@gmail.com | |
# www.dangtrinh.com |
#!/bin/bash | |
# | |
# Ansible role test shim. | |
# | |
# Usage: [OPTIONS] ./tests/test.sh | |
# - distro: a supported Docker distro version (default = "centos7") | |
# - playbook: a playbook in the tests directory (default = "test.yml") | |
# - cleanup: whether to remove the Docker container (default = true) | |
# - container_id: the --name to set for the container (default = timestamp) | |
# - test_idempotence: whether to test playbook's idempotence (default = true) |
var vCenters=VcPlugin.allSdkConnections; | |
for each (vCenter in vCenters){ | |
System.log(vCenter.name); | |
var clusters = vCenter.getAllClusterComputeResources(); | |
for each (cluster in clusters) { | |
System.log(cluster.name); | |
var vms = vCenter.allVirtualMachines | |
for each (vm in vms) | |
System.log(vm.name); |
// Retrieve the machine properties ------------------ | |
var machine = payload.get("machine"); | |
if(machine == null) { | |
throw("no machine found in payload, burn with fire!"); | |
} | |
var machineProperties = machine.get('properties'); | |
vmName = machine.get('name'); // vra vm hostname | |
// Find vcacVm and its relatives --------------------- | |
var virtualMachineId = machine.get("id"); |
removeAllSnapshots(){ | |
vim-cmd vmsvc/getallvms | grep -v Vmid | awk '{print $1":"$2}' | grep '^[0-9]' | while read VM | |
do | |
VMID=$(echo $VM | cut -d: -f1) | |
vmName=$(echo $VM | cut -d: -f2) | |
echo "INFO: `date '+%Y.%m.%d_%H:%M'`: search Snapshots of VM: $vmName ---" | |
vim-cmd vmsvc/get.snapshot $VMID | grep -A5 'snapshot = ' | sed '/id =/!d;s/.*id = //g;s/,//g' | while read SNAPID | |
do | |
echo exec: vim-cmd vmsvc/snapshot.remove $VMID $SNAPID | |
vim-cmd vmsvc/snapshot.remove $VMID $SNAPID |
thincopy (){ | |
FROM="$1" | |
TO="$2" | |
mkdir -p "$TO" | |
echo "INFO: tincopy $FROM/ $TO/$F" | |
find "$FROM" -type f -not -iname '*.vmdk' -exec cp -a "{}" "$TO/" \; | |
find "$FROM" -type f -iname '*.vmdk' | while read vmdk | |
do | |
F="`basename $vmdk`" | |
vmkfstools -i "$vmdk" -d thin "$TO/$F" |