Skip to content

Instantly share code, notes, and snippets.

View pnlinh07's full-sized avatar

Ngoc Linh Pham pnlinh07

View GitHub Profile
@pnlinh07
pnlinh07 / README.md
Created January 4, 2022 01:47 — forked from paolocarrasco/README.md
How to understand the `gpg failed to sign the data` problem in git

Problem

You have installed GPG, then tried to commit and suddenly you see this error message after it:

error: gpg failed to sign the data
fatal: failed to write commit object

Debug

@pnlinh07
pnlinh07 / .env
Created December 6, 2021 08:35 — forked from 24HOURSMEDIA/.env
Get contents through proxy using curl or guzzle - tested wit bestproxyandvpn.com
PROXY_USER=...
PROXY_PASS=....
PROXY_IP=185.XXX.XXX.XXX
PROXY_PORT=37257
@pnlinh07
pnlinh07 / stash_dropped.md
Created December 3, 2021 03:04 — forked from joseluisq/stash_dropped.md
How to recover a dropped stash in Git?

How to recover a dropped stash in Git?

1. Find the stash commits

git log --graph --oneline --decorate ( git fsck --no-reflog | awk '/dangling commit/ {print $3}' )

This will show you all the commits at the tips of your commit graph which are no longer referenced from any branch or tag – every lost commit, including every stash commit you’ve ever created, will be somewhere in that graph.

@pnlinh07
pnlinh07 / sqs.js
Created December 2, 2021 08:00 — forked from anhdiepmmk/sqs.js
an example proof how we can do exponetial backoff retries with sqs
const _ = require("lodash");
const moment = require("moment");
// Load the AWS SDK for Node.js
const AWS = require("aws-sdk");
// Set the region to us-west-2
AWS.config.update({ region: "us-west-2" });
// Create the SQS service object
const sqs = new AWS.SQS({ apiVersion: "2012-11-05" });
@pnlinh07
pnlinh07 / dnsmasq_setup_osx.md
Created September 24, 2021 04:22 — forked from eloypnd/dnsmasq_setup_osx.md
wildcard DNS record on OS X in localhost development with dnsmasq

wildcard DNS in localhost development

$ brew install dnsmasq
   ...
$ cp /usr/local/opt/dnsmasq/dnsmasq.conf.example /usr/local/etc/dnsmasq.conf
  • edit /usr/local/etc/dnsmasq.conf
address=/local/127.0.0.1
@pnlinh07
pnlinh07 / regex malaysia mobile number
Created September 23, 2021 09:09 — forked from FahmiRaazali/regex malaysia mobile number
[Regex Malaysia Mobile Phone Number] #regex
/^(\+?6?01)[0|1|2|3|4|6|7|8|9]\-*[0-9]{7,8}$/
@pnlinh07
pnlinh07 / iterm2-solarized.md
Created September 9, 2021 02:26 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@pnlinh07
pnlinh07 / fish_install.md
Created August 20, 2021 11:21 — forked from gagarine/fish_install.md
Install fish shell on macOS Mojave with brew

Installing Fish shell on MacOS

Fish is a smart and user-friendly command line (like bash or zsh). This is how you can nstall it on MacOS and make your defaul shell.

Note that you need the https://brew.sh/ package manager.

You can also download the fish app from their website. I do recomand using brew because update are easier.

Install Fish

@pnlinh07
pnlinh07 / iterm2-oh-my-fish.md
Created August 20, 2021 10:34 — forked from normanlolx/iterm2-oh-my-fish.md
iTerm2 Solarized Dark theme + Fish shell + oh-my-fish /// macOS High Sierra

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.