Skip to content

Instantly share code, notes, and snippets.

View cuongnv23's full-sized avatar
🐧
MadTux

cuongnv23

🐧
MadTux
View GitHub Profile
@cuongnv23
cuongnv23 / Dockerfile
Created June 23, 2018 15:22 — forked from brendan-rius/Dockerfile
DeamonSet for setting inotify config in each nodein k8s
FROM alpine
COPY configure-node.sh configure-node.sh
CMD ["/bin/sh", "configure-node.sh"]
@cuongnv23
cuongnv23 / telegram_chat_id.md
Last active April 24, 2018 02:30
How to get chat_id for Telegram bot

Keybase proof

I hereby claim:

  • I am cuongnv23 on github.
  • I am cuongnv23 (https://keybase.io/cuongnv23) on keybase.
  • I have a public key whose fingerprint is F5AD 9075 A160 BAE3 A5B0 3671 3BF9 8672 2353 296D

To claim this, I am signing this object:

set nocompatible
" git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
"call vundle#begin('~/some/path/here')
Plugin 'VundleVim/Vundle.vim'
" python mode
Plugin 'klen/python-mode'
"" PowerLine
Plugin 'powerline/powerline', {'rtp': 'powerline/bindings/vim/'}
<html>
<head>
<title>PHP Test</title>
</head>
<body>
<?php echo '<p>Hello World</p>'; ?>
</body>
</html>

How to run

This app is highly recommended to run in a virtualenv.

  • Install requirements:
$ pip install -r requirements.txt
  • Run the app, this app listens on port 5000 by default, ensure port available
# vim:ft=ansible
- hosts: localhost
remote_user: admin
become: True
become_user: root
vars:
nginx_root_dir: "/var/www/html"
tasks:
- name: Install nginx
@cuongnv23
cuongnv23 / speed
Created January 5, 2017 03:39
speed script for tmux
#!/bin/bash
iface=$1
RXB=$(</sys/class/net/"$iface"/statistics/rx_bytes)
TXB=$(</sys/class/net/"$iface"/statistics/tx_bytes)
sleep 1
RXBN=$(</sys/class/net/"$iface"/statistics/rx_bytes)
TXBN=$(</sys/class/net/"$iface"/statistics/tx_bytes)
RXDIF=$(echo $((RXBN - RXB)) )
TXDIF=$(echo $((TXBN - TXB)) )
@cuongnv23
cuongnv23 / letsencrypt_2016.md
Created September 25, 2016 00:25 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

There are two modes when you don't want Certbot to edit your configuration:

  • Standalone: replaces the webserver to respond to ACME challenges
  • Webroot: needs your webserver to serve challenges from a known folder.

Webroot is better because it doesn't need to replace Nginx (to bind to port 80) to renew certificates.

In the following, we're setting up mydomain.com to be served from /var/www/mydomain, and challenges will be served from /var/www/letsencrypt.

@cuongnv23
cuongnv23 / bobp-python.md
Created July 29, 2016 00:22 — forked from sloria/bobp-python.md
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens