Skip to content

Instantly share code, notes, and snippets.

View alexcheng1982's full-sized avatar
๐ŸŽ‰
AI time

Fu Cheng alexcheng1982

๐ŸŽ‰
AI time
View GitHub Profile
@alexcheng1982
alexcheng1982 / hubot-dependencies.json
Created December 17, 2017 21:13
Hubot dependencies
"dependencies": {
"coffee-script": "^1.12.7",
"hubot": "^2.19.0",
"hubot-help": "^0.2.2",
"hubot-hipchat": "^2.12.0-6",
"hubot-scripts": "^2.17.2"
}
@alexcheng1982
alexcheng1982 / hubot-stub-code.sh
Created December 17, 2017 21:12
Hubot stub code
$ yarn global add generator-hubot
$ cd bot
$ yo hubot
@alexcheng1982
alexcheng1982 / install-app-passing-variables.yml
Created December 14, 2017 19:32
Pass variables between hosts
- name: install app
hosts: dev
gather_facts: no
vars:
ip: "{{ hostvars.localhost.ec2.tagged_instances[0].private_ip }}"
vars_files:
- secret.yml
roles:
- aws
- app
@alexcheng1982
alexcheng1982 / config-firewall.ps1
Created December 14, 2017 19:31
Configure firewall
netsh advfirewall firewall add rule name="App Port 8080" dir=in action=allow protocol=TCP localport=8080
@alexcheng1982
alexcheng1982 / app-roles.yml
Created December 14, 2017 19:30
Install app with roles
- name: install app
hosts: dev
gather_facts: no
vars_files:
- secret.yml
roles:
- aws
- app
@alexcheng1982
alexcheng1982 / install-app.yml
Created December 14, 2017 19:30
Install app
- name: install app
win_package:
path: "{{ exe_find.files[0].path }}"
arguments: "-q -overwrite -varfile {{ app.install_varfile_path }}"
product_id: {{ app.product_id }}
state: present
creates_path: Z:\app
@alexcheng1982
alexcheng1982 / find-exe-path.yml
Created December 14, 2017 19:29
Find exe file path
- name: find exe path
win_find:
paths: "{{ extracted_path }}"
patterns: "*.exe"
register: exe_find
@alexcheng1982
alexcheng1982 / install-pscx.yml
Created December 14, 2017 19:27
Install pscx
- name: install pscx
win_chocolatey:
name: pscx
state: present
@alexcheng1982
alexcheng1982 / install-chocolatey.ps1
Created December 14, 2017 19:27
Install Chocolatey
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
@alexcheng1982
alexcheng1982 / download-s3.yml
Created December 14, 2017 19:26
Download artifacts from S3
- name: download artifact
win_command: "PowerShell.exe -Command Read-S3Object -Region {{aws.region}} -BucketName <bucket_name> -Key <key> -File {{ target_path }} "