Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
if [[ ! -f sample.txt ]]; then
echo "Error : Sample.txt does not exist.";
exit;
fi
ORIGINAL_HASH=$(cat hash.txt);
NEW_HASH=$(openssl sha1 sample.txt);
if [ "$ORIGINAL_HASH" = "$NEW_HASH" ];
@theminer3746
theminer3746 / thaikeyboard_translator.py
Last active January 29, 2020 15:36
When you forgot to change your keyboard from Thai to English (or vice versa) and can't be ask to retype your message
str1 = "`1234567890-=qwertyuiop[]\\asdfghjkl;'zxcvbnm,./~!@#$%^&*()_+QWERTYUIOP{}|ASDFGHJKL:\"ZXCVBNM<>?"
str2 = "_ๅ/-ภถุึคตจขชๆไำพะัีรนยบลฃฟหกดเ้่าสวงผปแอิืทมใฝ%+๑๒๓๔ู฿๕๖๗๘๙๐\"ฎฑธํ๊ณฯญฐ,ฅฤฆฏโฌ็๋ษศซ.()ฉฮฺ์?ฒฬฦ"
in_text = input().strip()
out_text = ''
for char in in_text:
for i in range(0, len(str1)):
if str1[i] == char: