Environment Variables
C:\Program Files\Java\jdk-11.0.1\bin
%USERPROFILE%\AppData\Local\Android\sdk\platform-tools
Error: 0x800703fa Illegal operation attempted on a registry key that has been marked for deletion
sc stop lxssmanager
sc start lxssmanager
https://blog.ropnop.com/configuring-a-pretty-and-usable-terminal-emulator-for-wsl/
xming - https://sourceforge.net/projects/xming/
dbus-uuidgen > /tmp/machine-id && sudo mv /tmp/machine-id /etc/machine-id
sudo apt-get install terminator dbus-x11
DISPLAY=:0 terminator &
args = "-c" & " -l " & """DISPLAY=:0 terminator"""
WScript.CreateObject("Shell.Application").ShellExecute "bash", args, "", "open", 0
C:\Windows\System32\wscript.exe %HOMEPATH%\startTerminator.vbs
%USERPROFILE%
Source: https://www.maketecheasier.com/chrome-flags-better-browsing-experience/
Enable picture in picture
Omnibox UI Vertical Layout - SHOW Title
Automatic Tab Discarding - DISCARD
Smooth Scrolling - OFF
Tab audio muting UI control - MUTE TAB
Fast tab/window close - QUICK TAB CLOSE
sudo crontab -e
*/20 * * * * /opt/cron_pull_code.sh
eval $(ssh-agent);
ssh-add ~/.ssh/id_rsa;
cd your_app
git pull
"lint": "./node_modules/.bin/eslint --ignore-pattern \"*.spec.js\" --max-warnings 200 src/**/**/*.js",
"format": "./node_modules/.bin/prettier --config ./.prettierrc --write src/**/**/*{js,jsx}"
{
"printWidth": 100,
"parser": "flow",
"semi": true,
"useTabs": false,
"tabWidth": 2,
"singleQuote": true,
"trailingComma": "all",
"bracketSpacing": true,
"jsxBracketSameLine": true,
"jsxSingleQuote": true,
"arrowParens": "always",
"endOfLine": "lf"
}
find src -name "*.bak" | xargs rm && find src -name "*.DS_Store" | xargs rm
find src -type f -name "*.js" -exec sed -i'.bak' -e 's/allowTotalAmountChangedSelectors/allowTotalAmountChanged/g' {} \;
https://letsencrypt.org/docs/certificates-for-localhost/
openssl req -x509 -out localhost.crt -keyout localhost.key \
-newkey rsa:2048 -nodes -sha256 \
-subj '/CN=localhost' -extensions EXT -config <( \
printf "[dn]\nCN=localhost\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:localhost\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth")
https://www.booleanworld.com/guide-ssh-port-forwarding-tunnelling/
From SSH Server to localhost
ssh -L 443:localhost:443 -L 3000:localhost:3000 -L 9000:localhost:9000 -L 3306:localhost:3306 sy-macpro
If you do not need to start a session, you can add -N
ssh -L 443:localhost:443 -L 3000:localhost:3000 -L 9000:localhost:9000 -L 3306:localhost:3306 -N sy-macpro
From localhost to SSH Server
ssh -R 7000:127.0.0.1:8000 [email protected]
ssh-copy-id syle@sy-macpro
ssh -i .ssh/id_rsa
~/.ssh/config
Host sy-macpro
User syle
HostName 192.168.5.2
IdentityFile ~/.ssh/id_rsa
Download puttygen (putty)
- Save public key
- Save private key
ppk
Also can use puttygen to convert aws key
to ppk
Connection > Auth > Choose private key ppk
awk '{print $1 $2}` contacts.txt
# print number of fields, then whole line ($0)
awk '{print NF $0}` contacts.txt
# only print those lines that matches `Bob`
awk '/Bob/{print $1 $2}` contacts.txt
# only print those lines with 3 fields
awk 'NF==3{print $0}` contacts.txt
# only print those lines with 3 fields
awk '/up/{print "UP:" $0}` '/down/{print "DOWN:" $0}` contacts.txt
# from command file
awk -f filename contacts.txt
# use space as field seperator here we seperate by \t
awk -F '\t' '{print $2}' contacts.txt
# csv to tsv
awk 'BEGIN{FS=",": OFS="\t"}' '{print $1 $2 $3}' contacts.csv
awk 'BEGIN{FS=",": OFS="\t"}' '{print $1 $2 $3}' contacts.csv
sudo vim /etc/ssh/ssh_config
Host *
ClientAliveInterval 120
ClientAliveCountMax 720
SHOW VARIABLES LIKE '%time_zone%'
SET time_zone = '+00:00';
SELECT NOW(); -- with respect to server timezone
SELECT UTC_TIMESTAMP();
TIMESTAMP type is obsolette and will stop working in years 2038
update_current_timestamp DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
...
city ENUM ('SF', 'LA', 'NY')
...
INSERT INTO test (...) VALUES ('SF');
INSERT INTO test (...) VALUES ('1');
Bitmap position
...
city SET ('SF', 'LA', 'NY')
...
INSERT INTO test (...) VALUES ('SF,LA');
INSERT INTO test (...) VALUES ('1');
id SERIAL
...
id INT UNSIGNED UNIQUE AUTO_INCREMENT PRIMARY KEY
DESCRIBE test
SHOW CREATE TABLE test
Use DECIMAL for precision
DECIMAL(9,2) -- 1234567.89
DECIMAL(10,0) -- 1234567890
Not precised
FLOAT - 24 bits and 7 precision - about 7 digits
DOUBLE - 53 bits and 16 precision - about 16 digits