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 August 18, 2023 03:05
Quickly and easily startup a VirtualBox / VMware VM without having to download and install it manually from an ISO file.

Quickly and easily startup a VirtualBox / VMware VM without having to download and install it manually from an ISO file.

OSBoxes

If you don’t want to install secondary OS alongside with your main OS but still want to use/try it, then you can use VirtualBox or VMware on your host operating system to run virtual machine.

VirtualBox tutorial

  1. Download an image you're interested in
  2. Unzip it
@ErykDarnowski
ErykDarnowski / opener.py
Created August 9, 2023 07:33
Open URLs from a text file
import time
import webbrowser
delay = 0.2
incognito_mode = True
input_filename = 'input.txt' # <- any URLs separated by `\n`
browser_path = 'C:/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe %s' + (' --incognito' if incognito_mode else '')
@ErykDarnowski
ErykDarnowski / README.md
Last active September 11, 2023 12:29
Find all `Dockerfile.node` files and do `diff` / `wdiff` between each file and `0http/.Dockerfile.node` file

Find all Dockerfile.node files and do diff / wdiff between each file and 0http/.Dockerfile.node file

#!/bin/bash

# clordiff
find ../ -name "*Dockerfile.node*" -exec colordiff ../0http/.Dockerfile.node {} \;

# wdiff
find ../ -name "*Dockerfile.node*" -exec sh -c 'wdiff ../0http/.Dockerfile.node "{}" | colordiff' \;
@ErykDarnowski
ErykDarnowski / README.md
Last active September 11, 2023 12:27
Find pattern in `config.yaml` files (recursively) and check when they were last changed according to system / to git

Find pattern in config.yaml files (recursively) and check when they were last changed according to system / to git

# git
grep -rl --include="config.yaml" "website:" | xargs -n1 git log -1 --pretty="format:%ci"

# system
grep -rl --include="config.yaml" "website:" | xargs stat -c "%y" {}
@ErykDarnowski
ErykDarnowski / README.md
Last active September 11, 2023 12:25
Find files (excluding `*.git*` folders) and only write their paths if they're **binary** files

Find files (excluding *.git* folders) and only write their paths if they're binary files

find . -type 'f' -not -path '*.git*' -exec file --mime {} \; | grep binary | cut -d: -f1
@ErykDarnowski
ErykDarnowski / README.md
Last active September 11, 2023 12:23
Find files (excluding `*.git*` folders) and only write their **unique** extensions in to `out.txt`

Find files (excluding *.git* folders) and only write their unique extensions in to out.txt

find . -type 'f' -not -path '*.git*' | grep -oP "[^.]*$" | sort -u >> out.txt
@ErykDarnowski
ErykDarnowski / README.md
Created June 30, 2023 02:43
Fix PGP singature errors on Arch Linux.

Fix PGP singature errors on Arch Linux.

# Refresh the keys:
sudo pacman-key --refresh-keys

# Update the system:
sudo pacman -Syyu
@ErykDarnowski
ErykDarnowski / README.md
Last active September 11, 2023 12:18
Fix missing KDE volume widget after messing with PulseAudio.

Fix missing KDE volume widget after messing with PulseAudio.

sudo dnf check-update
sudo dnf upgrade -y

sudo dnf install plasma-pa
@ErykDarnowski
ErykDarnowski / README.md
Created May 22, 2023 16:46
How to install Microsoft Edge on Fedora Linux

How to install Microsoft Edge on Fedora Linux

*This should also work on CentOS and Red Hat Enterprise Linux

# Update your pkgs:
sudo dnf check-update
sudo dnf upgrade -y

# Import Microsoft repo key:
@ErykDarnowski
ErykDarnowski / README.md
Last active May 19, 2023 06:13
Node get property from array of objects - benchmark

Node get property from array of objects - benchmark

image

Usage

  1. Download all files
git clone https://gist.github.com/ErykDarnowski/03a553ede773b801e2734779ac70cd03 'Node get property from array of objects - benchmark'