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
---+-------------------+-------+---------------+---------------

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/' } ],
}

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
@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 / 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 / gogs.md
Created November 15, 2017 17:12
How To Install Gogs

How To Install Gogs

First of all ,be sure that you have created user “gogs” .

sudo su - #installing gogs useradd gogs passwd gogs

After that we need to prepare database section to have local database for gogs . In our case its PostgreSql.

@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 / Puppetagent.md
Last active December 20, 2017 16:47
Puppet agent centos 7

Install Puppet agent 4 Centos 7

yum install -y https://yum.puppetlabs.com/puppetlabs-release-pc1-el-7.noarch.rpm
yum -y install puppet-agent
/opt/puppetlabs/bin/puppet config set server foreman.domain.com --section agent
/opt/puppetlabs/bin/puppet agent -t
/opt/puppetlabs/bin/puppet resource service puppet ensure=running enable=true