Wednesday, October 28, 2020

GET Let's Encrypts Certificates (dns)

$sudo apt install certbot

$sudo certbot certonly \

  --server https://acme-v02.api.letsencrypt.org/directory \

  --manual --preferred-challenges dns \

  -d your.domain.com

## Add records TXT _acme-challenge.your.domain.com

$nslookup -type=TXT _acme-challenge.your.domain.com

#Certs Path

/etc/letsencrypt/live/

Tuesday, September 15, 2020

Show GIT Branch on Bash

ubuntu edit .bashrc
alpine linux .profile

show_git_branch() {
     git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}

export PS1="\u@\h \[\e[32m\]\w \[\e[91m\]\$(show_git_branch)\[\e[00m\] $ "

Tuesday, September 1, 2020

Unable to 'apt update' my Ubuntu 19.04

sudo sed -i -re 's/([a-z]{2}\.)?th.archive.ubuntu.com|archive.ubuntu.com|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list

Friday, August 28, 2020

CPU and Memory OID Alcatel 6400

Memory:

name: healthDeviceMemoryLatest

oid: .1.3.6.1.4.1.6486.800.1.2.1.16.1.1.1.9.0


CPU:

name: healthDeviceCpuLatest

oid: .1.3.6.1.4.1.6486.800.1.2.1.16.1.1.1.13.0

Thursday, August 27, 2020

Pretty print json Format in BASH terminal

Pretty print json Format in BASH terminal

ex:

curl -X GET http://localhost:8001 | python3 -m json.tool


create alias in .bashrc :

alias pprint='python3 -m json.tool'


ex:

curl -X GET http://localhost:8001 | pprint


Friday, August 7, 2020

How to change the Docker default subnet IP address

create file : /etc/docker/daemon.json

{

  "bip": "11.22.33.1/24"

}


{

    "default-address-pools": [

            {

                "base": "10.10.0.0/16",

                "size": 24

            }

        ]

}

restart docker services



Custom PS1 Linux Terminal

ex:

export PS1="\[\033[36m\]\D{%Y-%m-%d-%I:%M%p}\[\033[00m\] \[\033[95m\]\u@$WSL_DISTRO_NAME\[\033[00m\]:\[\033[35m\]\w\[\033[00m\] $ "

export PS1="\[\033[33m\]\D{%Y-%m-%d-%I:%M%p}\[\033[00m\] \[\033[32m\]\u@$WSL_DISTRO_NAME\[\033[00m\]:\[\033[36m\]\w\[\033[00m\] $ "

ALCATEL 6900

write memory copy running certified reload from working no rollback-timeout