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
irb(main):001:0> require 'win32/file' | |
=> true | |
irb(main):002:0> f = File::Stat.new('C:\Program Files') | |
=> #<File::Stat archive=false atime=2014-02-26 14:52:59 -0700 blksize=4096 blockdev=false blocks=1 compressed=false ctime=2009-07-13 20:20:08 -0700 dev=2 encrypted=false gid=2271478464 hidden=false indexed=true ino=281474976710716 mode=040555 mtime=2014-02-26 14:52:59 -0700 nlink=1 normal=false offline=false rdev=1478858236 readonly=true reparse_point=false size=4096 sparse=false system=false temporary=false uid=2271478464 | |
irb(main):003:0> f.directory? | |
=> true | |
irb(main):004:0> f.writable? | |
=> false | |
irb(main):008:0> f.send(:access_check, 'C:\Program Files', 0x40000000) # GENERIC_WRITE | |
=> true |
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
require 'chef/handler' | |
require 'chef/rest' | |
require 'chef/version_constraint' | |
class Chef | |
class RemoteFile | |
class CacheHandler < ::Chef::Handler | |
attr_reader :config |
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
Host * | |
ControlMaster auto | |
ControlPath ~/.ssh/tmp/%h_%p_%r | |
TCPKeepAlive yes | |
ServerAliveInterval 30 | |
ConnectTimeout 15 | |
LogLevel ERROR | |
Host jumphost | |
HostName ${JUMPHOST_IP} |
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
# This keeps any cookbook aside from our target cookbook from actually loading recipes | |
class Chef | |
class CookbookVersion | |
alias_method :old_load_recipe, :load_recipe | |
def load_recipe(recipe_name, run_context) | |
old_load_recipe(recipe_name, run_context) if metadata.name == 'cookbook_name' | |
end | |
end | |
end |
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
#cloud-config | |
coreos: | |
etcd: | |
discovery: https://discovery.etcd.io/660d695900f203da9f9819cf42775896 | |
addr: $public_ipv4:4001 | |
peer-addr: $public_ipv4:7001 | |
fleet: | |
public-ip: $public_ipv4 # used for fleetctl ssh command | |
units: |
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 | |
# remove emtpy clutter | |
find /var/log/supervisor/ -size 0 -exec rm -f {} \; | |
##### Rotated Logs ##### | |
# gzip any rollovers | |
find /var/log/supervisor/ -regex '.*supervisor-[A-Za-z0-9]+.log.[0-9]+' -exec gzip -f {} \; | |
# remove anything older than 3 days | |
find /var/log/supervisor/ -regex '.*supervisor-[A-Za-z0-9]+.log.*' -mtime +2 -exec rm -f {} \; |
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 | |
# | |
# Docker Host 01 | |
# eth0: 192.168.1.10 | |
# | |
docker run -d \ | |
-p 9200:9200 \ | |
-p 9300:9300 \ |
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 | |
# | |
# ddns Apply DDNS Configuration on first boot | |
# | |
# chkconfig: 2345 09 90 | |
# description: Applies DDNS configuration to DHCP network interfaces | |
# | |
# Source function library. | |
. /etc/init.d/functions |
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
# Get network connections | |
$networkListManager = [Activator]::CreateInstance([Type]::GetTypeFromCLSID([Guid]"{DCB00C01-570F-4A9B-8D69-199FDBA5723B}")) | |
$connections = $networkListManager.GetNetworkConnections() | |
$connections | % {$_.GetNetwork().SetCategory(1)} | |
# run quick config | |
winrm qc -q | |
# allow incoming traffic from anywhere (still requires VPN connection) | |
netsh advfirewall firewall set rule name="Windows Remote Management (HTTP-In)" profile=private new enable=yes remoteip=any localip=any protocol=tcp |
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
### Keybase proof | |
I hereby claim: | |
* I am brandocorp on github. | |
* I am brandocorp (https://keybase.io/brandocorp) on keybase. | |
* I have a public key whose fingerprint is B27E EF08 56F0 C4B4 66A4 DDA0 6501 9DAC 08D6 305D | |
To claim this, I am signing this object: |
OlderNewer