Skip to content

Instantly share code, notes, and snippets.

View openhoangnc's full-sized avatar
🌊
coding for living

Nguyen Cong Hoang openhoangnc

🌊
coding for living
  • Vietnam
View GitHub Profile
@openhoangnc
openhoangnc / install_lastest_golang.sh
Last active January 24, 2018 11:54
Install lastest golang
#!/bin/sh
#sudo curl https://gist.githubusercontent.com/openhoangnc/1bb591e8843ac111c0661f5615eda0e1/raw/51933d70dd3e384cca69c0fdd835f6243ad38d12/install_lastest_golang.sh | sh
GOVERSION=1.9.3
GOOS=linux
GOARCH=amd64
TARFILE=go$GOVERSION.$GOOS-$GOARCH.tar.gz
TARFILEFULL=/tmp/$TARFILE
PROFILE=/etc/profile.d/golang.sh
VBoxManage modifyvm "MacOS" --cpuidset 00000001 000106e5 00100800 0098e3fd bfebfbff
VBoxManage setextradata "MacOS" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "iMac11,3"
VBoxManage setextradata "MacOS" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0"
VBoxManage setextradata "MacOS" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Iloveapple"
VBoxManage setextradata "MacOS" "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
VBoxManage setextradata "MacOS" "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1
@openhoangnc
openhoangnc / wm_info.bash
Created September 1, 2018 04:53
Get WM_CLASS of active window
#!/bin/bash
ACTIVE_WINDOW=""
while true
do
sleep 0.5
NEW_ACTIVE_WINDOW=$(xprop -root 32x '\t$0' _NET_ACTIVE_WINDOW | cut -f 2)
@openhoangnc
openhoangnc / 1_WTF.md
Created October 11, 2018 04:11 — forked from valpackett/1_WTF.md
Kindle dictionary template

Kindle dictionary template

Use it with KindleGen

kindlegen dic.opf

@openhoangnc
openhoangnc / ec2.ubuntu.archive.sh
Created April 28, 2020 16:02
EC2's ubuntu archive
sudo sed -i -E "s/([^\/]+\.)?archive\.ubuntu\.com/ap-southeast-1.ec2.archive.ubuntu.com/" /etc/apt/sources.list
#include <Arduino.h>
// the setup function runs once when you press reset or power the board
void setup()
{
uint32_t outputMode8Pin = 0x77777777;
/**
0x7 = 0 1 1 1
CNF1 CNF0 MODE1 MODE0
General perpose output + open-drain + Max output speed 50MHz
@openhoangnc
openhoangnc / inputrc
Created August 28, 2020 04:54 — forked from snipe/inputrc
~/.inputrc for nice bash history up-arrows. This allows you to search through your history using the up and down arrows … i.e. type "cd /" and press the up arrow and you'll search through everything in your history that starts with "cd /". Create ~/.inputrc and fill it with this:
"\e[A": history-search-backward
"\e[B": history-search-forward
set show-all-if-ambiguous on
set completion-ignore-case on
@openhoangnc
openhoangnc / mini-server-setup.md
Last active May 7, 2021 02:46
Mini server setup
@openhoangnc
openhoangnc / package.json
Created May 28, 2021 08:51
Ignore node_modules from go mod
{
"scripts": {
"postinstall": "echo > node_modules/go.mod"
}
}

macOS 11.5.2

location: Vietnam

I got this error while installing rosetta by clicking the "Install" button:

“Installing Rosetta 2 on this system is not supported.”

Run this command in the terminal should work