Tmux

Session Management

tmux new -s session_name
Create new session with name
tmux ls
List all sessions
tmux attach -t session_name
Attach to session
tmux kill-session -t session_name
Kill specific session

Window Management

Ctrl-b c
Create new window
Ctrl-b n
Next window
Ctrl-b p
Previous window
Ctrl-b &
Kill current window

Pane Management

Ctrl-b %
Split horizontally
Ctrl-b "
Split vertically
Ctrl-b arrow keys
Navigate between panes
Ctrl-b x
Kill current pane

Other Commands

Ctrl-b d
Detach from session
Ctrl-b [
Enter copy mode
Ctrl-b ?
Show help

Vi/Vim

Modes

i
Insert mode
Esc
Normal mode
:
Command mode
v
Visual mode

Navigation

h, j, k, l
Left, down, up, right
w
Next word
b
Previous word
0
Beginning of line
$
End of line
gg
Go to first line
G
Go to last line

Editing

dd
Delete line
yy
Copy line
p
Paste
u
Undo
Ctrl-r
Redo

Search & Replace

/pattern
Search forward
?pattern
Search backward
n
Next match
:%s/old/new/g
Replace all occurrences

File Operations

:w
Save file
:q
Quit
:wq
Save and quit
:q!
Quit without saving

OpenSSL

Certificate Operations

openssl req -new -x509 -days 365 -nodes -out cert.pem -keyout key.pem
Generate self-signed certificate
openssl x509 -in cert.pem -text -noout
View certificate details
openssl x509 -in cert.pem -dates -noout
Check certificate expiration

Key Operations

openssl genrsa -out private.key 2048
Generate RSA private key
openssl rsa -in private.key -pubout -out public.key
Extract public key
openssl rsa -in private.key -text -noout
View private key details

Encryption/Decryption

openssl enc -aes-256-cbc -salt -in file.txt -out file.enc
Encrypt file with AES-256
openssl enc -aes-256-cbc -d -in file.enc -out file.txt
Decrypt file

Hashing

openssl dgst -sha256 file.txt
Calculate SHA-256 hash
echo -n "text" | openssl dgst -sha256
Hash string

SSL/TLS Testing

openssl s_client -connect example.com:443
Test SSL connection
openssl s_client -connect example.com:443 -servername example.com
Test with SNI

Memcached (via netcat)

Basic Operations

echo "stats" | nc localhost 11211
Get server statistics
echo "version" | nc localhost 11211
Get version information
echo "quit" | nc localhost 11211
Close connection

Cache Operations

echo "get key1" | nc localhost 11211
Retrieve value by key
printf "set key1 0 3600 5\r\nvalue\r\n" | nc localhost 11211
Set key with value (expires in 1 hour)
echo "delete key1" | nc localhost 11211
Delete key
echo "flush_all" | nc localhost 11211
Clear all cache

Statistics & Monitoring

echo "stats items" | nc localhost 11211
Get item statistics
echo "stats slabs" | nc localhost 11211
Get slab statistics
echo "stats sizes" | nc localhost 11211
Get size statistics

Advanced Operations

printf "add key2 0 0 5\r\nvalue\r\n" | nc localhost 11211
Add key only if it doesn't exist
printf "replace key1 0 0 8\r\nnewvalue\r\n" | nc localhost 11211
Replace existing key
printf "append key1 0 0 4\r\nmore\r\n" | nc localhost 11211
Append to existing value