Skip to content

Instantly share code, notes, and snippets.

View yildirima's full-sized avatar

Abdurrahim YILDIRIM yildirima

View GitHub Profile
@yildirima
yildirima / bootstrap.json
Last active March 2, 2019 22:26
Consul Configuration
# vi /appdata/consulv1/config/bootstrap.json
{
"bootstrap": true,
"server": true,
"data_dir": "/appdata/consulv1/data",
"encrypt": "e6c0648e561dccadad32d6a3e579b63d",
"datacenter": "DC1",
"log_level": "INFO",
"enable_syslog": true,
"disable_update_check": true,
@yildirima
yildirima / consul-bootstrap.service
Last active March 2, 2019 20:11
Consul Service File
#cat /usr/lib/systemd/system/consulv1-bootstrap.service
[Unit]
Description=Consul Agent (BootStrap)
After=network.target
[Service]
Restart=on-failure
User=appuser
Group=appgroup
@yildirima
yildirima / regservice.py
Created March 2, 2019 21:56
Consul-Register-Service
import consul
def consul_conn_check(host):
c = consul.Consul(host=host)
state = False
try:
c.catalog.nodes()
state = True
except ConnectionError:
pass
finally:
##Add this lines to the openssl.cnf file##
[ usr_cert ]
basicConstraints = CA:FALSE
nsCertType = client
keyUsage = digitalSignature, keyEncipherment
extendedKeyUsage = clientAuth
nsComment = "OpenSSL Certificate for SSL Client"
##Windows##
set OPENSSL_CONF=openssl.cnf
##Linux###
export OPENSSL_CONF=openssl.cnf
##Windows or Linux##
openssl x509 -req -days 760 -in Client.csr -CA RootCA.crt -CAkey RootCA.pem -CAcreateserial -out Client.crt -extfile openssl.cnf -extensions usr_cert -sha256
#!/bin/bash
host=$1
verify=$2
openssl s_client -showcerts -verify $verify -connect $host:443 < /dev/null | awk '/BEGIN/,/END/{ if(/BEGIN/){a++}; out="certout"a".pem"; print >out}'
openssl x509 -noout -text -purpose -in certout1.crt
openssl x509 -noout -text -purpose -in certout2.crt
######How to run script###########
# bash test.sh google.com 3
#Abdurrahim YILDIRIM#
#Define file that you need to monitor####
$targetFile = "C:\HPOM\ProgramData\HP\HP BTO Software\shared\tmp\queues\MsgQueue"
$path_file = "C:\HPOOconfig\SystemControl\quee_size_control"
$fileSize = ((Get-Item $targetFile).length/1KB)
$friendlySize = ([math]::Round($fileSize, 2))
$sto = "yourmail@casesup.com"
echo $fileSize
if ($fileSize -gt 100)
{
from django.shortcuts import render
def error_404(request, exception):
data = {}
return render(request,'certman/404.html', data)
def error_500(request, exception):
data = {}
return render(request,'certman/500.html', data)
sudo: required
services:
- docker
before_install:
- sudo rm /usr/local/bin/docker-compose
- curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
- chmod +x docker-compose
- sudo mv docker-compose /usr/local/bin