Category: Codes

Default Nginx Installation on Centos 7

NGINX as HTTP / HTTPS Proxysudo yum install epel-releasesudo yum install nginxsudo systemctl start nginxsudo…

Installing Apache on Centos 7

The easy methodsudo yum clean allsudo yum -y updatesudo yum -y install httpd php-pearsudo firewall-cmd…

How to Use Google SMTP Relay with Sendmail

Check to see if TLS is enabled:# sendmail -d0.1 -bv rootMake a certs directory:# mkdir…

A Few Todos while Securing Apache Server

- Install mod_security - Set expose_php = Off in php.ini - Set SecResponseBodyAccess Off in…

Some Common Gitlab Commands

To ignore SSL Cert errors: git config --global http.sslVerify "false"   # checkout changed file…

Setup LAMP using RedHat 7

// Add a new user and set it with root privileges: sudo su useradd {root-user}…

Nginx Apache SSL Example

-------------- NGINX -> ** /etc/nginx/sites-available/domainx.conf**server {listen 80;servername xxxxx.domainx.com;return 301 https://$host$requesturi;}server {listen 443 ssl;servername xxxxx.domainx.com;sslcertificate /etc/nginx/ssl/cert_domainx.crt;sslcertificatekey…

Error: 502 Gateway Error

Explanation: 502 Gateway Error generally means connection problems with an upstream proxy. In this instance,…

Apache HTTPd

# Install Apacheyum install httpd# Configure Apachevim /etc/httpd/conf/httpd.conf##### Change portNameVirtualHost 127.0.0.1:8080Listen 127.0.0.1:8080######### Set DocumentRootDocumentRoot "/var/www/kimconnect"######…

NGINX

# Create nginx.repovim /etc/yum.repos.d/nginx.repo#### content ####[nginx]name=nginx repo baseurl=http://nginx.org/packages/mainline/centos/$releasever/$basearch/ gpgcheck=0 enabled=1###############sudo yum update nginxsudo service nginx…

Docker DRUPAL Container

# Preseed drupal files with persitent storagemkdir /var/www/html/kimconnect/{modules,profiles,sites,themes}docker run --rm drupal tar -cC /var/www/html/sites .…

LAMP Stack using Docker

# Install docker and composeyum install docker docker-compose -y# Add user into docker groupusermod -aG…

Another Logon Script Example from 2008

Method 1 - Mixed Environment:1. Edit the following script as appropriate2. Then, save such script…

Excel Comma Delimited CSV with Quotes

Option ExplicitSub MakeFile()Dim rng As RangeDim NumR As LongDim NumC As LongDim CountR As LongDim…

Excel MD5 Hash Function

Go to the VB editor (Alt-F11), right-click on your workbook in theproject window, and click…

Web Server Files and mySQL backup and restore

Backup: mysqldump -u [username] -p [password] [databasename] > /home/shares/backup_db.sql   Restore: mysql -u root -p…

Gallery2 Random Highlight Mod

There's a SQL technical limitation where one may not update a table based on its…

Enable Serial over Ethernet

enableconfig tplatform console serialendcopy run startreload

Quick 1-liner: Secured File Transfer using PSCP

pscp.exe c:\origin\ root@serverIP:/path_to_destination

Script to remove files older than X days

------------- Batch file ------------------------@echo off:: set folder pathset dump_path="E:\Shared\APP01\LOGFILES\RatingWebService2\Rating Comments\Production":: set min age of files…