Pour résoudre un problème, ou pour apprendre une commande, je n'ai pas toujours envie de scroller sur StackOverflow, ou d'ouvrir 4 onglets sur le même sujet pour trouver une solution efficace.
J'essaie donc de faire des tutos les plus courts possibles. 30 secondes est le maximum d'attention dont tu as besoin pour lire les tutos suivants.
Please PR if you find a mistake.
Install the postgresql package.
sudo pacman -S postgresql
Switch to postgres user.
sudo -iu postgres
Initialize the database cluster.
[postgres]$ initdb -D /var/lib/postgres/data
Start the postgresql.service.
systemctl start postgresql
Or enable it if you want postgresql launches at startup.
systemctl enable postgresql
Use it with caution :
find . -name "*.bak" -type f -delete
git
Requirements:
For example with push :
git -c /your/repo/dir push -v
-v is optional. It's the verbose output.
linux
Requirements :
On Debian or Ubuntu :
sudo apt-get install build-essential procps curl file git
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
test -d ~/.linuxbrew && eval "$(~/.linuxbrew/bin/brew shellenv)"
test -d /home/linuxbrew/.linuxbrew && eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
test -r ~/.bash_profile && echo "eval \"\\((\)(brew --prefix)/bin/brew shellenv)\"" >> ~/.bash_profile
echo "eval \"\\((\)(brew --prefix)/bin/brew shellenv)\"" >> ~/.profile
sway ricing
Requirements :
Add in your sway config file, and before any color usage :
include "$HOME/.cache/wal/colors-sway"
linux vim
The system buffer in vim is *.
To select a buffer in vim, you have to press ".
To copy text, use y for yank.
So to copy text from vim to clipboard, type :
"*y
python
The last printed expression is assigned to the variable _.
Example :
>>> 125 * 23 / 100
28.75
>>> 125 - _
96.25
Pour connaître la taille du répertoire :
journalctl --disk-usage
En réduisant la taille que doivent prendre vos fichiers de logs, Linux va supprimer les plus anciens :
journalctl --vacuum-size=500M
Requirements :
cat your_file.sha512sum | shasum -a 512 --check filename
df
or
lsblk
Requirements :
dd if=~/your_linux_image.iso of=/dev/device_name bs=1M status=progress
You can switch to bs=4M with no hassle.
grep -E "class|def" file.py
pip list
To start the server in your current directory.
In command line :
python -m http.server
Requirements :
Concatenate audio files :
sox track1.ogg track2.ogg track3.ogg full_album.ogg
Resize cover image if needed :
convert cover.jpg -resize 720x720 small_cover.jpg
Merge audio and image into a video file :
ffmpeg -i small_cover.jpg -i full_album.ogg output.mp4
grep -r string ./*
-r to search recursively into current directory (./*).