Access Oracle Cloud VM from any browser on any devices
wget -O vscode.deb https://code.visualstudio.com/sha/download\?build\=stable\&os\=linux-deb-arm64 && sudo apt install ./vscode.deb --fix-broken -y && rm vscode.debAccess Oracle Cloud VM from any browser on any devices
wget -O vscode.deb https://code.visualstudio.com/sha/download\?build\=stable\&os\=linux-deb-arm64 && sudo apt install ./vscode.deb --fix-broken -y && rm vscode.deb一個傳統 Java Spring 的應用程式會分為三層 @Controller @Service @Repository,然後依據組織需求,再往下細分。
比方說 Service 層複雜的話,會增加 Gateway、Facade 層,或是我們組織獨有的 CoreService 層
另一個層級大部份 Java 組織會忽略的是 Domain Model 層,絕大多數 Java 開發者會開個 entity 或 model package,然後 將所有的 Entity 往裡面丟。然而該 Entity 只是一堆欄位和 getter/setter 的堆疊,也就是單純的 Table 的對應物件而已, 不具備任何 business logic
$ brew install podman| # This goes in your Microsoft.PowerShell_profile.ps1 (can find the path via $PROFILE in your prompt) | |
| Import-Module -Name posh-git,oh-my-posh,Terminal-Icons | |
| Set-PoshPrompt -Theme craver |
| #cloud-config | |
| package_upgrade: true | |
| ssh_authorized_keys: | |
| - <your key> | |
| packages: | |
| - apt-transport-https | |
| - ca-certificates | |
| - curl |
| /** | |
| * Postman Pre-Request script to append CSRF token in header for POST requests in Laravel | |
| * Sanctum authenticated SPA. Requires active environment with {{url}} variable defined | |
| * for main app domain. | |
| * | |
| * Postman Interceptor allows appending cookies from browser, but Laravel CSRF middleware | |
| * only validates CSRF in headers or in _token form field, not in cookies. Axios automatically | |
| * appends the CSRF from cookie to headers, but Postman cannot access intercepted cookies | |
| * and use them, so we have to do one pre-request to get the CSRF token, store it | |
| * in environment so it can be reused, and then append it to headers. |
| # https://www.cyberciti.biz/faq/apple-mac-osx-terminal-color-ls-output-option/ | |
| export CLICOLOR=1 | |
| export EDITOR=vi | |
| export LC_ALL=en_US.UTF-8 | |
| export LANG=en_US.UTF-8 | |
| # Avoid the `._*` files in tar | |
| # https://superuser.com/a/61188 | |
| export COPYFILE_DISABLE=1 |
| #!/bin/bash | |
| CONFIG_PATH=~/.config/Code | |
| for i in $CONFIG_PATH/User/workspaceStorage/*; do | |
| if [ -f $i/workspace.json ]; then | |
| folder="$(python3 -c "import sys, json; print(json.load(open(sys.argv[1], 'r'))['folder'])" $i/workspace.json 2>/dev/null | sed 's#^file://##;s/+/ /g;s/%\(..\)/\\x\1/g;')" | |
| if [ -n "$folder" ] && [ ! -d "$folder" ]; then | |
| echo "Removing workspace $(basename $i) for deleted folder $folder of size $(du -sh $i|cut -f1)" |
| Windows Registry Editor Version 5.00 | |
| [HKEY_CLASSES_ROOT\directory\background\shell\git_fork] | |
| @="Open in &Fork" | |
| "Icon"=hex(2):25,00,4c,00,4f,00,43,00,41,00,4c,00,41,00,50,00,50,00,44,00,41,\ | |
| 00,54,00,41,00,25,00,5c,00,46,00,6f,00,72,00,6b,00,5c,00,46,00,6f,00,72,00,\ | |
| 6b,00,2e,00,65,00,78,00,65,00,2c,00,30,00,00,00 | |
| [HKEY_CLASSES_ROOT\directory\background\shell\git_fork\command] | |
| @=hex(2):22,00,25,00,4c,00,4f,00,43,00,41,00,4c,00,41,00,50,00,50,00,44,00,41,\ |
| #!/usr/bin/env bash | |
| CIPHERS='ALL:eNULL' | |
| DELAY=${2:-0.1} | |
| SERVER=${1:?usage: $0 <host:port> [delay, default is ${DELAY}s] [ciphers, default is ${CIPHERS}]} | |
| MAXLEN=$(openssl ciphers "$CIPHERS" | sed -e 's/:/\n/g' | awk '{ if ( length > L ) { L=length} }END{ print L}') | |
| echo Using $(openssl version). | |
| declare -A TLSMAP=( [tls1_1]=cipher [tls1_2]=cipher [tls1_3]=ciphersuites ) |