Skip to content

Instantly share code, notes, and snippets.

@pemre
Last active July 28, 2021 11:55
Show Gist options
  • Save pemre/52dc03b129bf19bae7a24abf49de79f9 to your computer and use it in GitHub Desktop.
Save pemre/52dc03b129bf19bae7a24abf49de79f9 to your computer and use it in GitHub Desktop.

Useful Linux commands

Utility

  • Compress a pdf file: gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf
  • Resize a pdf file (e.g. from US letter) to A4: gs -o output.pdf -sDEVICE=pdfwrite -sPAPERSIZE=a4 -dFIXEDMEDIA -dPDFFitPage -dCompatibilityLevel=1.4 input.pdf
  • Show a summary of the running hardware: inxi -Fxz
  • Convert mp4 to gif: ffmpeg -i example.mp4 -r 15 -vf scale=512:-1 -ss 00:00:02 -to 00:00:06 example.gif
  • Split video into smaller chunks: ffmpeg -i *.mp4 -c copy -map 0 -segment_time 00:02:00 -f segment -reset_timestamps 1 output_%03d.mp4

Git

  • Submodule update: git submodule update --recursive --remote

Manjaro knowledge

  • Restart network manager: systemctl restart NetworkManager.service
  • Fix: Can not connect to internet!
    • Use dhcpcd instead of dhcp in NetworkManager.

    • Init/edit this file: sudo xed /etc/NetworkManager/conf.d/dhcp-client.conf

    • Then add:

      [main]
      dhcp=dhclient
      
  • Remove title bar gap with maximized Firefox windows: Switch the Theme option for Window borders from Mint-Y-Dark to Adapta.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment