Skip to content

Instantly share code, notes, and snippets.

View thepoppingone's full-sized avatar
🎯
Focusing

Poh Peng Wang thepoppingone

🎯
Focusing
View GitHub Profile
@thepoppingone
thepoppingone / README.md
Last active June 22, 2023 05:51
Karpenter Notes
@thepoppingone
thepoppingone / entrypoint.sh
Last active October 14, 2022 18:21
Fortify sample server.xml and entrypoint.sh
#!/bin/bash
set -e -o pipefail
if [ -x "$(command -v "$1")" ]; then
exec "$@"
fi
assertIsSet() {
# $1=variable_value $2=variable_name
if [ -z "$1" ]; then
@thepoppingone
thepoppingone / iam.tf
Created November 5, 2020 17:49
node group iam
#NodeGroup
resource "aws_iam_role" "your-eks-cluster-ng" {
name = "your-eks-cluster-node-group"
permissions_boundary = var.iam_permissions_boundary
tags = merge(var.default_tags, map("Name", "your-eks-cluster-ng-sg"))
assume_role_policy = jsonencode({
Statement = [{
Action = "sts:AssumeRole"
Effect = "Allow"
Principal = {
@thepoppingone
thepoppingone / ec2.tf
Last active November 5, 2020 15:26
eks launch template
resource "aws_launch_template" "your_eks_launch_template" {
name = "your_eks_launch_template"
vpc_security_group_ids = [var.your_security_group.id, aws_eks_cluster.your-eks-cluster.vpc_config[0].cluster_security_group_id]
block_device_mappings {
device_name = "/dev/xvda"
ebs {
volume_size = 20
@thepoppingone
thepoppingone / eks_nodegroups.tf
Last active November 5, 2020 15:19
eks nodegroups
resource "aws_eks_node_group" "your-eks-cluster-ng" {
cluster_name = aws_eks_cluster.your-eks-cluster.name
node_group_name = "your-eks-cluster-ng-hardened"
node_role_arn = aws_iam_role.your-eks-cluster-ng.arn
subnet_ids = [var.network_subnets.pvt[0].id, var.network_subnets.pvt[1].id, var.network_subnets.pvt[2].id]
# instance_types = ["t3.medium"] -> this is removed and shifted to the custom launch template
tags = merge(var.default_tags, map("Name", "your-eks-cluster-ng"))
scaling_config {
desired_size = var.asg_desired_size
max_size = var.asg_max_size
@thepoppingone
thepoppingone / addsrttomp4.sh
Created March 14, 2020 17:50
Add srt file to mp4 file and flatten to a mp4 with hardcoded subs
#!/bin/sh
# Author : Wang Poh Peng
# Description : Use FFMPEG to hardcode subs into videos into mkv or mp4 format
RED='\033[1;31m'
NC='\033[0m' # No Color
GREEN='\033[0;32m'
CYAN='\033[0;36m'
@thepoppingone
thepoppingone / keep-starting-bamboo-osx.sh
Last active October 1, 2019 07:04
To start bamboo agent and tail the log in the same terminal
while true; do
echo "Starting Bamboo Process Console - logs to /tmp"
./bamboo-agent.sh console >> /tmp/bamboo-logs &
BAMBOO_PID=$!
tail -f /tmp/bamboo-logs &
TAIL_PID=$!
echo "Tail PID is $TAIL_PID"
echo "Bamboo PID is $BAMBOO_PID"
wait $BAMBOO_PID
kill -9 $TAIL_PID
@thepoppingone
thepoppingone / docker_commands.md
Created April 5, 2019 06:43
Docker Commands for Jenkins Setup
docker run \
  --rm \
  -u root \
  -p 8080:8080 \
  -v jenkins-data:/var/jenkins_home \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -v "$HOME":/home \
  jenkinsci/blueocean
@thepoppingone
thepoppingone / Restart-RdpServices.ps1
Created March 22, 2019 01:57
Restart RDP service of Windows Instance
Function Restart-RdpServices {
<#
.SYNOPSIS
Restarts services related to RDP.
.DESCRIPTION
Restarts services related to RDP: 'TermService' and 'Remote Desktop Services UserMode Port Redirector'
.PARAMETER ComputerName
ComputerName that will have it RDP related services restarted.
.EXAMPLE
Nuke-RDP -ComputerName 'Contoso1'
@thepoppingone
thepoppingone / appium_browser_ios.json
Last active November 4, 2020 18:13
Capabilities for ios browser test
{
"platformName": "iOS",
"platformVersion": "12.1",
"deviceName": "iPhone XS",
"browserName": "Safari",
"automationName": "XCUITest"
}