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 / README.md
Last active April 30, 2023 11:15
How to fix the `-bash: /usr/bin/scp: No such file or directory` error when trying to use `scp`

How to fix the -bash: /usr/bin/scp: No such file or directory error when trying to use [scp][1]

Simply install [openssh][2], like so:

# on Arch:
sudo pacman -S openssh

and try using [scp][1] again!

@ErykDarnowski
ErykDarnowski / bat_report.bat
Last active April 30, 2023 10:53
How to automatically generate and open a battery report file on Windows
@echo off
:: Vars:
SET filename=battery-report.html
:: Generate the battery report file (in script's path):
powercfg /batteryreport > nul
:: Open the file (in the default browser):
@ErykDarnowski
ErykDarnowski / README.md
Last active April 30, 2023 11:16
How to run `diff` on outputs of two commands

How to run diff on outputs of two commands

diff <(<first_command>) <(<second_command>)
@ErykDarnowski
ErykDarnowski / README.md
Last active August 13, 2023 20:34
How to copy both hidden and visible files from the current folder using `scp`

How to copy both hidden and visible files from the current folder using scp

# Local -> Remote:
scp -r <local_path> <host>@<ip>:<remote_path>

# Remote -> Local:
scp -r <host>@<ip>:<remote_path> <local_path>
@ErykDarnowski
ErykDarnowski / README.md
Last active April 30, 2023 11:16
How to fix the `bash: unmount: command not found` error

How to fix the bash: unmount: command not found error

It's a sneaky one (a typo), you need to use: umount instead!

@ErykDarnowski
ErykDarnowski / README.md
Last active April 11, 2024 01:03
Print multi-line output one the same line

Print multi-line output one the same line

output

Instructions

NEW

Soo, after finding out about xargs I got this solution instead 😅:

@ErykDarnowski
ErykDarnowski / README.md
Last active April 30, 2023 11:38
How to install `tesseract` OCR for any langauge on Linux

How to install tesseract OCR for any langauge on Linux

Simply replace <lang> with a valid language code!

apt (Ubuntu / Debian / Mint)
sudo apt update -y
sudo apt upgrade -y
@ErykDarnowski
ErykDarnowski / fix.sh
Last active May 1, 2023 14:03
How to fix `/bin/bash^M: bad interpreter: No such file or directory` error (not being able to execute a `.sh` file because of Window's line endings)
sed -i -e 's/\r$//' <name_of_file>
@ErykDarnowski
ErykDarnowski / README.md
Last active May 1, 2023 13:36
How to setup & use `mitmproxy` on Linux + Firefox / iOS

How to setup & use [mitmproxy][1] on Linux + Firefox / iOS

  1. Install it

    apt (Ubuntu / Debian / Mint)
    sudo apt update -y
    sudo apt upgrade -y
@ErykDarnowski
ErykDarnowski / README.md
Created May 1, 2023 13:59
How to install `sftp` on Linux

How to install sftp on Linux

The package is simply automatically installed with openssh, so it can't be installed alone! 😅

apt (Ubuntu / Debian / Mint)
sudo apt update -y
sudo apt upgrade -y