Skip to content

Instantly share code, notes, and snippets.

Abdurrahim YILDIRIM yildirima

Block or report user

Report or block yildirima

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 .travis.yml
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
View error_handler_views.py
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)
View monitorFileSize.ps1
#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)
{
View CheckCertificatePurpose.sh
#!/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
View OpenSSLSingClientCert
##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
View openssl.cnf
##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"
@yildirima
yildirima / regservice.py
Created Mar 2, 2019
Consul-Register-Service
View regservice.py
import consul
def consul_conn_check(host):
c = consul.Consul(host=host)
state = False
try:
c.catalog.nodes()
state = True
except ConnectionError:
pass
finally:
View consul-bootstrap.service
#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 / bootstrap.json
Last active Mar 2, 2019
Consul Configuration
View bootstrap.json
# 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,
You can’t perform that action at this time.