Skip to content

Instantly share code, notes, and snippets.

View Rendevior's full-sized avatar
:octocat:
Nothing Much.

Rendevior Rendevior

:octocat:
Nothing Much.
  • Japan, Kanagawa
  • 08:35 (UTC +09:00)
View GitHub Profile
@Rendevior
Rendevior / getprox.sh
Created December 8, 2022 10:09
get an proxy and out it to proxy.txt
#!/bin/bash
# Outpul file (Default: proxy.txt)
out="proxy.txt"
# Sources
source=("https://api.proxyscrape.com/?request=displayproxies&proxytype=http" "https://www.proxy-list.download/api/v1/get?type=http" "https://raw.githubusercontent.com/TheSpeedX/SOCKS-List/master/http.txt" "https://api.openproxylist.xyz/http.txt")
getprox(){
@Rendevior
Rendevior / stunnel.pem
Created August 8, 2022 09:39
Cert STUNNEL4
-----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAKCAQEAlwDg646IaTR2L22uslj1JH5Dos70ClCbOQE5vVxkF2w5olkn
rCI7UNGlwT/5snKgeUlGkBqpRr0wYSL2IjKGfpEBhbCPnyamEvb79m2WnhvTZ8Gr
ArfraMTuOJ+/fU4+Oe8HNFCBuzVKbfEHC89jKiR9zRsTjYLww8d2Qy22lXGUU6+X
0lrzANLNL7ofDPrW9OJNhIV7j6H8lCUU4h91kyUepFTgvBpPTzyj7hbctfHwmIRN
5be6xP9vUdIIYUfXgMlqHC5ELBQnHUL1qQg6+wFjC5q0W/8924FxCs5tNKDHa0B8
StnwQtsJirzmh3jpKi4JfcGtcKdNpf0mGAqq4QIDAQABAoIBADcvdAPCWGoSaSrW
K+U0C4sltfQ3LArlAIVpxD9HF7FTtRB3Ar+u1vynUat5hPjJWYpZ1Dbv93NJyveE
/mzrCCoTNno0V5izWDhQGS8rR8NKqg0eQzBAJQFqDyGUiDf0M1ua1ogw7+iKBkR9
tLSFO1l4cp1VyuSJuRHjwH22pCajBvrlC1acs5RwK6FrIDhbQwjgVrMZVCyG3Kg6
@Rendevior
Rendevior / center_text_bash.sh
Last active December 31, 2021 09:01
Easiest way to Center Multiline Text in Bash
#!/bin/bash
function Centered(){
echo "$1" | sed -e :a -e "s/^.\{1,$(tput cols)\}$/ & /;ta" | tr '\n' '\r'
}
# Using Pipe
function CenteredPipe(){
sed -e :a -e "s/^.\{1,$(tput cols)\}$/ & /;ta" /dev/stdin | tr '\n' '\r'
}
@Rendevior
Rendevior / unitconversion.sh
Last active June 4, 2022 15:22
Byte Unit Conversion with Decimal in Bash
#!/bin/sh
unit_conversion(){
B="${1}"
KB="$(awk -v "p=${B}" 'BEGIN{ p=p / 1024; printf "%0.2f", p}')"
MB="$(awk -v "p=${KB}" 'BEGIN{ p=p / 1024; printf "%0.2f", p}')"
GB="$(awk -v "p=${MB}" 'BEGIN{ p=p / 1024; printf "%0.2f", p}')"
TB="$(awk -v "p=${GB}" 'BEGIN{ p=p / 1024; printf "%0.2f", p}')"
[ "${TB%%.*}" -gt "0" ] && printf '%s %s\n' "${TB}" "TB" && return 0
[ "${GB%%.*}" -gt "0" ] && printf '%s %s\n' "${GB}" "GB" && return 0