XXIIVV

Linux is a collection of tools built within the Unix operating systems.

linux software

dwm

Shift+Alt+EnterOpen terminal session
Shift+Alt+CClose Application
Shift+Alt+QQuit
Alt+POpen Application
Alt+JPrevious Application
Alt+KNext Application
Alt+TTile Applications
Alt+MouseLeftMove floating window
Alt+MouseRightResize floating window

To change the content of the rightmost label in the menu bar, edit the content of ~/.xinitrc.

while true; do
  xsetroot -name $(arvelie)" "$(neralie)
  sleep 1m
done &

exec dwm

micro

Ctrl+TNew Tab
Ctrl+BRun shell command
Ctrl+ERun micro command

surf

Ctrl+HBack History
Ctrl+LNext History
Ctrl+BToggle Input
Ctrl+Shift+O

Git

Cache Password

git config remote.origin.url # Get URL
git config credential.helper store
git push REPOSITORY.git # Replace with URL

Merge

git remote add ft git@git.sr.ht:~ft/orca
git fetch ft
git merge ft/variable-index-0

SSH

ssh-keygen # Generate a key
vi ~/.ssh/id_rsa.pub # See the key

CMUS

Get cmus currently playing.

cmus-remote -Q | grep tag | head -n 3 | cut -d ' ' -f 3- 

Commands

Feh

Viewing graphic files.

feh -m # Montage mode
feh -w # Multi-window mode
feh -i # Index mode
feh -m --thumb-height 150 --thumb-width 200

EyeD3

Editing the ID3 tags of MP3 files.

eyeD3 -a "Artist" -A "Album" -t "Track Title" song.mp3
eyeD3 song.mp3

Youtube-dl

Converting videos to mp3 files.

sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl
sudo chmod a+rx /usr/local/bin/youtube-dl
// Single
youtube-dl -x --audio-format mp3 https://www.youtube.com/watch?v=sfIls6LMAGE
// Playlist
youtube-dl --extract-audio --audio-format mp3 -o "%(title)s.%(ext)s" 'https://www.youtube.com/watch?v=5KpK7yhDRXE&list=PLfGibfZATlGq4e4UsUiPLs3asiOqysjei'

Format SD Card

lsblk # Find device
sudo parted /dev/sdb --script -- mklabel msdos # Create partition, replace sbd with device name
sudo parted /dev/sdb --script -- mkpart primary fat32 1MiB 100% # Take all available space
sudo mkfs.vfat -F32 /dev/sdb1 # Format
sudo parted /dev/sdb --script print # Verify

Mount USB Stick

lsblk # List all devices, find dev/sda1
mkdir usbstick # create a folder somewhere
mount dev/sda1 /usbstick # use the folder to browse usb stick

Format hard drive

df -h
sudo umount /dev/sdb2
sudo mkfs.vfat /dev/sdb2

Config Micro

To set the theme to the terminal colors, use set colorscheme cmc-16.

micro ~/.config/micro/settings.json
{
  "color_scheme": "Packages/Theme/Tech49.tmTheme",
  "font_size": 9,
  "margin": 2,
  "tab_size": 2,
  "theme": "Adaptive.sublime-theme",
  "translate_tabs_to_spaces": true
}

Fish

sudo apt-get install fish
chsh -s /usr/bin/fish

Use a .deb File

sudo dpkg -i filename.deb
sudo dpkg -i ./bitwig-studio-3.1.3.deb # Updating bitwig

Shutdown/Restart

sudo shutdown now
sudo restart

Make applications available globally

Edit ~/.bashrc, when finished run source ~/.bashrc.

export PATH=$PATH:/home/pi/applications

Capture video and audio

ffmpeg -f x11grab -video_size 1366x768 -framerate 25 -i $DISPLAY -f pulse -ac 2 -i default -c:v libx264 -preset ultrafast -c:a aac screen.mp4

Resize video for web

ffmpeg -i screen.mp4 -vcodec libx264 -vf "pad=ceil(iw/2)*2:ceil(ih/2)*2" -pix_fmt yuv420p -strict experimental -r 30 -t 2:20 -acodec aac -vb 1024k -minrate 1024k -maxrate 1024k -bufsize 1024k -ar 44100 -ac 2 output.mp4

Find file size

du -sk name

Battery management

sudo powertop --auto-tune

Autodetect time

systemctl enable ntpd
systemctl enable ntpdate

Copy image to clipboard

xclip -selection clipboard -t image/png -i example.png

Images to PDF

convert image1.jpg image2.png image3.bmp output.pdf

Folder of images to pdf

convert *.jpg output.pdf

Plan9Port

git clone https://github.com/9fans/plan9port /usr/local/plan9
chown -R $(whoami):$(whoami) /usr/local/plan9
cd /usr/local/plan9
./INSTALL

# add /usr/local/plan9/bin to your $PATH
export PATH=$PATH:/usr/local/plan9/bin
— Submit an edit to linux.htm(217 lines)