Category Archives: Linux

Jenkins behind an Nginx Reverse Proxy

Setup Nginx: yum install nginx vim /etc/nginx/nginx.conf location / { sendfile off; proxy_pass http://localhost:8080; proxy_redirect default; proxy_http_version 1.1; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_max_temp_file_size 0; #this is the maximum upload size client_max_body_size 10m; … Continue reading

Posted in Jenkins, LFCE, LFCS, Linux, Nginx

Basic git commands

Install and setup: Required: yum install git && git –version git config [–global] user.name “user” git config [–global] user.email “user@localhost” General: git config –global credential.helper “cache –timeout=28800” git config –global core.excludesfile /etc/gitignore git config –global http.postBuffer 524288000 git config –global … Continue reading

Posted in git, LFCE, LFCS, Linux

Setup Cntlm proxy in CentOS

Download and Install: curl -o /tmp/cntlm.rpm  https://sourceforge.net/projects/cntlm/files/cntlm/cntlm%200.92.3/cntlm-0.92.3-1.x86_64.rpm sudo rpm -ivh /tmp/cntlm-*.rpm Configure: cntlm -H -d domain1 -u user1 sudo vi /etc/cntlm.conf Username user1 Domain domain1 PassNTLMv2   11112345325gsdg4535435    (Use this value from step#1) Proxy   www.myproxy.com:8080 Listen 127.0.0.1:3128 Listen 192.168.1.6:3128 sudo cntlm … Continue reading

Posted in cntlm, LFCE, LFCS, Linux

tmux and screen basic commands

tmux: tmux | tmux new -s “mysession”          (Start a new session) tmux ls                       (List sessions) ctrl+b d | exit            (Detach or … Continue reading

Posted in LFCE, LFCS, Linux, Other

Firewalld and iptables commands

i) firewall-cmd (iptables): yum install  firewalld  firewall-config systemctl status|start|stop|enable|disable firewalld firewall-cmd –state firewall-cmd –reload firewall-cmd –list-all | –list-ports firewall-cmd –panic-on |–panic-off    (Block all incoming or outgoing traffic) zones: firewall-cmd  –get-zones|–get-default-zone|–get-active-zone firewall-cmd  –set-default-zone=trusted  [–permanent]  services: firewall-cmd –list-services firewall-cmd –add-service=ftp         [–permanent]  [–zone=public] … Continue reading

Posted in LFCE, LFCS, Linux

Setup Squid proxy server in Linux

Squid: Allow access for a local network: yum install squid Add the following in /etc/squid/squid.conf after: # INSERT YOUR OWN RULE(S) HERE acl mynetwork src 192.168.254.0/24 http_access allow mynetwork #http_access allow localnet       (Comment it because it contains 192.168.0.0) squid -k … Continue reading

Posted in LFCE, LFCS, Linux

Setup route between two hosts

i) centos host:  (IP: 10.20.45.1; Netmask: 255.255.255.0; Gateway: 10.20.45.1) Add the following into /etc/sysconfig/network-scripts/ifcfg-ens33 NAME=ens33                               DEVICE=ens33 BOOTPROTO=static ONBOOT=yes IPADDR=10.20.45.1 NETMASK=255.255.255.0   (No GATEWAY here because its defined in … Continue reading

Posted in Linux, Other