Skip to content

Instantly share code, notes, and snippets.

View ErykDarnowski's full-sized avatar
🔧
Tinkering

Eryk Darnowski ErykDarnowski

🔧
Tinkering
View GitHub Profile
@ErykDarnowski
ErykDarnowski / check.sh
Last active April 30, 2023 10:50
How to check if Laravel's `sail up` command is finished (if all the containers are healthy) before doing other actions (like migrating a DB and so on) in bash. Concept by @rosiakpiotr execution by me :)
#!/bin/bash
check_sail_containers_status() {
# A bit of delay to not run the function too quickly:
sleep 2
# Getting current container state:
local STATUS=$(sudo ./vendor/bin/sail ps | grep starting)
# Checking if they're healthy:
@ErykDarnowski
ErykDarnowski / dnf.conf
Last active April 30, 2023 11:19
How to speed up `dnf` the default pkg manager used by Fedora Linux, simply append these lines to the `/etc/dnf/dnf.conf` config file. Remember to edit it with `sudo`!
max_parallel_downloads=10 # Increases amount of concurrent pkg downloads (you can also try tweaking this option)
fastestmirror=True # Picks the fastest mirror
defaultyes=True # Makes the defualt option in `[y/N]` menus 'Y' instead of 'N' (so you don't have to type 'y' every time)
@ErykDarnowski
ErykDarnowski / pkgName.ts
Last active April 30, 2023 11:19
How to get app's package name in Expo app (in React Native). This is a quick and dirty hack for getting the app's package name when testing stuff out and switching between the managed and bare (ejected) workflow. In my case this was heplful when linking the user to the app's notification settings page,
import { expo as appJson } from '../app.json';
// @ts-ignore
const packageName: string = appJson.android.package ?? 'host.exp.exponent';
// ^ Gets the apps package name, however if the `Expo Go` app is used it defaults to it's package name.
@ErykDarnowski
ErykDarnowski / mount.md
Last active April 30, 2023 11:12
How to (temporarily) mount drive installed in computer in a live Linux USB

How to (temporarily) mount drive installed in computer in a live Linux USB

Prepare by burning Linux on to a USB drive and booting in to it (on the computer that has the drive/s you want to access installed).


  1. Find the drive's path (something along the lines of /dev/nvme0n1p3): sudo fdisk -l
  2. Create a directory for mounting it: sudo mkdir -p /mnt/drive
  3. Mount it: sudo mount <drive_path> /mnt/drive
  4. Access it: cd /mnt/drive
@ErykDarnowski
ErykDarnowski / README.md
Last active December 9, 2022 01:15
A sane npkill command (shouldn't show anything related to Vim plugins, VScode extensions npm / npx caches and so on).
npx npkill -f -s size -E ".config, .cache, .local, .nvm, .npm, .vscode"
@ErykDarnowski
ErykDarnowski / README.md
Last active April 2, 2024 21:31
How to automatically mount network a Samba share on Arch Linux!

How to automatically mount network a Samba share on Arch Linux!

  1. Install the [cifs-utils][1] package: sudo pacman –S cifs-utils.
  2. Make a mount folder for the SMB share: sudo mkdir /mnt/<Path>.
  3. Create a backup of the [fstab][2] file (just in case): sudo cp /etc/fstab /etc/fstab_backup.
  4. Open the [fstab][2] file in your favorite editor: sudo vim /etc/fstab.
  5. Add the mount line: //<Server_address>/<Server_share_and_internal_path> /mnt/<Path> cifs username=<Server_user>,pass=<Server_password> 0 0.
  1. Save the file.
  2. Reload [fstab][2]: sudo mount -av.
@ErykDarnowski
ErykDarnowski / README.md
Last active July 31, 2023 02:37
How to automatically and easily install Docker on Linux

How to automatically and easily install Docker on Linux

  1. Make sure you have curl installed and run:
curl https://get.docker.com -s | sh
  1. (you may not have to perform this step) Get command for installing newuidmap and newgidmap binaries by running:
@ErykDarnowski
ErykDarnowski / README.md
Last active April 30, 2023 11:05
How to install Firefox Developer Edition on Linux Fedora

How to install Firefox Developer Edition on Linux Fedora

  1. Make sure the dnf-plugins-core package is installed.

  2. Enable the the4runner/firefox-dev Copr repository:

    sudo dnf copr enable the4runner/firefox-dev`
  3. Install Firefox Developer Edition:

@ErykDarnowski
ErykDarnowski / README.md
Last active April 30, 2023 11:04
How to install Docker and Docker Compose on Arch Linux
@ErykDarnowski
ErykDarnowski / README.md
Last active April 30, 2023 11:01
How to fix Vim / Neovim not copying to system clipboard

How to fix Vim / Neovim not copying to system clipboard

If you can't copy text from Vim / Neovim to your system's clipboard, for instance when using the "+y shortcut (I've encountered this issue when testing out Fedora + KDE + Wayland).

Try installing the wl-clipboard package, like so:

sudo dnf install wl-clipboard