Skip to content

Instantly share code, notes, and snippets.

View mengjiann's full-sized avatar
🤔
code. code.

MJ mengjiann

🤔
code. code.
  • Illumina
  • Singapore
View GitHub Profile
@mengjiann
mengjiann / gist:156a5b3a3da3785353ff706c0976b617
Created April 4, 2019 06:56
Verizon Edgecast Curl Request
curl -sD- -H x-ec-debug:cache-verbose,x-ec-cache,x-ec-check-cacheable,x-ec-cache-key,x-ec-cache-state -H "Origin: https://www.google.com" https://www.google.com
# Add a new tag
git tag -a "v1" -m "Rolled out new changes"
# Push tags to remote
git push --tags
# Remove tag
git tag -d v1
# Remove tag from origin
@mengjiann
mengjiann / state-choice.json
Last active April 7, 2019 16:12
Sample States for AWS Step Functions
{
"send-notification-if-less-than-5": {
"Comment": "A choice state to decide to send out notification for <5 or trigger power of three lambda for >5.",
"Type": "Choice",
"Choices": [
{
"Variable": "$",
"NumericGreaterThanEquals": 5,
"Next": "power-of-three-lambda"
# Docker’s commit command allows users to take a running container and save its current state as an image
docker commit ${container-id} ${image-name}
# Export the image as tar
docker save ${image-name} > ./{image-tar-name}.tar
# Load a tar image
docker load < ${image-tar-name}.tar
@mengjiann
mengjiann / gist:91b604fd2e0f09f60ce86331448bc9f7
Created May 12, 2019 15:31
Kubernetes - Kong Dashboard
apiVersion: v1
kind: Service
metadata:
name: kong-dashboard-admin
spec:
type: LoadBalancer
loadBalancerSourceRanges:
- 0.0.0.0/0
ports:
- name: kong-dashboard-admin
@mengjiann
mengjiann / gist:ed7de455598640800e01fbd3c99c7250
Created May 23, 2019 05:55
Dockerfile for awscli with K8S deployment
FROM python:2.7
ENV AWS_DEFAULT_REGION='[your region]'
ENV AWS_ACCESS_KEY_ID='[your access key id]'
ENV AWS_SECRET_ACCESS_KEY='[your secret]'
RUN pip install awscli
CMD /bin/bash
https://github.com/mroth/scmpuff
@RunWith(SpringRunner.class)
@WebMvcTest(EntrySubmitRestController.class)
@ContextConfiguration(classes = EntrySubmitRestControllerTest.ContextConfiguration.class)
public class EntrySubmitRestControllerTest {
@TestConfiguration
static class ContextConfiguration {
@Bean
@Qualifier("entrySubmitDueDate")
@mengjiann
mengjiann / gist:8a3bc7bcb0f6f35264c3e6ebce75cd79
Created December 4, 2019 02:57
Prepare the docker image for the SpringBoot app to connect to MySQL using SSL
FROM openjdk:8-jdk
# For alpine
# RUN apk add --update openssl
# RUN apk add coreutils
# create a temp dir in which to work
RUN OLDDIR="$PWD"
RUN mkdir /tmp/rds-ca && cd /tmp/rds-ca
@mengjiann
mengjiann / gist:c65e207ae14180de7d2a258db61dc7e3
Created February 10, 2020 01:11
Spring Boot FTP Integration Sample Code
@Slf4j
@SpringBootApplication
public class FtpDemoApplication implements CommandLineRunner {
public static void main(String[] args) {
SpringApplication springApplication = new SpringApplicationBuilder()
.sources(FtpDemoApplication.class).web(WebApplicationType.NONE).build();
springApplication.run(args).close();
}