4 November 2025

Cheatsheet

CNC

CNC Feed & Speed Calculator

mm
mm/tooth
m/min
Rough CNC Material Values
Material Cutting Speed (m/min) Feed per Tooth (mm/tooth)
Aluminum / Al alloys 200 – 400 0.02 – 0.10
Copper / Brass 100 – 200 0.01 – 0.05
Carbon Steel (mild) 60 – 120 0.01 – 0.05
Stainless Steel (Inox) 30 – 70 0.005 – 0.03
Cast Iron 40 – 80 0.01 – 0.04
Titanium 15 – 40 0.005 – 0.02
Softwood 80 – 120 0.02 – 0.05
Hardwood 50 – 80 0.01 – 0.04
MDF / Plywood 60 – 100 0.02 – 0.05

Values are rough estimates for general-purpose HSS or carbide tools. Adjust based on tool coating, CNC rigidity, and material hardness.

Digits conversion

Multi-Base Converter with Two's Complement

Decimal: -
Binary (unsigned): -
Two's Complement: -
Hexadecimal: -
Base64: -
Common Number Representations
Decimal Binary (unsigned) Two's Complement (8-bit) Hexadecimal Base64 (ASCII)
0 0000 0000 0000 0000 0x00 AA==
10 0000 1010 0000 1010 0x0A Cg==
255 1111 1111 -1 0xFF /w==
1024 0100 0000 0000 N/A (more than 8-bit) 0x400 EA==
65 0100 0001 0100 0001 0x41 QQ==
-10 N/A 1111 0110 0xF6 9g==

*Two's complement shown as 8-bit example; Base64 values assume ASCII encoding of the decimal value as a single byte.*

FFmpeg

FFmpeg Cheatsheet

Category Command / Usage Notes
Convert file ffmpeg -i input.mp4 output.avi or ffmpeg -i input.wav output.mp3 Simple format conversion
H.265 / HEVC ffmpeg -i input.mp4 -c:v libx265 output.mp4 Smaller size, slower encode
Adjust Quality ffmpeg -i input.mp4 -c:v libx264 -crf 23 output.mp4 Lower CRF = better quality
Remove audio ffmpeg -i input.mp4 -an output.mp4 Lower CRF = better quality
Adjust Quality ffmpeg -i input.mp4 -c:v libx264 -crf 23 output.mp4 Lower CRF = better quality
Audio Codec ffmpeg -i input.mp4 -c:a aac output.mp4 AAC audio encoding
Change Audio Bitrate ffmpeg -i input.mp4 -b:a 192k output.mp4 Set audio bitrate
Extract Audio ffmpeg -i input.mp4 -vn -acodec copy output.aac No video, copy audio stream
Resize Video ffmpeg -i input.mp4 -vf scale=1280:720 output.mp4 Set resolution
Maintain Aspect Ratio ffmpeg -i input.mp4 -vf "scale=1280:-1" output.mp4 Height auto-calculated
Rotate Video ffmpeg -i input.mp4 -vf "transpose=1" output.mp4 Rotate 90° clockwise
Cut Segment (No Re-encode) ffmpeg -ss 00:01:00 -to 00:02:30 -i input.mp4 -c copy output.mp4 Fast, keeps original codec
Cut Segment (Re-encode) ffmpeg -ss 00:01:00 -to 00:02:30 -i input.mp4 output.mp4 Re-encodes segment
Merge Videos ffmpeg -f concat -safe 0 -i file_list.txt -c copy output.mp4 file_list.txt contains paths of videos
Extract Single Frame ffmpeg -i input.mp4 -ss 00:00:10 -vframes 1 output.png Grab frame at 10s
Extract Frames Every Second ffmpeg -i input.mp4 -vf fps=1 frames_%03d.png One frame per second
Convert Video to GIF ffmpeg -i input.mp4 -vf "fps=10,scale=320:-1:flags=lanczos" output.gif Simple GIF conversion
Burn Subtitles ffmpeg -i input.mp4 -vf subtitles=subtitle.srt output.mp4 Hardcoded subtitles
Extract Subtitles ffmpeg -i input.mkv -map 0:s:0 output.srt First subtitle track
Stream to RTMP ffmpeg -re -i input.mp4 -c:v libx264 -preset veryfast -c:a aac -f flv rtmp://server/live/stream Live streaming

*This cheatsheet contains common FFmpeg commands for video/audio conversion, scaling, trimming, GIFs, subtitles, and streaming.*

Linux programs

Linux Setup & Engineering Tools Checklist

Task / Tool Command / Notes Checklist
Update System sudo apt update && sudo apt upgrade -y
Install Git sudo apt install git -y
Configure Git git config --global user.name "Your Name"
git config --global user.email "you@example.com"
Install Homebrew (Linuxbrew) /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Install Docker sudo apt install docker.io -y
Start & Enable Docker sudo systemctl start docker && sudo systemctl enable docker
Add User to Docker Group sudo usermod -aG docker $USER (log out/in required)
Install UFW / iptables sudo apt install ufw -y
Enable Firewall sudo ufw enable
Allow Common Ports sudo ufw allow 22 (SSH), sudo ufw allow 80 (HTTP)
Check Running Processes top or htop
Kill Process by PID kill -9 <PID>
Install Python & Pip sudo apt install python3 python3-pip -y
Install Numpy / Scipy / Sympy pip3 install numpy scipy sympy matplotlib
Install MATLAB / Octave (Optional) sudo apt install octave -y
Install FreeCAD / CAD Tools (Optional) sudo apt install freecad -y
Install Engineering Solvers / Utilities Open-source finite element tools:
sudo apt install fenics -y
sudo apt install salome -y

*Checklist covers common Linux packages, Docker setup, firewall, Git configuration, process management, and typical engineering libraries and solvers.*

PID Controller Tuning Cheatsheet

Method / Step Description / Formula Notes / Tips
Ziegler-Nichols (Ultimate Gain) 1. Set I & D to 0
2. Increase Kp until system oscillates → Ku (ultimate gain)
3. Measure oscillation period → Pu (ultimate period)
4. Set gains:
P: 0.6 Ku
I: 2 Ku / Pu
D: Ku * Pu / 8
Good starting point; may require fine-tuning for overshoot and noise
Cohen-Coon (Process Reaction Curve) 1. Measure process step response: gain (K), delay (L), time constant (T)
2. Compute:
Kp: (1/K)*(T/L)*(4/3 + L/(4*T))
Ti: L*(32 + 6*L/T)/(13 + 8*L/T)
Td: 4*L/(11 + 2*L/T)
Better for processes with significant dead time
Manual Tuning (Heuristic) 1. Set I & D to 0
2. Increase P until response is fast but stable
3. Introduce I to remove steady-state error
4. Add D to reduce overshoot / improve damping
Quick and intuitive; relies on experience
Rules of Thumb - P: Start low, increase gradually
- I: Small value to correct steady-state error
- D: Only if system overshoots or oscillates
- Sample time < 0.1 * system rise time
Useful for initial estimates in control loops
Common Tips - Always test in simulation if possible
- Watch for noise amplification with high D
- Limit I to prevent windup
- Use low-pass filter on derivative term if needed
Prevents instability and damage in physical systems
PID Formulas Continuous:
u(t) = Kp*e(t) + Ki*∫e(t)dt + Kd*de(t)/dt
Discrete:
u[n] = u[n-1] + Kp*(e[n]-e[n-1]) + Ki*e[n]*dt + Kd*(e[n]-2e[n-1]+e[n-2])/dt
Discrete form useful for microcontrollers / digital control

*This PID cheatsheet covers tuning methods, formulas, and practical tips for engineering control systems.*

Git OpenSCAD