dotfiles/README.md

289 lines
6.7 KiB
Markdown
Raw Normal View History

2020-12-01 02:27:42 +01:00
# dotfiles
## Bulk commands
2023-06-09 14:04:09 +02:00
2020-12-01 02:27:42 +01:00
```
yay -S spectrwm fish openssh rofi xorg xorg-server scrot xorg-xinit alacritty ranger feh xf86-video-intel librewolf-bin cifs-utils pulseaudio-alsa pulseaudio-ctl slock xautolock zip unzip alsa-utils redshift-minimal numlockx usbutils cmatrix yubikey-touch-detector tlp powertop phinger-cursors xdg-user-dirs
cp dotfiles/.xinitrc ~/
cp dotfiles/.fehbg ~/
cp dotfiles/.bash_profile ~/
cp dotfiles/.tmux.conf ~/
cp dotfiles/.gemrc ~/
cp dotfiles/.Xresources ~/
2021-10-06 11:19:09 +02:00
mkdir -p ~/.gnupg && cp dotfiles/.gnupg/gpg.conf ~/.gnupg/
chmod +x ~/.fehbg
2021-01-05 10:47:42 +01:00
mkdir -p ~/.config/{spectrwm,alacritty,rofi,fish/functions}
2021-10-06 11:19:09 +02:00
cp dotfiles/.config/spectrwm/* ~/.config/spectrwm/
cp dotfiles/.config/alacritty/alacritty.toml ~/.config/alacritty/
2021-10-06 11:19:09 +02:00
cp dotfiles/.config/rofi/config.rasi ~/.config/rofi/
2021-11-05 10:40:10 +01:00
cp dotfiles/.config/fish/config.fish ~/.config/fish/
2021-10-06 11:19:09 +02:00
cp dotfiles/.config/fish/functions/* ~/.config/fish/functions/
cp dotfiles/.config/user-dirs.dirs ~/.config/
2020-12-01 02:27:42 +01:00
sudo sed -i "s/autospawn = no/autospawn = yes/" /etc/pulse/client.conf
sudo cp dotfiles/X11/xorg.conf /etc/X11/
sudo cp dotfiles/system/slock@.service /etc/systemd/system/slock@.service
sudo systemctl enable slock@$USER.service
sudo cp dotfiles/xorg.conf.d/20-intel.conf /etc/X11/xorg.conf.d/
2021-01-05 10:47:42 +01:00
sudo cp dotfiles/system/mnt-data.* /etc/systemd/system/
sudo cp dotfiles/system/powertop.service /etc/systemd/system/
2021-10-06 11:19:09 +02:00
sudo systemctl enable --now mnt-data.automount powertop.service tlp.service
2020-12-01 02:27:42 +01:00
```
## Packages
### General purposes
2023-06-09 14:04:09 +02:00
2020-12-01 02:27:42 +01:00
```
2023-06-09 14:04:09 +02:00
yay -S spectrwm fish openssh rofi xorg xorg-server scrot xorg-xinit alacritty ranger feh xf86-video-intel librewolf-bin cifs-utils pulseaudio-alsa pulseaudio-ctl slock xautolock zip unzip alsa-utils redshift-minimal numlockx usbutils cmatrix yubikey-touch-detector tlp powertop phinger-cursors ttf-agave-nerd
2020-12-01 02:27:42 +01:00
```
2023-06-09 14:04:09 +02:00
### Hacking purposes
2020-12-01 02:27:42 +01:00
```
yay -S wfuzz exploitdb nmap gobuster nikto hydra perl-image-exiftool zsteg rtl88xxau-aircrack-dkms-git rockyou seclists fcrackzip gdb radare2 enum4linux peass hashcat intel-compute-runtime metasploit cuda
2020-12-01 02:27:42 +01:00
```
## Configurations
### Power
#### TLP
2023-06-09 14:04:09 +02:00
```
yay -S tlp
sudo systemctl enable --now tlp.service
```
#### Powertop
2023-06-09 14:04:09 +02:00
```
yay -S powertop
sudo cp dotfiles/system/powertop.service /etc/systemd/system/
sudo systemctl enable --now powertop.service
```
2020-12-01 02:27:42 +01:00
### Locale
2023-06-09 14:04:09 +02:00
2020-12-01 02:27:42 +01:00
```
sudo localectl set-keymap fr
sudo localectl --no-convert set-x11-keymap fr pc104
sudo localectl set-locale LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8
sudo timedatectl set-timezone Europe/Paris
2020-12-01 12:12:11 +01:00
sudo timedatectl set-ntp true
2020-12-01 02:27:42 +01:00
```
### Freebox share
2023-06-09 14:04:09 +02:00
2020-12-01 02:27:42 +01:00
```
sudo mkdir -p /mnt/data
2021-01-05 10:47:42 +01:00
sudo mkdir -p /etc/samba/credentials
sudo cp dotfiles/credentials/data /etc/samba/credentials/ (complete the login information in this file)
2020-12-01 02:27:42 +01:00
sudo chmod 700 /etc/samba/credentials/
sudo chmod 600 /etc/samba/credentials/data
```
### Enable services
2023-06-09 14:04:09 +02:00
2020-12-01 02:27:42 +01:00
```
2020-12-06 00:15:33 +01:00
sudo systemctl enable slock@$USER.service
2020-12-01 02:27:42 +01:00
sudo systemctl enable --now mnt-data.automount
```
### GPU
2023-06-09 14:04:09 +02:00
On a second laptop I have a Quadro T2000 graphics card, if I want to be able to use it (for `hashcat` among others) I have to install the following tools and make the following configuration.
```
yay -S nvidia bumblebee
sudo gpasswd -a $USER bumblebee
sudo systemctl enable --now bumblebeed.service
```
It's a good idea to reboot, to make sure the modules load properly. To test if Bumblebee works with your Optimus system, you can execute the following thing.
```
optirun glxspheres64
```
If the window with animation shows up, Optimus with Bumblebee is working.
Some useful links to learn more:
2023-06-09 14:04:09 +02:00
- https://wiki.archlinux.org/index.php/NVIDIA,
- https://wiki.archlinux.org/index.php/AMDGPU,
- https://wiki.archlinux.org/index.php/Bumblebee.
## Miscellaneous
2020-12-01 02:27:42 +01:00
### Generate a WPA-PSK for `netctl` Wi-Fi config files
2023-06-09 14:04:09 +02:00
2020-12-01 02:27:42 +01:00
Copy the value of the `psk` key and paste it in the `netctl` config file and prefix it with `Key=\"`.
```
wpa_passphrase <ssid>
# reading passphrase from stdin
<password>
2020-12-01 02:27:42 +01:00
```
### Configure git
2023-06-09 14:04:09 +02:00
```
git config --global user.name <username>
git config --global user.email <e-mail>
2021-05-06 21:06:36 +02:00
git config --global gpg.program gpg
git config --global user.signingkey 0x... (signing subkey ID)
git config --global commit.gpgsign true
```
### Configure vim
2023-06-09 14:04:09 +02:00
```
curl -LOsSf https://raw.githubusercontent.com/glepnir/oceanic-material/master/colors/oceanic_material.vim
sudo mv oceanic_material.vim /usr/share/vim/vim90/colors/
echo "syntax on" | sudo tee -a /etc/vimrc
echo "colorscheme oceanic_material" | sudo tee -a /etc/vimrc
echo "filetype plugin indent on" | sudo tee -a /etc/vimrc
```
### Disable sleep mode when closing the lid
2023-06-09 14:04:09 +02:00
```
sudo sed -i "s/#HandleLidSwitch=suspend/HandleLidSwitch=ignore/" /etc/systemd
/logind.conf
```
2020-12-01 02:27:42 +01:00
## Specific installations
### Docker
2023-06-09 14:04:09 +02:00
Closing (and then reopening) your session is necessary.
2020-12-01 02:27:42 +01:00
```
yay -S docker
sudo gpasswd --add $USER docker
sudo systemctl start docker
sudo systemctl enable docker (optional)
```
#### Simple test
2023-06-09 14:04:09 +02:00
2020-12-01 02:27:42 +01:00
```
docker run -rm --name nginx -p 80:80 -d nginx
2020-12-01 02:27:42 +01:00
```
#### Clean Docker (images, volumes and more that are not used)
2023-06-09 14:04:09 +02:00
2020-12-01 02:27:42 +01:00
```
docker system prune --all --volumes
```
### Tinygo
2023-06-09 14:04:09 +02:00
2020-12-01 02:27:42 +01:00
```
yay -S tinygo avrdude avr-gcc avr-libc
```
#### Commands
##### Upload led blinking to Arduino Nano
2023-06-09 14:04:09 +02:00
2020-12-01 02:27:42 +01:00
```
tinygo flash -target=arduino-nano -port=/dev/ttyUSB0 examples/blinky1
```
##### Upload source code to Arduino Nano
2023-06-09 14:04:09 +02:00
2020-12-01 02:27:42 +01:00
```
tinygo flash -target arduino-nano /path/to/code
```
### Arduino IDE and Arduino CLI
2023-06-09 14:04:09 +02:00
2020-12-01 02:27:42 +01:00
```
yay -S arduino arduino-cli
sudo usermod -aG uucp $USER or sudo usermod -aG tty $USER
sudo chmod a+rw /dev/ttyUSBX
```
### Jekyll
2023-06-09 14:04:09 +02:00
2020-12-01 02:27:42 +01:00
```
yay -S ruby
cp dotfiles/.gemrc ~/
gem install bundler jekyll rdoc
2020-12-01 02:27:42 +01:00
```
### Rust
2023-06-09 14:04:09 +02:00
Replace `{stable, nighlty}` by the toolchain you want to install.
2020-12-01 02:27:42 +01:00
```
yay -S rustup
rustup default {stable, nightly}
2020-12-01 02:27:42 +01:00
```
#### Update toolchain
2023-06-09 14:04:09 +02:00
2020-12-01 02:27:42 +01:00
```
rustup update
```
### IntelliJ IDEA
2023-06-09 14:04:09 +02:00
2020-12-01 02:27:42 +01:00
```
2021-01-20 14:37:32 +01:00
yay -S intellij-idea-ultimate-edition-jre intellij-idea-ultimate-edition
2020-12-01 02:27:42 +01:00
```
#### Use fish shell inside IntelliJ IDEA
2023-06-09 14:04:09 +02:00
2020-12-01 02:27:42 +01:00
```
sudo ln -s ~/.config/fish/fish_variables /opt/intellij-idea-ultimate-edition/plugins/terminal/fish/fish_variables
```
### Laravel
#### Install Composer
2023-06-09 14:04:09 +02:00
2020-12-01 02:27:42 +01:00
```
yay -S composer
```
#### Install Laravel Installer
2023-06-09 14:04:09 +02:00
2020-12-01 02:27:42 +01:00
```
composer global require laravel/installer
```
#### Add Laravel Installer's path to fish's path
2023-06-09 14:04:09 +02:00
2020-12-01 02:27:42 +01:00
```
set -U fish_user_paths ~/.config/composer/vendor/laravel/installer/bin $fish_user_paths
```
### Fish
#### Remove a path into fish's path
##### List current path(s)
2023-06-09 14:04:09 +02:00
2020-12-01 02:27:42 +01:00
```
echo $fish_user_paths | tr " " "\n" | nl
1 ~/.config/composer/vendor/laravel/installer/bin
```
##### Delete the useless one (replace 1 by the desired index)
2023-06-09 14:04:09 +02:00
2020-12-01 02:27:42 +01:00
```
set --erase --universal fish_user_paths[1]
```
### Alacritty
#### Import Catppuccin themes
Discover more [here](https://github.com/catppuccin/alacritty).
```
curl -LO --output-dir ~/.config/alacritty https://github.com/catppuccin/alacritty/raw/main/catppuccin-mocha.toml
```