# Step 1: Generate a Private Key
openssl genrsa -out myprivate.key 2048
# Step 2: Create a Certificate Signing Request (CSR)
openssl req -new -key myprivate.key -out myrequest.csr
# Step 3: Generate a Self-Signed Certificate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Check if email is provided as an argument | |
if [ "$#" -ne 1 ]; then | |
echo "Usage: $0 [email]" | |
exit 1 | |
fi | |
EMAIL=$1 | |
KEY_NAME="$HOME/.ssh/id_ed25519" |
This script tests the connection to a specified URL and provides detailed timing information, useful for troubleshooting internet connectivity issues. It measures the time taken for various stages of the connection process, including:
Name lookup (DNS resolution) Connecting to the server Initiating data transfer Overall request completion This breakdown helps pinpoint potential bottlenecks in your network or the remote server.
I hereby claim:
- I am thesuhu on github.
- I am thesuhu (https://keybase.io/thesuhu) on keybase.
- I have a public key ASCLft-tu6mhjFiUQei6nkEk3X82uLNQJ0OXOjd2JI1ytAo
To claim this, I am signing this object:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LOAD DATA LOCAL INFILE 'g:\\temp\\file1.csv' | |
INTO TABLE mytable | |
FIELDS TERMINATED BY ';' -- Pemisah kolom dalam file CSV | |
ENCLOSED BY '"' -- Karakter penutup untuk kolom yang diapit oleh tanda kutip ("") | |
LINES TERMINATED BY '\r\n' -- Karakter akhir baris dalam file CSV | |
IGNORE 1 LINES -- Mengabaikan baris header pertama dalam file CSV (jika ada) | |
-- Kolom target dalam tabel | |
(COL1, COL2, COL3, COL4, COL5); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# get UTC date | |
date -u -d "$(curl -sI google.com | grep -i '^date:' | cut -d' ' -f2-)" | |
# get local date from UTC | |
date -d "$(curl -sI google.com| grep -i '^date:'|cut -d' ' -f2-)" | |
# sync local date from UTC | |
sudo date -s "$(date -d "$(curl -sI google.com | grep -i '^date:' | cut -d' ' -f2-)" '+%Y-%m-%d %H:%M:%S')" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_country_flag(country_code): | |
OFFSET = 127397 | |
codepoints = tuple(ord(char) + OFFSET for char in country_code.upper()) | |
return chr(codepoints[0]) + chr(codepoints[1]) | |
# usage get_country_flag("ID") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node_modules | |
npm-debug.log | |
Dockerfile* | |
docker-compose* | |
.dockerignore | |
.git | |
.gitignore | |
README.md | |
LICENSE | |
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
IP=$(echo $1 | egrep -o "^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$") | |
if [ ! $IP ] | |
then | |
echo "Usage: generate-ip-cert.sh 127.0.0.1" | |
exit 1 | |
fi |
NewerOlder