Blog
AWS

[awscli] aws-cli / aws-shell installation and configure aws credential

AWS CLI Installation About how to install pip3, you can refer to Python3 Installation. It is very simple to install awscli by pip3 – https://docs.aws.amazon.com/cli/latest/userguide/awscli-install-linux.html $ sudo pip3 install awscli The directory '/home/legochen/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check …

Read More
Programming

[Python3] installation – tarball

python packages: https://www.python.org/ftp/python/ I tried install Python-3.6.4  tarball on RHEL6 and RHEL7, looks no problem. Install pre-required packages $ sudo yum install openssl openssl-devel -y Install python3 by tarball $ wget https://www.python.org/ftp/python/3.6.4/Python-3.6.4.tar.xz $ tar -xJf Python-3.6.4.tar.xz $ cd Python-3.6.4 ############## # enable ssl module ############## $ vi Modules/Setup  <= un-comment the following lines # …

Read More
Linux Command & Tools

[tmux] installation – tarball and configuration

Previously, I was a screen user, it helped me to open multiple sessions and windows to manage lots of Linux servers. But, its window split feature is not pretty friendly, so, that’s why I started using tmux. Info tmux gitrepo – https://github.com/tmux/tmux tmux packages – https://github.com/tmux/tmux/releases ( you may download favorite version here …

Read More
Linux Command & Tools

OpenSSl Useful Commands

Check SSL Certificate dates # check site $ echo | openssl s_client -servername localhost -connect localhost:443 2>/dev/null | openssl x509 -noout -dates # check file $  sudo openssl x509 -dates -noout -in ./server.crt $  sudo openssl x509 -dates -noout -in ./server.pem Check SSL Certificate expired # result 0 : not expired # …

Read More
Linux Command & Tools

[Linux Bash Shell] custom bind keys

Shell short keys : https://www.gnu.org/software/bash/manual/html_node/Bindable-Readline-Commands.html#Bindable-Readline-Commands https://ss64.com/bash/syntax-keyboard.html We can use bind command to set the short keys in Bash environment. dump short keys : $ bind -p set short keys from file $ bind -f {key map file} set short key directly $ bind '"\C-p": shell-backward-kill-word' How to know the key code …

Read More
Programming

[Python] Print Formatting

>>> name = ‘Lego Chen’ >>> job = ‘engineer’ >>> print ‘%s is an %s’ %(name, job) Lego Chen is an engineer >>> print ‘%10s is an %20s’ %(name, job) Lego Chen is an engineer >>> print ‘The flotting number is: %10.3f’ %(1000.33356) The flotting number is: 1000.334 >>> print …

Read More
jupyter

[Python] Jupyter Server Setup

Purpose: I’d like to setup a jupyter sever that only can be edited by me and I also can share the jupyter notebooks to anyone. There are two URLs, one for admin (me) and another for share to anyone. Admin: https://jupyter-admin.chenlego.me Share(guest): https://jupyter.chenlego.me But, current jupyter server doesn’t support permission management for …

Read More
Server stuff

[SSL] Let’s encrypt How to

https://letsencrypt.org/ I only record command steps. Install pre-required packages $ sudo yum install gcc libffi-devel python-devel openssl-devel git Get letsencrypt-auto script from GitHub repo letsencrypt git link $ sudo git clone https://github.com/letsencrypt/letsencrypt /usr/share/letsencrypt Cloning into 'letsencrypt'… remote: Counting objects: 48173, done. remote: Compressing objects: 100% (14/14), done. remote: Total 48173 (delta …

Read More
postfix

[Postfix] pipe email to your script via transport table

Postfix Concept Components : Programs/Components sendmail: this command is compatible with sendmail of Sendmail , it is used to deliver e-mail from local. postdrop: this command is designed to run with set-group ID privileges, so that it can write to the maildrop queue directory and so that it can connect …

Read More
Programming

[Python][Basic] Basic Types

Types Numbers http://nbviewer.jupyter.org/github/jmportilla/Complete-Python-Bootcamp/blob/master/Numbers.ipynb cast int(1.5) => 1 float(1) => 1.0 Difference Python2 vs Python3 In Python 2, the / symbol performs what is known as “classic” division, this means that the decimal points are truncated (cut off). 3/2 => 1 In Python 3 however, a single / performs “true” division. …

Read More