Skip to content

Instantly share code, notes, and snippets.

View duylam's full-sized avatar

Duy Lam duylam

View GitHub Profile
@duylam
duylam / vim-cheatsheet.md
Last active June 27, 2021 03:12
Vim cheatsheet

Copy text in vim and paste at other GUI app (like Terminal, Firefox, etc.)

To copy text in vim into system clipboard to paste at other app (like Terminal), built-in vi in MacOS isn't compiled with GUI all tricks on Internet doesn't work. The possible option:

  • Install vim with brew: brew install vim, launch with vim (from brew) instead of vi (from MacOS)
  • Switch to Visual mode (type v)
  • Select the block
  • Use :+y to copy (read more)

Remove plugin in Plug

@duylam
duylam / download-old-chrome-browser.md
Last active October 26, 2019 08:26
Download old Chrome browser

To download old version of Chrome browser:

  1. Find the desire version by looking up on date at https://chromereleases.googleblog.com/2019/04, note down the version like 74.0.3729.131
  2. Visit https://omahaproxy.appspot.com/, paste the version to Version textbox in panel Version Information. Copy the value of field Branch Base Position, like 638880
  3. Visit https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html, go to folder for your OS, and enter value of Branch Base Position on the Filter textbox
  4. Download .zip file, done
@duylam
duylam / patch-meltdown-n-spectre.md
Last active January 27, 2018 10:02
Detail steps to patch meltdown and spectre issues on EC2 Ubuntu server

1. Verify the issue occurs on server, see detail

git clone https://github.com/speed47/spectre-meltdown-checker.git ~/tmp/spectre-meltdown-checker
cd ~/tmp/spectre-meltdown-checker/ && sudo ./spectre-meltdown-checker.sh

Make sure to save the result to file for verifying after patching

2. 02 ways of patching

@duylam
duylam / kms-techcon2016.md
Last active September 5, 2016 14:52
Dead simple slide for KMS TechCon 2016 about being productive on Google Apps

Google Apps logo

Gmail

  • Filter messages. TLTR:
    • In Filter window, by default, properties (Subject, From, To, etc.) are combined with AND operator
    • In a property having multiple search values:
      • To indicate and operator, use a space between 02 values. For instance: Subject:KMS ICT gives emails in which its subject contains both KMS and ICT e.g. The ICT Friendship 2016 - KMS join ..., The ICT Friendship 2016 - KMS vs Axon Active ...
      • To indicate or operator, use OR betweens 02 values. For instance: Subject:Birthday OR Cellphone gives emails in which its subject contains either Birthday and Cellphone
  • To specify a phrase for a search
@duylam
duylam / snippets.md
Last active August 6, 2016 15:28
Snippet for everything

Gmail: search old messages (3+ months)

{label:notification-trello label:notification-github label:notification-bank label:news} older_than:3m

To test download bandwidth

Run curl -L -o ~/tmp/del.zip https://github.com/WebKit/webkit/archive/master.zip and see Activity Monitor app

To setup new web app