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 / nginx_setup.yml
Created December 20, 2017 21:01
Ansible task to setup Nginx on Windows
---
- name: install nginx
win_chocolatey:
name: nginx
state: present
- name: install nssm
win_chocolatey:
name: nssm
state: present
- name: copy nginx conf file
@alexcheng1982
alexcheng1982 / nginx_start.yml
Created December 20, 2017 21:02
Ansbile handler to start Nginx service
--
- name: start nginx
win_service:
name: nginx
start_mode: auto
state: started
@alexcheng1982
alexcheng1982 / port_forwarding.ps1
Created December 20, 2017 21:03
Windows port forwarding for EC2
<powershell>
$ipAddress = (invoke-restmethod -uri http://169.254.169.254/latest/meta-data/local-ipv4)
"Setting up port forwarding"
netsh interface portproxy add v4tov4 listenport=80 connectport=8080 connectaddress=$ipAddress
</powershell>
@alexcheng1982
alexcheng1982 / build.gradle
Created January 31, 2018 21:11
Akka Streams Camel integration build script
buildscript {
ext.kotlin_version = '1.2.21'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
@alexcheng1982
alexcheng1982 / Main.kt
Created January 31, 2018 21:15
Akka Streams Camel integration Main Kotlin file
import akka.NotUsed
import akka.actor.ActorSystem
import akka.stream.ActorMaterializer
import akka.stream.ClosedShape
import akka.stream.FlowShape
import akka.stream.Graph
import akka.stream.javadsl.GraphDSL
import akka.stream.javadsl.RunnableGraph
import akka.stream.javadsl.Source
import akka.stream.scaladsl.Flow
@alexcheng1982
alexcheng1982 / install_7zip.yml
Created February 7, 2018 20:44
Install 7zip
- name: install 7zip
win_chocolatey:
name: 7zip
state: present
@alexcheng1982
alexcheng1982 / extract_7zip.yml
Created February 7, 2018 20:45
Extract tar.gz files using 7zip
- name: unzip tar.gz
win_command: "7z x {{ tar_gz_path }} -o{{ tar_path }} -y"
- name: unzip tar
win_command: "7z x {{ tar_path }} -o{{ extracted_path } -y"
@alexcheng1982
alexcheng1982 / build.gradle
Created February 13, 2018 08:15
Gradle publish to Maven repository
buildscript {
repositories {
mavenCentral()
maven {
url "http://repository.jboss.org/nexus/content/groups/public/"
}
}
dependencies {
classpath 'org.hibernate.build.gradle:gradle-maven-publish-auth:2.0.1'
}
@alexcheng1982
alexcheng1982 / Dockerfile
Created February 13, 2018 08:16
Custom Maven Docker image
FROM maven:3.5.2-jdk-8-alpine
COPY settings.xml ${MAVEN_CONFIG}/
@alexcheng1982
alexcheng1982 / bitbucket-pipelines.yml
Created February 13, 2018 08:17
Bitbucket Pipelines
image:
name: <aws_account_id>.dkr.ecr.<region>.amazonaws.com/maven
aws:
access-key: $AWS_ACCESS_KEY
secret-key: $AWS_SECRET_KEY
pipelines:
default:
- step:
caches: