IT General Knowledge
Newline Character
- Classic Mac OS:
\r
- Unix-like:
\n
- Windows:
\r\n
IP
Public Network vs Private Network
Load Balance
Load Balancer (L4 Load Balancer)
- L4 meaning transport layer in OSI model.
- It make route decision based on IP & port.
Reverse Proxy (L7 Load Balancer)
- L7 meaning application layer in OSI model.
- It's a public virtual host for internal web servers.
Non-Standard Headers
X-Forwarded-For
X-Real-IP
X-Forwarded-Host
X-Forwarded-Proto
RC7239
tmux
Prefix
- All tmux shortcut started with prefix
- Default:
^B
- I prefer: ` or
Escape
- My tmux configuration: .tmux.conf
User Configuration
Session & Client Operations
- List sessions:
tmux ls
List clients: tmux lsc
, I never used.
- Attach to last used session:
tmux attach
or tmux a
- Attach to specific session:
tmux a -t <target session>
- Detach client:
tmux detach
or prefix, d
- Switch to previous client: prefix,
(
- Switch to next client: prefix,
)
Window & Pane Operations
- Split window (to panes): prefix,
%
/"
- Move around panes: prefix, arrow keys(↓/←/→/↑)
- Kill pane: prefix,
x
- New window: prefix,
c
- Select the previous window: prefix,
p
- Select the next window: prefix,
n
History Operations
- Enter copy mode: prefix,
[
- Leave copy mode:
q
Other Shortcuts
- List key bindings: prefix,
?
PowerShell
Create TLS Certificate
Disable Weak Cipher
TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA (ecdh_x25519) - A
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA (ecdh_x25519) - A
TLS_DHE_RSA_WITH_AES_256_CBC_SHA (dh 2048) - A
TLS_DHE_RSA_WITH_AES_128_CBC_SHA (dh 2048) - A
TLS_RSA_WITH_AES_256_CBC_SHA (rsa 2048) - A
TLS_RSA_WITH_AES_128_CBC_SHA (rsa 2048) - A
TLS_RSA_WITH_3DES_EDE_CBC_SHA (rsa 2048) - C
TLS_RSA_WITH_RC4_128_SHA (rsa 2048) - C
TLS_RSA_WITH_RC4_128_MD5 (rsa 2048) - C
Nmap
SSL/TLS
nmap -sV --script ssl-enum-ciphers -p 443 <host>
SELinux
SSH Port
sudo semanage port --list | grep ssh
sudo semanage port --add --type ssh_port_t --proto tcp 1234
semanage port -at ssh_port_t -p tcp 1234
Database
MySQL
Reset root password
Create & Grant user
Create Database
Oracle 11g
Export / Import
- Table Exports/Imports
- Schema Exports/Imports
- Database Exports/Imports
Oracle 19c
Install on Centos 7
- RPM
- Config /etc/hosts
- Config
- Check config log
- Set Environment Variables for Oracle user
- Create a DBA user
- Firewall
Install on CentOS 8
- RPM
- Config
- Check config log
- Set Environment Variables for Oracle user
- Create a DBA user
- Firewall
Oracle
Tablespace
Privileges
Backup Table
Log Rotation
logrotate
logrotate.d
Convention is to put logrotate config file in directory logrotate.d
logrotate manually
Shell Scripts
Bash
Absolute path of script
Container
Docker
Restart Policy
docker run --restart always ...
docker update --restart=always <container>
docker inspect <container>
Windows
Excluded Port ranges
- Clear a lot of ports that used by The Windows NAT Driver service.
Linux
RPM Download (RedHat, CentOS)
- Download RPM that already installed.
--destdir
: destination directory
--resolve
: download dependencies (that are not installed).
Create User
Network
Disable IPv6 on a specific interface
- CentOS 7
/etc/sysctl.conf
net.ipv6.conf.eth0.disable_ipv6 = 1
- CentOS 8
nmcli con modify eth0 ipv6.method disable
CentOS 8
PPPoE
- Install (by DVD)
- Install (by network)
- Configure Network Manager
DHCP Server
NAT