Skip to content

Instantly share code, notes, and snippets.

View theanht1's full-sized avatar
👀

Anh Mai theanht1

👀
  • Hanoi, Vietnam
View GitHub Profile
@theanht1
theanht1 / vpn.sh
Last active November 18, 2021 10:57
Openconnect script as a cmd client to connect to Anyconnect VPN
#!/bin/sh
VPN_URL=
VPN_GROUP=
VPN_USER=
VPN_PASSWORD=
VPN_CERT_FILE=
CERT_PASSPHRASE=

Keybase proof

I hereby claim:

  • I am theanht1 on github.
  • I am theanht1 (https://keybase.io/theanht1) on keybase.
  • I have a public key ASD3gVE7FraTNEtmpLSFBE10yqBVputOL_aouxh5DS0NJQo

To claim this, I am signing this object:

@theanht1
theanht1 / nginx_config.md
Created July 1, 2020 04:49
Phoenix app deploy nginx config
        location / {
                proxy_pass http://127.0.0.1:7373;

                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection $http_connection;

@theanht1
theanht1 / gcp-shutdown.sh
Last active April 20, 2020 08:36 — forked from abraaojs/gcp-shutdown.sh
gcp-shutdown.sh
#!/bin/bash
# Created by abraaojs, updated by theanht1
# Add to instance metadata with `gcloud compute instances add-metadata \
# instance-name --metadata-from-file startup-script=gcp-shutdown.sh` and reboot
# NOTE: requires `bc`, eg, sudo apt-get install bc
# Modified from https://stackoverflow.com/questions/30556920/how-can-i-automatically-kill-idle-gce-instances-based-on-cpu-usage
threshold=0.1
count=0
@theanht1
theanht1 / conda_setup.md
Last active March 12, 2020 04:57
Anaconda Installation

Setup

MacOS

  • Download and install here

Cheatsheet

  • Create new environment: conda create --name python3.7 python=3.7
  • Activate an enviroment: conda activate python3.7
  • Deactivate current environment: conda deactivate
@theanht1
theanht1 / phoenix_deploy.md
Created February 1, 2019 07:45
Phoenix production deployment

Phoenix application deployment

Normal remote deploy:

Folow this link

NOTE: Configure for Endpoint should be changed like this:

config :foo, Foo.Endpoint,
  check_origin: ["//mysite.com"],
 http: [ip: {0, 0, 0, 0}, port: 4000],
@theanht1
theanht1 / vim_setup.md
Last active August 9, 2018 08:19
Vim Setup

Plug in

  • Pathogen
  • Nerdtree
  • Lightline
  • Better Whitespace: trim redundant spaces
  • YouCompleteMe: auto-completion
  • fzf: fuzzy search
  • vim-devicons: File icons

Config

  • Fix zhistory corrupt
mv .zhistory .zhistory_bad
strings .zhistory_bad > .zhistory
fc -R .zhistory