Skip to content

Instantly share code, notes, and snippets.

View ntamvl's full-sized avatar
🏠
Working from home

Tam Nguyen ntamvl

🏠
Working from home
View GitHub Profile
@ntamvl
ntamvl / Increasing-the-amount-of-inotify-watchers.md
Created August 16, 2017 03:10
Increasing the amount of inotify watchers

Increasing the amount of inotify watchers

If you are not interested in the technical details and only want to get Listen to work:

  • If you are running Debian, RedHat, or another similar Linux distribution, run the following in a terminal:
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
@ntamvl
ntamvl / list-of-chrome-driver-command-line-arguments.md
Created January 30, 2019 04:20
List of Chrome Driver command line arguments

List of Chrome Driver command line arguments

Here is the list of Chrome Driver command line Arguments.

If you are using chrome Driver for Selenium WebDriver or Protractor or …. then these are a handy useful list of command line arguments that can be used.

You may use this to look at the usuage: https://code.google.com/p/chromium/codesearch#chromium/src/chromeos/chromeos_switches.cc

Run chromedriver –help to see command line arguments for your version.

@ntamvl
ntamvl / getting_a_readable_text_in_iterm2_how_do_i_color.md
Last active April 20, 2024 18:43
iTerm2 - color 'ls' and other outputs for MacOS

iTerm2 - color 'ls' and other outputs for MacOS

That's right. For OS X and BSD's ls, the flag is -G. Many people customize the behavior of ls by replacing it with an alias that adds extra options. I have the following in my .bashrc, for example:

alias ls='LSCOLORS=gxfxcxdxbxexexabagacad /bin/ls -bFHGLOPW'

Besides enabling colors in general, this sets the LSCOLORS variable in order to change which ones ls uses.

@ntamvl
ntamvl / disk-speed-test-read-write-hdd-ssd-perfomance-linux.md
Created May 4, 2018 08:25
Disk Speed Test (Read/Write): HDD, SSD Performance in Linux

Disk Speed Test (Read/Write): HDD, SSD Performance in Linux

From this article you’ll learn how to measure an input/output performance of a file system on such devices as HDD, SSD, USB Flash Drive etc.

I’ll show how to test the read/write speed of a disk from the Linux command line using dd command.

I’ll also show how to install and use hdparm utility for measuring read speed of a disk on Linux Mint, Ubuntu, Debian, CentOS, RHEL.

Take the average result: To get the accurate read/write speed, you should repeat the below tests several times (usually 3-5) and take the average result.

@ntamvl
ntamvl / Use Sweetalert2 on Rails 7.md
Last active April 10, 2024 14:17
Use Sweetalert2 on Rails 7

Use Sweetalert2 on Rails 7

Install sweetalert2 package

yarn add sweetalert2

OR if you use importmap

./bin/importmap pin sweetalert2
@ntamvl
ntamvl / index.html
Last active February 21, 2024 11:19 — forked from davidwkeith/index.html
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>App Redirection</title>
</head>
<body>
<!-- iframe used for attempting to load a custom protocol -->
<iframe style="display:none" height="0" width="0" id="loader"></iframe>

All binary can be downloaded http://pan.baidu.com/s/1hqH2Pko

VERSION PLATFORM OFFSET ORIGINAL CRACKED
3083 Linux x64 0xcbe3 85 39
3083 Linux x86 0xc6f2 85 39
3083 Win x64 0xe21b3 85 3B
3083 Win x86 0x9eb1a 1a 2a
3083 OSX 0x69cf 85 39

All binary can be downloaded http://pan.baidu.com/s/1hqH2Pko

VERSION PLATFORM OFFSET ORIGINAL CRACKED
3083 Linux x64 0xcbe3 85 39
3083 Linux x86 0xc6f2 85 39
3083 Win x64 0xe21b3 85 3B
3083 Win x86 0x9eb1a 1a 2a
3083 OSX 0x69cf 85 39

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@ntamvl
ntamvl / Multiple GitHub Accounts & SSH Config
Created June 6, 2015 06:25
Multiple GitHub Accounts & SSH Config
I recently had to do this and had to sift through all these answers and their comments to eventually piece the information together, so I'll put it all here, in one post, for your convenience:
Step 1: ssh keys
Create any keypairs you'll need. In this example I've named me default/original 'id_rsa' (which is the default) and my new one 'id_rsa-work':
ssh-keygen -t rsa -C "stefano@work.com"
Step 2: ssh config
Set up multiple ssh profiles by creating/modifying ~/.ssh/config. Note the slightly differing 'Host' values: