Skip to content

Instantly share code, notes, and snippets.

View gangsta's full-sized avatar
😎

Karen Harutyunyan gangsta

😎
View GitHub Profile

Red Hat Enterprise Linux OpenStack Platform Installer you can run this command as root to reset the password:

$ sudo foreman-rake permissions:reset Reset to user: admin, password: XXXXXXXXXX

Admin password is stored in Postgres table users inside foreman database:

id | login             | admin | password_hash | password_salt
---+-------------------+-------+---------------+---------------

Docker, stop messing with my iptables rules!

Let's say you are using docker on a server available on the Internet. You already have an iptables based firewall configured. Personally, I'm using uif which is a very powerful perl script available in debian. Have a look at a config example.

To tell docker to never make changes to your system iptables rules, you have to set --iptables=false when the daemon starts.

For sysvinit and upstart based systems, you can edit /etc/default/docker. For systemd, you can do that:

mkdir /etc/systemd/system/docker.service.d
cat << EOF > /etc/systemd/system/docker.service.d/noiptables.conf

This is how we might use the defined type in a Puppet manifest:

apache::vhost { 'foo.example.com':
      port          => '80',
      docroot       => '/var/www/foo.example.com',
      docroot_owner => 'foo',
      docroot_group => 'foo',
      options       => ['Indexes','FollowSymLinks','MultiViews'],
      proxy_pass    => [ { 'path' => '/a', 'url' => 'http://backend-a/' } ],
}
@gangsta
gangsta / httpd443.md
Last active May 21, 2017 11:54
httpd , apache shows 443 is already in use?

Error

systemctl restart httpd

(98)Address already in use: AH00072: make_sock: could not bind to address [::]:443

Solution

@gangsta
gangsta / Vagrantfile
Last active August 8, 2017 16:56 — forked from mapaiva/Vagrantfile
Vagrant file for Golang and PostgreSQL
#-*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
@gangsta
gangsta / docker.md
Last active March 20, 2018 22:26
How to Install Docker CE 17 + version Centos 7

Docker CE for Centos 7

yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum install docker-ce -y
systemctl start docker

Adding Docker compose

@gangsta
gangsta / Puppet Gogs.md
Created August 29, 2017 22:33
Gogs and Puppet with Foreman

Execute shell

Command

#!/bin/bash

echo -e ""
echo -e "************************************************************************************************"
echo -e "Parsing Puppet Environment"
echo -e "************************************************************************************************"
@gangsta
gangsta / kube Jenkins.md
Last active August 29, 2017 22:41
kube Jenkins

Execute shell script on remote host using ssh

SSH site	root@k8s.mydomain.com
Command
echo -e ""
echo -e "**************************************************************"
echo -e " Generate YAML for Kubernetes"
echo -e "**************************************************************"
echo -e ""
@gangsta
gangsta / master.md
Last active November 22, 2017 01:13
Install Consul Server on Centos 7
echo '
#! /bin/bash


####### yum update is optional #####
#yum -y update
yum install firewalld -y
systemctl start firewalld
firewall-cmd  --add-port=8300/tcp --add-port=8301/tcp --add-port=8302/tcp --add-port=8400/tcp --add-port=8500/tcp --add-port=80/tcp --add-port=443/tcp --permanent
@gangsta
gangsta / SSL.md
Last active February 23, 2024 03:56
How to Setting Up a Comodo SSL Cert

How to Setting Up a Comodo SSL Cert

  • I advice you to buy SSL Certs from officially Comodo only , or some SSL reseller whose you trust.

These are the steps I went through to set up an SSL cert. Purchase the cert

Prior to purchasing a cert, you need to generate a private key, and a CSR file (Certificate Signing Request). You’ll be asked for the content of the CSR file when ordering the certificate:

openssl req -new -newkey rsa:2048 -nodes -keyout example_com.key -out example_com.csr