Skip to content

Instantly share code, notes, and snippets.

@JihoChoi
Last active July 26, 2020 04:32
Show Gist options
  • Save JihoChoi/bb3f5ebbf90052a421788b704be1bcec to your computer and use it in GitHub Desktop.
Save JihoChoi/bb3f5ebbf90052a421788b704be1bcec to your computer and use it in GitHub Desktop.
# Jiho Choi
# OS, Hardware, Monitoring
# GUI Shell
xdg-open .
# ================
# OS Specification
# ================
ps -u -p [PID] # Check the user of process with PID [PID]
cat /proc/PID/cmdline | xargs -0 echo # command for PID
htop
# Show Linux Version
lsb_release -a
uname -a
# System Monitor
gnome-system-monitor
# Storage
df -h --total
df -h
lsblk
# ======================
# Hardware Specification
# ======================
# --- #
# CPU #
# --- #
# Show Process Info
cat /proc/cpuinfo
grep -c processor /proc/cpuinfo # CPU Core # CPU -> 56
grep 'cpu cores' /proc/cpuinfo | tail -1 # Core / CPU -> 14
# --- #
# GPU #
# --- #
# Show GPU Info
nvidia-smi
watch nvidia-smi
# ------ #
# Memory #
# ------ #
sudo apt install ncdu
# ---- #
# Disk #
# ---- #
ls -laShr [PATH]
du -hs [PATH]
du -sh
df -h --total
sudo du -d 1 /home | sort -gr # sort by user
du -h --max-depth=1 /
du -h --max-depth=1 ./ | sort -h
# ======================
# Users & Groups
# ======================
# List all users
cut -d: -f1 /etc/passwd
# List sudo group
grep -Po '^sudo.+:\K.*$' /etc/group
# Add, Remove
sudo gpasswd -a <username> sudo
sudo gpasswd -d <username> sudo
sudo usermod -aG sudo <username>
# Add for 1 day
grep -Po '^sudo.+:\K.*$' /etc/group | at now +1 minutes
sudo gpasswd -d <username> sudo | at now +24 hours
grep -Po '^sudo.+:\K.*$' /etc/group | at now +1 minutes
gsettings set org.gnome.shell.app-switcher current-workspace-only true
# ========================
# Settings & Configuration
# ========================
gnome-shell --version
# Korean Input (Restart required)
All Settings > Language Support, Text Entry, Keyboard
dconf
> sudo apt-get install dconf-tools
# Caps Lock <-> Escape
setxkbmap -option caps:escape
# Screenshot Shortcut
System Setting -> Keyboard -> Shortcuts -> Custom Shortcuts
Screen Capture Area / gnome-screenshot -a / Alt + Shift + 4
# Separate Workspace
gsettings set org.gnome.shell.app-switcher current-workspace-only true
# Shortcuts
# Install & Launch
sudo apt-get install --no-install-recommends gnome-panel
gnome-desktop-item-edit --create-new ~/Desktop
# -------
# apt-get
# -------
sudo dpkg --configure -a
# terminal / files not opening
<ALT> + <CTRL> + <F3>
apt inatll --reinstall gnome-terminal
# terminal <ALT> + <F2> -> xterm
sudo locale-gen --purge
sudo locale-gen
sudo localectl set-locale LANG="en_US.UTF-8"
sudo apt-get autoremove chrome-remote-desktop

Tweaks

GNOME Shell Eextensions

  • Dash to Dock
  • Put Windows
  • Multi Monitors Add-On
  • Workspace Indicator

dconf

gnome-shell --version

Settings

  • Devices/Keyboard/Keyboard Shortcuts

ncdu - file system / storage viewer

sudo apt-get install ncdu

ffmpeg - Video format converter

ffmpeg -fflags +genpts -i input_30.webm -r 30 output_30.mp4

cap lock -> escape

sudo apt install gnome-tweak-tool Gnome Tweaks -> Keyboard & Mouse -> Additional Layout Options -> Caps Lock key behavior.

TODOs

Keyboard / Shortcuts

Monitor / Workspaces

Dock

Activities

Autokey

  • clog -> console.log();

Separate Docks for workspaces

gsettings set org.gnome.shell.extensions.dash-to-dock isolate-workspaces true

Alt + Tab for separte windows

http://ubuntuhandbook.org/index.php/2019/02/alt-tab-display-separate-windows-ubuntu-18-04/

Separate 'Activities' for dual monitors setup

https://extensions.gnome.org/extension/921/multi-monitors-add-on/

Spearate docks for workspaces

gsettings set org.gnome.shell.extensions.dash-to-dock isolate-workspaces true

Window Placement

sudo apt-get install compizconfig-settings-manager sudo apt-get update && sudo apt-get install compiz-plugins

https://askubuntu.com/questions/1070001/ubuntu-18-04-get-ubuntu-dock-to-only-display-the-windows-from-the-current-scre gsettings set org.gnome.shell.extensions.dash-to-dock isolate-monitors true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment