Bondi Beach original
Bondi Beach upscayled
Young Girl in Upscayl
Young Girl original
Young Girl upscayled
OpenSSH
Server on Windows e.g. Windows 10. From Windows 10, it natively supports OpenSSH
.NOTE: The beta and nightly build of OpenSSH
Server for Windows have a lot of runtime issues.
Check OpenSSH
installation:
1 | PS C:\ProgramData\ssh> Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH*' |
Install the missing OpenSSH
Server:
1 | PS C:\ProgramData\ssh> Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0 |
Check OpenSSH
for Windows version, check Windows Operating System version:
1 | PS C:\ProgramData\ssh> ((Get-Item (Get-Command sshd).Source).VersionInfo.FileVersion) |
Check Windows Domain information:
1 | PS C:\ProgramData\ssh> dsregcmd /status |
Check OpenSSH
Server for Windows run as a service:
Make sure OpenSSH SSH Server firewall inbound rule allows ALL profiles:
The default C:\ProgramData\ssh\sshd_config
file doesn’t work for Windows Domain users authentication, and does’t support .ssh\authorized_keys
public key authentication. Error lookup_principal_name: User principal name lokup failed for user ‘corp\darling’ in OpenSSH
Server C:\ProgramData\ssh\logs\ssd
log file. A work around solution is to comment out lines:
1 | #Match Group administrators |
A complete sshd_config
example file:
1 | # This is the sshd server system-wide configuration file. See |
Now run ssh client and log on SSH Server:
1 | sshpass -f ~/.ssh/windows.passwd ssh -l darling windows.local |
windows.local
has VPN connection which is granted with git repository.1 | ssh-copy-id -i id_rsa.pub darling@windows.local |
If PasswordAuthentication
is enforced, and pubilc key authentication
in SSH Server is not supported, try:
1 | sshpass -f ~/.ssh/windows.passwd ssh -D 3128 -q -C -N -f darling@windows.local |
git
with Sock/Socks5 proxy1 | git config http.proxy 'socks5://localhost:3128' |
Then can access git repository via proxy both on command line and in UI client.
]]>sshpass
is a friend here for you.Install sshpass
in MacOS:
1 | brew install esolitos/ipa/sshpass |
Test sshpass
:
1 | $ ssh -oProxyCommand="sshpass -f ~/.ssh/windows.passwd ssh -W %h:%p jumphost" -l darling jumphost-npe.paradise.net |
Setup .ssh/config
file:
1 | ## Keeping SSH Sessions Alive |
Righ model, right tools - the new way of building and collaborating on frontend apps is the core element of Micro Frontends.
]]>Conclusion:
ARM vs x86 谁是未来,一目了然。
NOTE
The Apple M1 chip is built for Macs, and the A15 for phones. They use completely different architectures. The A15 prioritizes battery over performance. The M1 has more firepower for graphics.
]]>Step by step:
![Safari Develop menu](/img/Safari Develop.png “Safari Develop menu”)
![Web Inspector](/img/Web Inspector.png “Web Inspector”)
]]>First you have Zsh
, next install Oh My Zsh
https://ohmyz.sh/
1 | sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" |
Add Powerlevel10k
https://github.com/romkatv/powerlevel10k and configure it
1 | git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k |
Set ZSH_THEME
to powerlevel10k in .zshrc
1 | ZSH_THEME="powerlevel10k/powerlevel10k" |
Add zsh-autosuggestions
https://github.com/zsh-users/zsh-autosuggestions and enable in .zshrc
1 | git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions |
1 | ... |
Install Fig
https://fig.io/, an IDE-style autocomplete but for terminal, and configure in .zshrc
1 | ... |
jq
.Export all the data from AWS DynamoDB table at first:
1 | 𝜆 aws --profile production dynamodb scan --table-name tiles > tiles.json |
The exported JSON data looks like:
1 | { |
Extract / transform JSON data:
1 | 𝜆 cat tiles.json | jq '[.Items[] | { id: .id.S, title: .title.S, description: .description.S, status: .status.S, valid_from: .valid_from.S, valid_to: .valid_to.S }]' > tiles-extracted.json |
Convert JSON data into CSV:
1 | 𝜆 cat tiles-extracted.json | jq -r '(.[0] | keys_unsorted) as $keys | $keys, map([.[ $keys[] ]])[] | @csv' > tiles.csv |
To copy the behavior of IntelliJ, go with:
Install macros
author by geddski in VS Code.
Edit settings.json
and add:
1 | "macros": { |
keybindings.json
and add:1 | [ |
At first, export all the data from AWS DynamoDB table:
1 | 𝜆 aws --profile production dynamodb scan --table-name tile-event > tile-event-export.json |
Convert a list of items/records (DynamoDB JSON) into individual PutRequest JSON with jq
.
1 | 𝜆 cat tile-event-export.json | jq '{"Items": [.Items[] | {PutRequest: {Item: .}}]}' > tile-event-import.json |
Transform the data if necessary:
1 | 𝜆 sed 's/tile-images-prod/tile-images-pdev/g' tile-event-import.json > tile-event-import-transformed.json |
Split all requests into 25 requests per file, with jq
and awk
(Note: There are some restriction with AWS DynamoDB batch-write-item request - The BatchWriteItem operation can contain up to 25 individual PutItem and DeleteItem requests and can write up to 16 MB of data. The maximum size of an individual item is 400 KB.)
1 | 𝜆 cat tile-event-processed.awk |
Import all 22 processed JSON files into DynamoDB table:
1 | for f in tile-event-import-processed-{1..22}.json; do \ |
Get CloudWatch log groups start with paradise-api
:
1 | 𝜆 saw groups --profile ap-prod --prefix paradise-api |
Get last 2 hours logs for paradise-api
from CloudWatch, with saw:
1 | 𝜆 saw get --profile ap-prod --start -2h paradise-api-CloudFormationLogs-mwwmzgYOtbcB --prefix docker | jq .log | sed 's/\\\n"$//; s/^"//' |
1 | /proc/[pid]/environ |
A simple way is to apply xargs -0 -L1 -a
on it:
-0
- read null-delimited lines,-L1
- read one line per execution of command-a
- file read lines from file1 | ps -aef |
1 | 𝜆 aws --version |
Encrypt with AWS KMS key:
1 | 𝜆 aws kms encrypt --profile personal \ |
Decrypt with AWS KMS key:
1 | 𝜆 echo "AQICAHjbJrIPgME ... lILuBSUdA==" | base64 -D | \ |
AWS CDK
& SAM
, AWS Step Functions
, TypeScript
, VS Code
, Open API Top Down Design and Test Driven Development, in order to rapidly build a prototype, or a POC, verify and test some technologies and approaches.Request Handler => Step Functions (orchestration for Lambda functions, represents a single centralized executable business process, outsources low level operations like retry / exception catch and handle. Another choice is SNS) => Service Providers
Have experienced of Terraform
, Serverless
, AWS SAM
… now this time based on code over configuration principle, what you get is flexibility, predictability and more control. You focus on code you tell the tools what steps it has to complete directly. At the end of day, it is a simple matter of separation of concerns and single responsibility principle.
• VS Code
for API Spec editing
• Postman
API, Environment and Mock server, for QA team, then switch to real service in DEV/TEST environment
1 | 𝜆 npm run openapi |
• openapi-generator
generates model classes; typescript-json-validator
generates JSON Schema and validator
1 | 𝜆 openapi-generator generate -g typescript-node -i Notification\ API\ openapi.json -o Notification\ API\ generated |
• Onboard on Kong / API Manager, https://konghq.com/kong/
• CDK
, is based on CloudFormation but abstract layer on the top of it. It can generates CloudFormation template file template.yaml
1 | 𝜆 cdk synth --no-staging > template.yaml |
• Demo of local run and debug lambda, with background TSC watch process
1 | 𝜆 npm run watch |
Data validation to make data integrity unbreachable will take a lot time.
ajv
framework and performance benchmark, https://github.com/ebdrup/json-schema-benchmark
• Code lint with eslint
and prettier
and automatically correction
• Code commit rule enforcement
• Change code and deploy AWS stack by CDK
1 | 𝜆 cdk deploy --require-approval never --profile dev-cicd |
• Behavior Driven Test Framework Jest, https://github.com/facebook/jest, 2x / 3x faster than Karma, with code coverage, easy mocking
1 | 𝜆 npm t |
• Automatically generate application changelog and release notes
1 | 𝜆 npm run release:minor |
• Automatically generate application document
1 | 𝜆 npm run docs |
• AWS resources created by CDK
• Not Mono Repo app, which multiple projects all under one giant Repo
• ONE AWS Layers
put all dependent NPM libs and shared code into; size of Lambda functions, readability
• AWS EventBridge
tro trigger and send event to Request Handler, for scheduling task
• Health Check, with Service Monitoring Dashboard, verify dependencies at the endpoints, keep Lambda warming up
1 | 𝜆 curl https://c81234xdae8w1a9.execute-api.ap-southeast-2.amazonaws.com/health |
Cloud computing and Serverless architecture let developers in fast lane for Application Development. Right now, there are so many low hanging fruit to pick up.
As developers, we should not always think about our comfort zone, we need to think about people who take over your work, think about BAU team to support the application. The codebase is not about you, but about the value that your code brings to others, and the organization that you work for.
]]>This is my second video created and composed by Apple Final Cut Pro X - Why Repairable Is Important https://www.youtube.com/watch?v=qSmFI6J7eRo
]]>