Skip to content

Instantly share code, notes, and snippets.

@Beyarz
Beyarz / sed.sh
Created January 12, 2020 01:23
sed search and replace
sed -i '' -e 's/index.rb/hello.rb/g' now.json
@Beyarz
Beyarz / vi.md
Last active August 9, 2021 21:05
vi notes

Shortcuts

i - write
o - write newline
D - remove end of line
dd - remove current line
/ - find next string
? - find previous string
yy - copy (yank)
p - paste

@Beyarz
Beyarz / git remote.md
Last active October 15, 2024 10:54
git remote

Notes


Get remotes

git remote -v

Change git remote url

@Beyarz
Beyarz / git.log
Last active January 21, 2020 00:19
Go back to wanted version
git revert commit_hash
git switch -c wanted_version
git merge --strategy=ours master
git checkout master
git merge wanted_version
John
30
Mike
0.0786268
Tyson
0.114889
Gabriel
0.176072
Fiona
@Beyarz
Beyarz / npm.md
Created February 5, 2020 00:45
npm global package

Remove package globally

Let's say you install a package globally npm install -g jshint

and then you are unable to fully remove it globally. And you have tried npm uninstall -g jshint Then try this then: npm rm -g jshint

@Beyarz
Beyarz / nvm.md
Last active March 18, 2020 18:25
nvm is not compatible with the npm config “prefix” option.

Delete and reset the prefix

npm config delete prefix

Change the version number with the one indicated in the error message.

npm config set prefix $NVM_DIR/versions/node/v12.8.0

@Beyarz
Beyarz / ffmpeg.md
Last active May 5, 2023 21:52
ffmpeg

ffmpeg cheatsheet

Create gif out of series of images

-framerate = fps
picture%d.png looks for the series of images named picture1, picture2, picture3 ... pictureN
ffmpeg -f image2 -framerate 3 -i picture%d.png out.gif

Convert m3u8 to mp4

@Beyarz
Beyarz / diskpart.md
Created February 26, 2020 19:27
diskpart

RAW harddrive

If a harddrive cannot be accessed (RAW) while connected to your computer,
Windows will keep trying loading it up causing a timeout on each fail.
To prevent this, do the following:

C:\> diskpart
DISKPART> automount disable
DISKPART> automount scrub

@Beyarz
Beyarz / checksum.md
Created March 2, 2020 20:19
Examples

MD5: md5sum file1 fil2 file3 ... fileN
SHA-1: sha1sum file1 fil2 file3 ... fileN
SHA-256: sha256sum file1 fil2 file3 ... fileN\