Skip to content

Instantly share code, notes, and snippets.

View zoonderkins's full-sized avatar
🏠
Working 👍

Quack~ zoonderkins

🏠
Working 👍
View GitHub Profile
@zoonderkins
zoonderkins / git-refusing.md
Last active December 29, 2020 22:31 — forked from heiswayi/repo-reset.md
GitHub - Delete commits history with git commands

Git refusing to merge unrelated histories on rebase

Error: fatal: refusing to merge unrelated histories

Solution:

  • Rebase it git pull --rebase branchname

  • pull git pull origin branchname --allow-unrelated-histories

  • push git push origin master

@zoonderkins
zoonderkins / Linux-grep-text-in-file.md
Created February 6, 2019 02:30
Linux grep find text in file #linux

How to grab a keyword or text in linux and print it out?!

// First and Recommended
grep -rnw '/path/to/somewhere/' -e 'pattern'

-r or -R is recursive,
-n is line number, and
-w stands for match the whole word.
-l (lower-case L) can be added to just give the file name of matching files.
@zoonderkins
zoonderkins / gitignore-fix-directory-not-working.md
Created February 2, 2019 13:11
gitignore fix not working in a directory #git

Do the following to trigger the gitignore

Step 1: Commit all your pending changes in the repo which you want to fix and push that.

Step 2: Now you need to remove everything from the git index in order to refresh your git repository. This is safe. Use this command:

git rm -r --cached . Step 3: Now you need to add everything back into the repo, which can be done using this command:

git add .

@zoonderkins
zoonderkins / mac-flutter-path.md
Last active September 6, 2024 03:47
Mac-flutter-path #mac

Make flutter cmd run in zsh

// When you downloaded flutter sdk, unzip it to ~/flutter
// Add to ~/.bash_profile
nano .bash_profile
export PATH="$PATH:/Users/lol/development/flutter/bin"

// save 
soure ~/.bash_profile
@zoonderkins
zoonderkins / Debian9-google-gcp-bashrc.md
Last active January 28, 2019 02:14
Debian9-Google-GCP-basic-bashrc #linux

Basic bashrc

export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
# ~/.bashrc: executed by bash(1) for non-login shells.

# Note: PS1 and umask are already set in /etc/profile. You should not
# need this unless you want different defaults for root.
# PS1='${debian_chroot:+($debian_chroot)}\h:\w\$ '
# umask 022
@zoonderkins
zoonderkins / tor-private-bridge-debian.md
Last active January 26, 2019 04:42
Tor-private-bridge-on-Debian #linux #tor

Install TOR private bridge on Debian9

// Download this script 
wget https://raw.githubusercontent.com/Xaqron/tor-private-bridge/master/tor-bridge.sh
bash tor-bridge.sh

// NOTE-> untill gpg sign finish, STOP the process , CTRL + C 

nano /etc/apt/sources.list.d/tor.list
@zoonderkins
zoonderkins / speedtest-cli-debian.md
Created January 18, 2019 07:30
speed-test-cli-debian #linux

Installation

wget -O speedtest-cli https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py

chmod +x speedtest-cli

run it

python speedtest-cli
@zoonderkins
zoonderkins / linux-add-local-loopback-ip.md
Last active January 26, 2019 15:31
Linux add local loopback IP #linux

Cmd

cd /etc/network/if-pre-up.d/
nano ip

#!/bin/sh
 ip addr add 10.1.1.1 dev lo
 exit 0
@zoonderkins
zoonderkins / change-debian-ubuntu-keyboard-mapping-to-us.md
Created January 14, 2019 18:22
Debian keyboard mapping change to US #linux

Change the keyboard mapping cmd

dpkg-reconfigure keyboard-configuration

or

nano /etc/default/keyboard