#!/bin/bash
# =====================================================================
# Script Name: example_script.sh
# Description: Template for a production-ready shell script
# =====================================================================
# Enable Strict Mode
# Exit on error, treat unset variables as errors, and fail on errors in pipelines.
set -euo pipefail
-
Read more
-
Linux Using Notes
Flush DNS cache
sudo resolvectl flush-caches
Install dynamic libs *.so
After installing, use
ldconf
to refresh symbolic links and caches, or apps may not find your newly installed *.so.rsync vs scp
They are similar tools but you may prefer to use one over another in certain cases:
- scp is …
-
Tmux Notes
Common Sense
Tmux is an open-source terminal multiplexer for Unix-like operating systems. It allows multiple terminal sessions to be accessed simultaneously in a single window. It is useful for running more than one command-line program at the same time.
Terms:
- Session: A session can have multiple windows.
- Window: A window …
-
Regular Expression Learning Notes
-
C and C++ Learning Notes
Deep Copy & Copy Constructor
The compiler also creates a copy constructor if we don’t write our own copy constructor. Unlike the default constructor, the body of the copy constructor created by the compiler is not empty, it copies all data members of the passed object to …
-
Tech Life Hacks
Port Forwarding Using SSH
Sometimes we are faced with the following situation:
graph LR A(Computer A)-->|SSH|B(Server A 192.168.1.3) B-->|has access via 192.168.1.2:80|C(Server B 192.168.1.2) A-->|does not have access|C
Read moreComputer A
is … -
Python Learning Notes
-
VSCode Using Notes
How to add "Program Files" in VS Code settings
Use
"C:\Program Files\..."
orC:\"Program Files"\...
How to write MATLAB scripts in VSCode
However, I find it not a good idea. The terminal crashes from time to time and
Workspace
in MATLAB cannot be integrated into vscode.The main …
Read more -
Git Learning Notes
Workflow
When using git to collaborate with others, the following workflow should be taken:
git checkout main
to switch the local branch to main.git pull origin main
to pull the remote main branch to the local branch to catch up the work.git checkout -b newLocalBranchName
to create a …
-
Matlab Learning Notes
Docs: MATLAB Help Center
Table Related
How to filter a table
theTable(theTable.VariableName == 0, :);
returns a table that contains every row in
theTable
whoseVariableName == 0
.Remove Rows from Table
This removes rows with row id 3,5,7 from the table.
table([3,5,7],:)=[];
Things Unique …
Read more