Skip to content

Instantly share code, notes, and snippets.

@Beyarz
Beyarz / windows_subsystem_cmd.md
Last active March 28, 2024 13:01
Windows unix commands in CMD

Run unix stuff in cmd

Run: choco install msys

Symlink directory (some project assume its in C:\msys64): MKLINK /D "C:\msys64" "C:\tools\msys64"

Add the following path C:\msys64\usr\bin to your PATH environment variable

Now you shoule be able to run pacman -Q, choco list | sed s/msys2/test/g, help | grep disk

We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 1 column, instead of 7 in line 1.
2023;Jan;Feb;Mars;April;Maj;Juni;Juli;Aug;Sep;Okt;Nov;Dec
Södertörn;469,25;469,25;424,5;424,5;439;439;435;435;460;460;457,5;457,5
Stockholm;497,5;497,5;425;425;460;460;465;465;529;529;485;485
Nacka;-;-;520;520;449,75;449,75;455,25;455,25;462,5;462,5;470,25;470,25
Solna;535;535;437,5;437,5;491,75;491,75;-;-;503,5;503,5;470;470
Attunda;503;503;417,5;417,5;460,5;460,5;431,25;431,25;475;475;453,75;453,75
2022;Jan;Feb;Mars;April;Maj;Juni;Juli;Aug;Sep;Okt;Nov;Dec
Södertörn;452,5;452,5;423,75;423,75;436;436;487,75;487,75;441,25;441,25;454,75;454,75
Stockholm;498,5;498,5;482,5;482,5;470;470;453;453;477,5;477,5;475;475
Nacka;463,5;463,5;426;426;426,5;426,5;-;-;452,5;452,5;440;440
@Beyarz
Beyarz / optimize_video.md
Last active July 6, 2024 13:46
Automatically optimize every video in a folder via ffmpeg to save up storage. It's multithreaded and supports GPU acceleration, just put this script in the folder and execute it.

Optimize video

Run

  1. Download the script
  2. Put this file in the same folder as your videos
  3. Run: ruby optimize_video.rb, for help, use ruby optimize_video.rb --help

Watch log / debug

@Beyarz
Beyarz / itob.rb
Created August 19, 2023 19:37
Convert integer to binary
def itob(number)
decimals = []
while (number.positive?)
number, remainder = number.divmod(2)
decimals << remainder
end
bits = decimals.length.times.map { |i| 2**i }
validate_sum = 0
@Beyarz
Beyarz / README.md
Last active May 31, 2023 06:48 — forked from andrewmd5/README.md
Decipher this text - solution

Decipher this text

Can you crack the secret message hidden within this cipher? I've taken a phrase and encoded it into a string of words that look like "meatball". It's a bit tricky, but I believe in your skills!

Cipher Text:

mEaTbALLmEAtBALLmEATbALL, mEATBalLmEAtBALLmEATbAlL mEAtbalLmEATbaLlmEAtbAlL mEATbaLLmEATbAlLmEATballmEAtbAlLmEATbaLl mEATbaLLmEAtBAlLmEAtbalLmEATbaLlmEATbAll! mEaTbALLmEAtbalLmEAtBALlmEATbAll mEAtbalL mEAtBaLlmEAtBALLmEAtbaLl? mEaTbALLmEAtbAlL'mEATbaLlmEAtbAlL mEAtBallmEAtBalLmEATbaLlmEAtBalLmEAtBALlmEAtbALL: mEAtbalLmEAtBALlmEAtbAllmEATbaLlmEAtbAlLmEATbALL@mEAtbaLlmEAtbAlLmEATbAllmEATbALLmEAtBalLmEATBallmEATbAllmEAtBAllmEAtbalLmEAtbaLlmEATbaLL.mEAtbaLLmEAtBALLmEAtBAlL
@Beyarz
Beyarz / used-by-apple.md
Last active July 27, 2025 13:23
Products and services used by Apple Inc, since Sep 12, 2019
@Beyarz
Beyarz / note.txt
Created December 30, 2022 23:37
Windows checksum
certutil -hashfile something.zip SHA256
@Beyarz
Beyarz / .gemrc
Created December 23, 2022 23:34
Get faster gem installs ~/.gemrc
install: --no-rdoc --no-ri
@Beyarz
Beyarz / ??.js
Last active May 24, 2023 15:12
Javascript tips, tricks & shorthands
// Javascript nullish coalescing operator
// Is set to 0
let x = 0 ?? "hello"
// Is set to goodbye
let y = undefined ?? "goodbye"
// Is set to hello
let z = null ?? "hello"
@Beyarz
Beyarz / dig.md
Created August 4, 2022 13:53
dig dns lookup

Dig dns query

Query using local config

dig feber.se

Query using chosen resolver

dig @1.1.1.1 feber.se