Skip to content

Instantly share code, notes, and snippets.

View Beyarz's full-sized avatar
💎
Searching for Ruby gems

Beyar Beyarz

💎
Searching for Ruby gems
  • Sweden
  • 16:22 (UTC +02:00)
View GitHub Profile
@Beyarz
Beyarz / grep.md
Last active October 13, 2019 15:39
Notes

Grep notes

Find in current dir with recurs

grep "FIND" . -r

Find & replace in current dir (macOS)

grep -rl "FIND" ./ | xargs sed -i "" 's/FIND/REPLACE/g'

@Beyarz
Beyarz / rsync.md
Last active November 18, 2019 14:50
rsync notes

rsync

Config file

vi /etc/rsyncd.conf

Example config

pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock
# Video ID Video Title Plays Likes Download URL
1 ID NAME 0 0 https://player.vimeo.com/play/abc&download=1
2 ID NAME 0 0 https://player.vimeo.com/play/efg&download=1
3 ID NAME 0 0 https://player.vimeo.com/play/hij&download=1
@Beyarz
Beyarz / du.md
Last active December 9, 2019 21:03
Count every file size in a directory
Example
du -ach -I .git -I .dub
@Beyarz
Beyarz / gpg-guide.md
Last active December 11, 2019 23:37
Step-by-step guide on how to sign your commits.

Step-by-step guide

I expect you to already have gpg installed.

Generate key if you haven't

gpg --gen-key

Use an existing key

gpg --list-keys

Make signing automatic

@Beyarz
Beyarz / notes.md
Last active December 27, 2019 19:04
Windows subsystem lost password

cat /etc/passwd

open regedit and navigate to HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss

set the DefaultUid to 0

passwd USERNAME

You should now be able to set your new password

@Beyarz
Beyarz / log.md
Last active December 27, 2019 20:13
rails on windows

Get the windows subsystem (ubuntu)

sudo apt update && sudo apt dist-upgrade && sudo apt-get autoremove && sudo apt-get clean

sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev software-properties-common libffi-dev libreadline-dev zlib1g-dev

(Updated version can be found here https://rvm.io/)
gpg2 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
curl -sSL https://get.rvm.io | bash -s stable --rails
source /etc/profile.d/rvm.sh

@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 / 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