Skip to content
Snippets Groups Projects
Commit 6f8c3021 authored by Benoit MARECHAL's avatar Benoit MARECHAL :fish:
Browse files

Update README.md

parent 789b8846
No related branches found
No related tags found
No related merge requests found
...@@ -13,7 +13,7 @@ Tags: DevOps, Debug, tools, linux, ops, deploy, interface, testing ...@@ -13,7 +13,7 @@ Tags: DevOps, Debug, tools, linux, ops, deploy, interface, testing
[TOC] [TOC]
# TLDR; Install all this interfaces debug tools # TLDR; Install all this interfaces debug tools
``` ```shell
dnf install -y net-tools \ dnf install -y net-tools \
bind-utils \ bind-utils \
openldap-clients \ openldap-clients \
...@@ -52,14 +52,14 @@ telnet my.hostname.tld 443 # example ...@@ -52,14 +52,14 @@ telnet my.hostname.tld 443 # example
## (s)FTP parameters ## (s)FTP parameters
``` ```shell
FTP_USER=remote_username FTP_USER=remote_username
FTP_HOST=hostname FTP_HOST=hostname
``` ```
## sFTP Testing ## sFTP Testing
``` ```shell
sftp $FTP_USER@$FTP_HOST sftp $FTP_USER@$FTP_HOST
``` ```
...@@ -69,7 +69,7 @@ sftp $FTP_USER@$FTP_HOST ...@@ -69,7 +69,7 @@ sftp $FTP_USER@$FTP_HOST
## HTTP(s) Parameter ## HTTP(s) Parameter
``` ```shell
HTTP_PROTOCOL=http # default http; https if secured. HTTP_PROTOCOL=http # default http; https if secured.
HTTP_HOST=www.mydomain.com # ex: www.domain.tld HTTP_HOST=www.mydomain.com # ex: www.domain.tld
HTTP_PORT=80 # default 80 not secure; 443 HTTP_PORT=80 # default 80 not secure; 443
...@@ -79,7 +79,7 @@ HTTP_ROOT_URL=$HTTP_PROTOCOL://$HTTP_HOST:$HTTP_PORT ...@@ -79,7 +79,7 @@ HTTP_ROOT_URL=$HTTP_PROTOCOL://$HTTP_HOST:$HTTP_PORT
## HTTP Testing with Curl ## HTTP Testing with Curl
``` ```shell
# dnf install -y curl # yum install -y curl # apt install -y curl # dnf install -y curl # yum install -y curl # apt install -y curl
curl -v $HTTP_ROOT_URL curl -v $HTTP_ROOT_URL
...@@ -108,7 +108,7 @@ curl -kv https://httpbin.org/get # example ...@@ -108,7 +108,7 @@ curl -kv https://httpbin.org/get # example
DNS variables are : DNS variables are :
``` ```shell
DNS_DOMAIN=mydomain.com # ex: mydomain.com DNS_DOMAIN=mydomain.com # ex: mydomain.com
HOST=sub.mydomain.com # ex: mydomain.com or subdomain.mydomain.tld (=FQDN) HOST=sub.mydomain.com # ex: mydomain.com or subdomain.mydomain.tld (=FQDN)
...@@ -118,7 +118,7 @@ HOST=sub.mydomain.com # ex: mydomain.com or subdomain.mydomain.tld (=FQ ...@@ -118,7 +118,7 @@ HOST=sub.mydomain.com # ex: mydomain.com or subdomain.mydomain.tld (=FQ
Retrieve DNS serveur : Retrieve DNS serveur :
``` ```shell
dnf install -y bind-utils # yum install -y bind-utils dnf install -y bind-utils # yum install -y bind-utils
host -t ns $DNS_DOMAIN host -t ns $DNS_DOMAIN
...@@ -135,7 +135,7 @@ host -t ns domain.com # example ...@@ -135,7 +135,7 @@ host -t ns domain.com # example
To get ip address from an host or FQDN : To get ip address from an host or FQDN :
``` ```shell
# With Host command # With Host command
...@@ -165,7 +165,7 @@ dig sub.domain.com +short # example ...@@ -165,7 +165,7 @@ dig sub.domain.com +short # example
LDAP variables are : LDAP variables are :
``` ```shell
LDAP_PROTOCOL=ldap # or ldaps LDAP_PROTOCOL=ldap # or ldaps
LDAP_HOST= # ex: ldap.domain.tld LDAP_HOST= # ex: ldap.domain.tld
LDAP_PORT=389 # default : 389 (LDAP), 636 (LDAPS) LDAP_PORT=389 # default : 389 (LDAP), 636 (LDAPS)
...@@ -184,7 +184,7 @@ LDAP_ATTR=* # * for "For all attributs", ex: givenName, sn, ...@@ -184,7 +184,7 @@ LDAP_ATTR=* # * for "For all attributs", ex: givenName, sn,
``` ```
``` ```shell
Base: "dc=example,dc=com", Base: "dc=example,dc=com",
Host: "ldap.example.com", Host: "ldap.example.com",
...@@ -226,7 +226,7 @@ ldapsearch -x -h $LDAP_HOST \ ...@@ -226,7 +226,7 @@ ldapsearch -x -h $LDAP_HOST \
SMTP variables are : SMTP variables are :
``` ```shell
SMTP_HOST= # default SMTP_HOST= # default
SMTP_PORT= # default port 25 not secure, and 587 for encrypted (secure)serveur SMTP_PORT= # default port 25 not secure, and 587 for encrypted (secure)serveur
# SMTP_USERNAME= # optional # SMTP_USERNAME= # optional
...@@ -244,7 +244,7 @@ Test without SMTP Authentication : ...@@ -244,7 +244,7 @@ Test without SMTP Authentication :
> Troubleshooting : mail command sometimes use /tmp folder, if you don't have permission to write inside it, mail command could fail. > Troubleshooting : mail command sometimes use /tmp folder, if you don't have permission to write inside it, mail command could fail.
``` ```shell
dnf install -y mailx # yum install -y mailx # RHEL installation of mail command dnf install -y mailx # yum install -y mailx # RHEL installation of mail command
echo $SMTP_BODY | mail -S smtp=$SMTP_HOST -s $SMTP_SUBJECT $SMTP_RECIPIENT echo $SMTP_BODY | mail -S smtp=$SMTP_HOST -s $SMTP_SUBJECT $SMTP_RECIPIENT
...@@ -253,12 +253,12 @@ echo "body" | mail -S smtp=hostname -s "suject" "dest@domain.org" ...@@ -253,12 +253,12 @@ echo "body" | mail -S smtp=hostname -s "suject" "dest@domain.org"
``` ```
or or
``` ```shell
echo $SMTP_BODY | mail -S smtp=$SMTP_HOST -s $SMTP_SUBJECT $SMTP_RECIPIENT echo $SMTP_BODY | mail -S smtp=$SMTP_HOST -s $SMTP_SUBJECT $SMTP_RECIPIENT
``` ```
or or
``` ```shell
echo $SMTP_BODY | mail -S smtp=$SMTP_HOST -s $SMTP_SUBJECT -r $SMTP_FROM $SMTP_RECIPIENT echo $SMTP_BODY | mail -S smtp=$SMTP_HOST -s $SMTP_SUBJECT -r $SMTP_FROM $SMTP_RECIPIENT
``` ```
...@@ -266,7 +266,7 @@ echo $SMTP_BODY | mail -S smtp=$SMTP_HOST -s $SMTP_SUBJECT -r $SMTP_FROM $SMTP_R ...@@ -266,7 +266,7 @@ echo $SMTP_BODY | mail -S smtp=$SMTP_HOST -s $SMTP_SUBJECT -r $SMTP_FROM $SMTP_R
With authentication : With authentication :
``` ```shell
# Get base64 Login # Get base64 Login
perl -MMIME::Base64 -e 'print encode_base64("LOGIN_HERE");' perl -MMIME::Base64 -e 'print encode_base64("LOGIN_HERE");'
# => Z2NpcaxaaWx4ZZzzV2 # => Z2NpcaxaaWx4ZZzzV2
...@@ -298,20 +298,20 @@ $SMTP_BODY ...@@ -298,20 +298,20 @@ $SMTP_BODY
## Git Parameter ## Git Parameter
``` ```shell
GIT_URL=https://git.domain.com/repository # GIT_URL=https://git.domain.com/repository #
``` ```
## Git Testing ## Git Testing
``` ```shell
git clone $GIT_URL git clone $GIT_URL
``` ```
# Show Listened ports # Show Listened ports
``` ```shell
dnf install -y net-tools # yum install -y net-tools dnf install -y net-tools # yum install -y net-tools
netstat -planteu netstat -planteu
``` ```
...@@ -332,7 +332,7 @@ URL=https://httpbin.org/get # Example ...@@ -332,7 +332,7 @@ URL=https://httpbin.org/get # Example
## Set proxy globaly on linux ## Set proxy globaly on linux
``` ```shell
vi /etc/profile.d/http_proxy.sh vi /etc/profile.d/http_proxy.sh
export http_proxy=$PROXY_HOST:$PROXY_PORT export http_proxy=$PROXY_HOST:$PROXY_PORT
...@@ -342,7 +342,7 @@ export https_proxy=$PROXY_HOST:$PROXY_PORT ...@@ -342,7 +342,7 @@ export https_proxy=$PROXY_HOST:$PROXY_PORT
Example : Example :
``` ```shell
vi /etc/profile.d/http_proxy.sh vi /etc/profile.d/http_proxy.sh
export http_proxy=proxy.domain.com:443 export http_proxy=proxy.domain.com:443
...@@ -351,14 +351,14 @@ export https_proxy=proxy.domain.com:443 ...@@ -351,14 +351,14 @@ export https_proxy=proxy.domain.com:443
``` ```
You can check if this variables are loaded : You can check if this variables are loaded :
``` ```shell
env | grep -i "proxy" env | grep -i "proxy"
``` ```
## Curl behind a proxy ## Curl behind a proxy
``` ```shell
curl -v --proxy $PROXY_HOST:$PROXY_PORT $URL curl -v --proxy $PROXY_HOST:$PROXY_PORT $URL
# Exemple # Exemple
...@@ -369,7 +369,7 @@ curl -kv --proxy http://myproxy.domain.tld:8080 https://httpbin.org/get ...@@ -369,7 +369,7 @@ curl -kv --proxy http://myproxy.domain.tld:8080 https://httpbin.org/get
## Git behind a proxy ## Git behind a proxy
Globaly : Globaly :
``` ```shell
git config --global http.proxy http://$PROXY_HOST:$PROXY_HOST git config --global http.proxy http://$PROXY_HOST:$PROXY_HOST
git config --global https.proxy http://$PROXY_HOST:$PROXY_HOST git config --global https.proxy http://$PROXY_HOST:$PROXY_HOST
...@@ -379,13 +379,13 @@ git config --global https.proxy http://$PROXY_HOST:$PROXY_HOST ...@@ -379,13 +379,13 @@ git config --global https.proxy http://$PROXY_HOST:$PROXY_HOST
``` ```
Specific for a repository : Specific for a repository :
``` ```shell
git config --global http.https://domain.com.proxy http://proxyUsername:proxyPassword@proxy.server.com:port git config --global http.https://domain.com.proxy http://proxyUsername:proxyPassword@proxy.server.com:port
``` ```
or edit the ~/.gitconfig : or edit the ~/.gitconfig :
``` ```shell
[http] [http]
[http "https://domain.com"] [http "https://domain.com"]
proxy = http://proxyUsername:proxyPassword@proxy.server.com:port proxy = http://proxyUsername:proxyPassword@proxy.server.com:port
...@@ -395,7 +395,7 @@ or edit the ~/.gitconfig : ...@@ -395,7 +395,7 @@ or edit the ~/.gitconfig :
### Docker daemon add proxy settings ### Docker daemon add proxy settings
``` ```shell
cat /etc/systemd/system/docker.service.d/http-proxy.conf cat /etc/systemd/system/docker.service.d/http-proxy.conf
[Service] [Service]
Environment="HTTP_PROXY=http://$PROXY_HOST:$PROXY_PORT" Environment="HTTP_PROXY=http://$PROXY_HOST:$PROXY_PORT"
...@@ -411,7 +411,7 @@ sudo systemctl restart docker ...@@ -411,7 +411,7 @@ sudo systemctl restart docker
### Docker build behind Proxy ### Docker build behind Proxy
``` ```shell
docker build --build-arg http_proxy=http://$PROXY_HOST:$PROXY_PORT --build-arg https_proxy=http://$PROXY_HOST:$PROXY_PORT . docker build --build-arg http_proxy=http://$PROXY_HOST:$PROXY_PORT --build-arg https_proxy=http://$PROXY_HOST:$PROXY_PORT .
# Example for MAVEN inside a container # Example for MAVEN inside a container
...@@ -423,20 +423,20 @@ docker build --build-arg MAVEN_OPTS="-Dhttp.proxyHost=$PROXY_HOST -Dhttp.proxyPo ...@@ -423,20 +423,20 @@ docker build --build-arg MAVEN_OPTS="-Dhttp.proxyHost=$PROXY_HOST -Dhttp.proxyPo
## NPM behind a Proxy ## NPM behind a Proxy
``` ```shell
npm config set proxy http://$PROXY_HOST:$PROXY_PORT npm config set proxy http://$PROXY_HOST:$PROXY_PORT
npm config set https-proxy http://$PROXY_HOST:$PROXY_PORT npm config set https-proxy http://$PROXY_HOST:$PROXY_PORT
``` ```
## PIP behind a Proxy ## PIP behind a Proxy
``` ```shell
pip install --proxy=http://$PROXY_HOST:$PROXY_PORT -r requirements.txt pip install --proxy=http://$PROXY_HOST:$PROXY_PORT -r requirements.txt
``` ```
## Gitlab Runner behind a proxy ## Gitlab Runner behind a proxy
``` ```shell
mkdir /etc/systemd/system/gitlab-runner.service.d mkdir /etc/systemd/system/gitlab-runner.service.d
vi /etc/systemd/system/gitlab-runner.service.d/http-proxy.conf vi /etc/systemd/system/gitlab-runner.service.d/http-proxy.conf
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment