Skip to content

Instantly share code, notes, and snippets.

View waiyanwh's full-sized avatar
🐢
Moving Slowly

Wai Yan Win Htain waiyanwh

🐢
Moving Slowly
View GitHub Profile
@waiyanwh
waiyanwh / config.toml
Last active April 27, 2022 13:28
AWS gitlab runner autoscaling
concurrent = 4
check_interval = 0
[session_server]
session_timeout = 1800
[[runners]]
name = "Autoscale runner"
limit = 8
url = "https//gitlab.com/"
image: docker:git
services:
- docker:19.03.0-dind
variables:
DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ""
@waiyanwh
waiyanwh / config.toml
Last active November 18, 2021 14:14
VMware vSphere Gitlab Runner Autoscale Config (docker-machine)
concurrent = 4
check_interval = 0
[session_server]
session_timeout = 1800
[[runners]]
name = "autoscale-runner"
url = "https://gitlab.com/"
token = "<YOUR TOKEN HERE>"
#!/bin/bash
user=
token=
newdev=25165825
newqa=25100295
dev=25034777
qa=25198603
if [[ $# -ne 1 ]]; then
@waiyanwh
waiyanwh / Instructuin
Last active June 22, 2022 05:12
Fix corrupted sudoers file in ubuntu
# If you can access the machine physically , open terminal and run the following command
pkexec visudo
# If you have only ssh access to the machine,
# run the following command, it will freeze your terminal but will fix the issue
# you can get the sudoers file in this gist.
pkttyagent -p $(echo $$) | pkexec cp ~/sudoers /etc/sudoers
resource "aws_cloudwatch_log_group" "example" {
name = "example-log-group"
}
resource "aws_iam_policy" "example" {
name = "example-policy"
policy = jsonencode({
Version = "2012-10-17",
Statement = [
const https = require("https");
function fetchP2PData(page = 1, fiat = "MMK", tradeType = "BUY", asset = "USDT", payTypes = []) {
return new Promise((resolve, reject) => {
const baseObj = {
page,
rows: 3,
publisherType: null,
asset,
tradeType,
@waiyanwh
waiyanwh / list-eni.py
Created November 15, 2023 06:19
To list all elastic network interface to get more info
#!/usr/bin/python3
import boto3
import csv
from prettytable import PrettyTable
# Input all regions that you used in your aws accounts
regions = ['us-east-1', 'ap-southeast-1', 'ap-northeast-1']
all_enis = []
for region in regions:
ec2 = boto3.client('ec2', region_name=region)