Skip to content

Instantly share code, notes, and snippets.

View paultung's full-sized avatar
💪
I can do all things through Christ who strengthens me.

Paul Tung paultung

💪
I can do all things through Christ who strengthens me.
  • Splashtop Inc.
  • Taipei, Taiwan
View GitHub Profile
@0mnius
0mnius / aws.md
Last active July 22, 2024 10:23 — forked from colinvh/aws.md
AWS Region Names

Alternative naming schemes for AWS regions

Based on original scheme by colinvh/aws.md

Purpose

The intent is to define terse, standards-supported names for AWS regions.

Legend

Code Description
@lukeplausin
lukeplausin / transfer_ssm_file.sh
Last active May 6, 2025 05:58
Transfer a file to EC2 SSM instance without using S3 (SSM only)
# This script will explain how to transfer a file to EC2 using SSM ONLY!
# You will need to have permission to run SSM commands on the target machine and have sudo access as well
# Infos
INSTANCE_ID=i-1234567890
FILE_NAME=the_file.tar.gz
# Step 1: Run command on machine to install netcat and dump from port to filename
# < Start session
@pahud
pahud / create-asg.sh
Created November 16, 2018 03:49
Create Autoscaling Group with more instance types and purchase options
#!/bin/bash
# make sure your awscli version is >= 1.16.56
#
# 1. create a launch template and copy the LaunchTemplateId
# 2. create mix-policy.json
# 3. run create-asg.sh
#
# by [email protected]
asgname=demo
@rise-worlds
rise-worlds / For Mac 4.2.6 unlimited trial.md
Last active May 6, 2025 04:49 — forked from satish-setty/trial.md
Beyond Compare 4 license for Windows, Mac, Linux

for 4.2.4 or higher, 4.2.5,4.2.6,4.3.7, it's works, this is the way which makes Always in evaluation mode.

  1. open Terminal, go to the dir : cd /Applications/Beyond Compare.app/Contents/MacOS
  2. change the name BCompare to BCompare.bak: mv BCompare BCompare.bak
  3. touch a file name BCompare , and chmod a+ux BCompare : touch BCompare && chmod a+ux BCompare
  4. open BCompare with text editor, insert the script :
#!/bin/bash
rm "/Users/$(whoami)/Library/Application Support/Beyond Compare/registry.dat"
"`dirname "$0"`"/BCompare.bak $@
@svx
svx / delete-evicted-pods-all-namespaces.sh
Created August 15, 2018 12:45 — forked from psxvoid/delete-evicted-pods-all-namespaces.sh
Delete evicted pods from all namespaces (also ImagePullBackOff and ErrImagePull)
#!/bin/sh
# based on https://gist.github.com/ipedrazas/9c622404fb41f2343a0db85b3821275d
# delete all evicted pods from all namespaces
kubectl get pods --all-namespaces | grep Evicted | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod
# delete all containers in ImagePullBackOff state from all namespaces
kubectl get pods --all-namespaces | grep 'ImagePullBackOff' | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod
# delete all containers in ImagePullBackOff or ErrImagePull or Evicted state from all namespaces
@rodw
rodw / draw-histogram.sh
Created February 26, 2018 21:04
bash script that generates an ASCII-art histogram (bar chart) from input data.
#!/bin/bash
#-------------------------------------------------------------------------------
# draw-histogram - generates an ASCII-art histogram (bar chart) from input data.
#-------------------------------------------------------------------------------
# Expects a series of lines of the form `<category-name> <count>` to passed
# via stdin.
#
# Generates a table the looks something like the following:
#
# +-------+----+
@paultung
paultung / membash.sh
Last active October 16, 2017 09:09 — forked from solariz/membash.sh
BASH script which may be used to interact with memcache. All main memcache functions are supported. Fixed Revision working with new nc. New nc Versions do not terminate their connection after receiving EOL/EOF this need to be done by timeout or EOF Handling. Added both line #41. Remove '-q' parameter for new NC no support to lin #41.
#!/bin/bash
# Gist: 11375877
# Url: https://gist.github.com/goodevilgenius/11375877
#
# All memcache functions are supported.
#
# Can also be sourced from other scripts, e.g.
# source membash.sh
# MCSERVER="localhost"
@mustafaturan
mustafaturan / network-tweak.md
Last active March 27, 2025 17:28
Linux Network Tweak for 2 million web socket connections

Sample config for 2 million web socket connection

    sysctl -w fs.file-max=12000500
    sysctl -w fs.nr_open=20000500
    # Set the maximum number of open file descriptors
    ulimit -n 20000000

    # Set the memory size for TCP with minimum, default and maximum thresholds 
 sysctl -w net.ipv4.tcp_mem='10000000 10000000 10000000'
@solariz
solariz / membash.sh
Last active February 28, 2018 14:21 — forked from goodevilgenius/membash.sh
BASH script which may be used to interact with memcache. All main memcache functions are supported. Fixed Revision working with new nc. New nc Versions do not terminate their connection after receiving EOL/EOF this need to be done by timeout or EOF Handling. Added both line #41
#!/bin/bash
# Gist: 11375877
# Url: https://gist.github.com/goodevilgenius/11375877
#
# All memcache functions are supported.
#
# Can also be sourced from other scripts, e.g.
# source membash.sh
# MCSERVER="localhost"