Skip to content

Instantly share code, notes, and snippets.

MHMDhub

Block or report user

Report or block MHMDhub

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Creating a .pem File for SSL Certificate Installations
Creating a .pem File for SSL Certificate Installations
SSL .pem files (concatenated certificate container files), are frequently required for certificate installations when multiple certificates are being imported as one file.
This article contains multiple sets of instructions that walk through various .pem file creation scenarios.
Creating a .pem with the Entire SSL Certificate Trust Chain
Log into your DigiCert Management Console and download your Intermediate (DigiCertCA.crt), Root (TrustedRoot.crt), and Primary Certificates (your_domain_name.crt).
Open a text editor (such as wordpad) and paste the entire body of each certificate into one text file in the following order:
@MHMDhub
MHMDhub / docker_cheatsheet
Last active May 9, 2018
Docker Cheat-sheet
View docker_cheatsheet
#get name of container(s)
docker ps
#or docker-compose ps
docker inspect --format="{{.Id}}" nameofcontainer
View configure_centralized_syslog.txt
Centralized log management on Centos7:
Two Linux servers ( server @ ip 192.168.0.105 and client @ ip 192.168.0.104).
Server setup (Assuming rsyslog package is installed):
[root@server ~]# vi /etc/rsyslog.conf # Provides UDP syslog reception$ModLoad imudp$UDPServerRun 514 # Provides TCP syslog reception$ModLoad imtcp$InputTCPServerRun 514 [root@server ~]# service rsyslog restart Verify the syslog server listening.
[root@server ~]# netstat -antup | grep 514 tcp        0      0 0.0.0.0:514                 0.0.0.0:*                   LISTEN      8081/rsyslogdtcp        0      0 :::514                      :::*                        LISTEN      8081/rsyslogdudp        0      0 0.0.0.0:514                 0.0.0.0:*                               8081/rsyslogdudp        0      0 :::514                      :::*                                    8081/rsyslogd 
Client setup:
[root@client ~]# vi /etc/rsyslog.conf At the end of file place the following line to point the client message log to the server
*.info;mail.non
View devOps-lab.txt
Docker, Ansible, Vagrant, and Docker Swarm:
DevOps-lab:   
http://searchitoperations.techtarget.com/feature/DevOps-lab-Learn-Ansible-to-pick-up-configuration-management-concepts
http://searchitoperations.techtarget.com/feature/Learn-DevOps-techniques-and-tools-in-this-home-lab-setup
http://searchitoperations.techtarget.com/feature/DevOps-lab-How-to-use-Docker-swarm-mode-to-run-containers-in-VMs
Using Vagrant to Deploy Multiple VMs on vSphere:
http://buildvirtual.net/using-vagrant-to-deploy-multiple-vms-on-vsphere/
@MHMDhub
MHMDhub / ExampleXMLgenerator.py
Created Jun 27, 2017
script generates an xml file. Copied from Ganeshgq/verizon-code repository
View ExampleXMLgenerator.py
import os
import re
import sys
import time
from json import load, dumps
from urllib2 import Request, urlopen
from urllib import urlencode
from xml.etree.ElementTree import Element, SubElement, tostring, ElementTree
import xml.dom.minidom as minidom
@MHMDhub
MHMDhub / ExampleXMLparsing.py
Last active Jun 27, 2017
Exaple xml parser 1 using etree. Copied from following repository Ganeshgq/verizon-code
View ExampleXMLparsing.py
import xml.etree.ElementTree as ET
import re
import os
import sys
import subprocess
from urllib2 import Request, urlopen
from urllib import urlencode
from json import load, dumps
from base64 import b64encode
from xml.etree.ElementTree import Element, SubElement, tostring, ElementTree
@MHMDhub
MHMDhub / 0_reuse_code.js
Created Feb 28, 2017
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View homebrew.sh
# Howebrew package manager for OS X is useful for installing unix terminal tools.
# Install Homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)"
# Install wget
brew install wget
brew install openssl
# Update homebrew and all your packages
@MHMDhub
MHMDhub / dictMerge.py
Created Aug 14, 2016
Merge two Python dictionaries
View dictMerge.py
x = {'a':1, 'b': 2}
y = {'c':10, 'd': 11}
z = dict(x.items() + y.items())
z
{'a': 1, 'b':2, 'c': 10, 'd': 11}
@MHMDhub
MHMDhub / two-equal-lists-merge.py
Created Aug 14, 2016
Merge two equal-length lists into a dictionary, mapping one-to-many
View two-equal-lists-merge.py
Lst1 = ['11', '13', '11', '12', '11', '13', '12', '12', '12', '13', '11']
Lst2 = ['1/41', '1/34', '1/37', '1/47', '1/41', '1/33', '1/46', '1/45', 'p4', 'p5', 'p6']
Dict1 = {'11': ['1/41', '1/37', '1/141', 'p6'],
'12': ['1/47', '1/33', '1/46', 'p4'],
'13': ['1/34', '1/33', 'p5']}
Dict1 = {}
for key, val in zip(Lst1, Lst2):
You can’t perform that action at this time.