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 / m3u8streamffmpegdl.sh
Last active February 27, 2023 14:32
Download m3u8 playlist with ffmpeg - step by step download script (ffmpeg binary required)
#!/bin/sh
# Author : Wang Poh Peng
# Description : Use FFMPEG to download 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 / README.md
Last active March 20, 2019 09:38
hats-vm script for VBManage of vms and usb devices

Setup

  1. Unzip the package if you download the file from Github

  2. chmod +x the hats-vm.sh file to make it executable

  3. ./hats-vm.sh to start

Follow the instructions in the shell output to control the VMs via command line.

@thepoppingone
thepoppingone / check-outdated.sh
Last active March 11, 2019 10:39
Check for npm and pip modules outdated
#!/bin/bash
# Author: Wang Poh Peng
# Showing pip or npm outdate and last updated time
GREEN='\033[0;32m'
CYAN='\033[0;36m'
NC='\033[0m' # No Color
echo ""
echo "--------------------------------------------------------"
@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"
}
@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 / 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 / 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 / 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 / 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 / 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