Skip to content

Instantly share code, notes, and snippets.

View 0x0a0d's full-sized avatar

Xì Gà 0x0a0d

View GitHub Profile
@0x0a0d
0x0a0d / fix.sh
Last active June 29, 2019 13:00
LC_ALL LC_CTYPE fix
#!/bin/bash
export LANGUAGE=en_US.UTF-8; export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8
locale-gen en_US.UTF-8
locale > /etc/default/locale
#sudo dpkg-reconfigure -u locales
#reboot
@0x0a0d
0x0a0d / Activate Office 2019 for macOS VoL.md
Created August 1, 2019 16:00 — forked from zthxxx/Activate Office 2019 for macOS VoL.md
crack activate office on mac with license file

Activate MS Office 2019/2016 for macOS - Microsoft_Office_2019_VL_Serializer

Office 2019 above

2019-06-03

Note that Office2019 DO NOT support activate via simple copy/paste plist license file which is the simplest way to activate Office 2016. Fortunately, you can also use the VL Serializer tool, just install Office 2019 and Serializer, then run Serializer to activate.

Ref

@0x0a0d
0x0a0d / getSamePath.js
Created July 7, 2020 14:07
find same path (string) of input
function getSameLength(pages) {
let j = 0;
for (; j < pages[0].length; j++) {
for (let i = 0; i < pages.length - 1; i++) {
if (pages[i][j] !== pages[i + 1][j]) return j - 1
}
}
return j
}
#!/bin/bash
echo "[+] Docker registry generator"
read -p "[+] Domain: " DOMAIN
read -p "[+] Data location: [$(pwd)] " DOCKER_REGISTRY_PATH
read -p "[+] Docker name: [registry-test] " DOCKER_NAME
read -p "[+] Docker listen port: [443] " DOCKER_PORT
read -p "[+] Username: " USERNAME
read -s -p "[+] Password: " PASSWORD
if [[ "$DOCKER_REGISTRY_PATH" == "" ]]; then DOCKER_REGISTRY_PATH=`pwd`; fi
if [[ "$DOCKER_NAME" == "" ]]; then DOCKER_NAME='registry-test'; fi
@0x0a0d
0x0a0d / onepay-response-code.json
Created March 11, 2021 02:40
OnePay - Bảng mã lỗi Response code (vpc_TxnResponseCode)
{
"0": {
"en": "Transaction is successful",
"vi": "Giao dịch thành công"
},
"1": {
"en": "This transaction has been declined by issuer bank or card have been not registered online payment services. Please contact your bank for further clarification.",
"vi": "Ngân hàng phát hành thẻ không cấp phép cho giao dịch hoặc thẻ chưa được kích hoạt dịch vụ thanh toán trên Internet. Vui lòng liên hệ ngân hàng theo số điện thoại sau mặt thẻ được hỗ trợ chi tiết."
},
"2": {
@0x0a0d
0x0a0d / vccloud-init.sh
Last active December 14, 2022 09:26
vccloud init
#!/bin/bash
#https://askubuntu.com/questions/259739/kswapd0-is-taking-a-lot-of-cpu
echo 1 | sudo tee /proc/sys/vm/drop_caches
# ssh port
rand_port=0
while [[ $rand_port -lt 10000 ]]
do
rand_port=$(($RANDOM * 2))
@0x0a0d
0x0a0d / docker-init.sh
Created April 19, 2021 03:29
Docker init
#!/bin/bash
# install docker
if [[ ! `which docker` ]]
then
apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common -y
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
apt update
@0x0a0d
0x0a0d / run-one-of-follow.sh
Last active May 28, 2021 06:03
React Native run android/ios difference port
RCT_METRO_PORT=9081 yarn android --port 9081
RCT_METRO_PORT=9081 npm run android --port 9081
RCT_METRO_PORT=9081 react-native run-android --port 9081
# Advance
PORT=9081; RCT_METRO_PORT=$PORT yarn android --port $PORT
# change android to ios if dev on iOS
@0x0a0d
0x0a0d / lat-lng-parse.js
Last active June 13, 2021 03:48
coordinate latitude longitude regex
/**
* parse string as lat long
* copyright https://gist.github.com/0x0a0d
* typical: '10.777399,,,,106.687621'
* @param {string} query - user input
* @param {boolean} [parseNumber=true] - return number instead of string type
* @return {null|{lat: string, lng: string}|{lat: number, lng: number}}
*/
const parseLatLng = function(query, parseNumber = true) {
if (typeof query !== 'string') return
@0x0a0d
0x0a0d / READEME.md
Last active February 8, 2022 10:07
downgrade android emulator