Skip to content

Instantly share code, notes, and snippets.

@toydotgame
Last active September 23, 2021 05:27
Show Gist options
  • Save toydotgame/3ff4467b8c223c2a06530d0710d1ab5e to your computer and use it in GitHub Desktop.
Save toydotgame/3ff4467b8c223c2a06530d0710d1ab5e to your computer and use it in GitHub Desktop.
Linux Tricks
[Desktop Entry]
Version=1.0
Type=Application
Name=Application
Comment=This file goes in /usr/share/applications
Exec=/path/to/app.sh
Icon=/path/to/icon.png
Path=/path/to/launch/directory/
Terminal=false
StartupNotify=false
  1. Check out https://www.codejava.net/ides/eclipse/change-java-compiler-version-for-eclipse-project. Apply these changes for the whole of the IDE, not just the selected project.

  2. Right-click the current project, select your builder (Ant, probably), select Edit, go to the JRE tab, then, in the top box, select Seperate JRE:, then java-8-openjdk as you have set up beforehand.

  3. Save your changes and re-compile!

  4. You can check your changes by doing the following: (Check for Java 1.8.0)

unzip -p foo.jar META-INF/MANIFEST.MF
sudo intel_gpu_top
# (Requires intel-gpu-tools package)
# Shows you the folders in PATH:
echo $PATH
# .zshrc will have a line a bit like this:
export PATH="/path/to/bin1:/path/to/bin2:$PATH"
# Just add your bin/ directory's full path (From /, not ~) to that.
# To list orphans:
pacman -Qdt
# To remove said orphans:
sudo pacman -Rsn $(pacman -Qdtq)
# Prepending `sudo`
###################
cp /path/to/file /foo/bar # Returns "Permission denied"
sudo !! # Repeats pervious command but with `sudo` prepended. In this case, `sudo !!` = `sudo cp /path/to/file /foo/bar`
# "Cutting & Pasting"
######################################
pacman -Q | wc -l
# Put cursor just after `-Q`, [Ctrl]+[K]:
pacman -Q
# [Ctrl]+[Y] (from the same position):
pacman -Q | wc -l
# [Ctrl]+[U] is the opposite of [Ctrl]+[K]. It will cut text BEFORE the cursor.
# [Ctrl]+[Y] inserts, not overwrites.
# Kill one Word Backwards
#########################
sudo pacman -S nano
# [Ctrl]+[W]:
sudo pacman -S
# `reset`
#########
reset
# is the nuclear alternative to `clear`. It basically relaunches the shell but with the same window.
  1. Open Settings Editor (not Settings Manager).
  2. Run
    xfconf-query -c <Channel on the left pane of Settings Editor> -m
  3. Change the setting(s) you want.
  4. With the output, run
    xfconf-query -c <Channel> -p /<Category>/<Subcategory>/ -s "Value"
    to change an existing setting, and
    xfconf-query -c <Channel> -p /<Category>/<Subcategory>/ -n -t <int|string|boolean> -s "Value"
youtube-dl -x --audio-format mp3 dQw4w9WgXcQ
youtube-dl -f mp4 dQw4w9WgXcQ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment