lcl A record – points to ip 113.xxx.xx.12x #public ip of my mail server, of course lcl MX record – mail handled by lcl.infotechviet.com #the above A record mail CNAME record – is an alias of lcl.infotechviet.com #not necessary, this is just for my web client/admin access: ie: https://mail.infotechviet.com
Reference to: docs.ansible.com
sudo apt-get update
sudo apt-get install software-properties-common
sudo apt-add-repository --yes --update ppa:ansible/ansible
sudo apt-get install ansible
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" edit file:~ vi ~/.vimrc | |
" base | |
set nocompatible " vim, not vi | |
syntax on " syntax highlighting | |
filetype plugin indent on " try to recognise filetype and load plugins and indent files | |
" interface | |
set background=dark " tell vim what the background color looks like | |
set colorcolumn=120 " show a column at 100 chars | |
set cursorline " highlight current line |
My reference:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Author: Nghia Le <[email protected]> | |
# Description: | |
# - To make user confirm the privilege which they are using to run a bash script | |
# by asking user if they're sure and wanted to run this bash script as current log-in user. | |
read -n 1 -p "Do you want to run this bash script as $(whoami)? Yes/[No]: " YES_NO | |
echo -e "\n" | |
if [ -z ${YES_NO} ] || [ ${YES_NO} = "No" ] || [ ${YES_NO} = "no" ] || [ ${YES_NO} = "N" ] || [ ${YES_NO} = "n" ]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Author: Nghia Le <[email protected]> | |
# Description: | |
# - To ask user if they're sure and wanted to run this bash script as current log-in user | |
echo -e "\n" | |
read -n 1 -p "Do you want to run this bash script as $(whoami)? Yes/[No]: " YES_NO | |
echo -e "\n" | |
if [ -z ${YES_NO} ] || [ ${YES_NO} = "No" ] || [ ${YES_NO} = "no" ] || [ ${YES_NO} = "N" ] || [ ${YES_NO} = "n" ]; then | |
echo -e "\nYou select No, then it is going to exit now... " |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
# ----------------------------------------------------------------------------------------- | |
# Purpose: To manage system users: | |
# - create/upadate a user who is allowed accessing via ssh connection | |
# - add public ssh-key of user into its authorized_keys | |
# - allow user to use sudo by putting a config into /etc/sudoers.d/ | |
# - remove authorized_keys of inactive users | |
# - remove inactive users | |
# - remove sudo permission by removing its config file in /etc/sudoers.d/ if any | |
# Maintanance: Nghia Le [at] INFOTECHVIET |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Author: Nghia Le <[email protected]> | |
# Description: | |
# - Yes/[No] Confirm to exit bash script | |
# | |
import os | |
def _wrap_with(code): | |
def inner(text, bold=True): |
OlderNewer