Skip to content

Instantly share code, notes, and snippets.

View behroozam's full-sized avatar
😁
teheeee

Behrouz Hasanbeygi behroozam

😁
teheeee
View GitHub Profile
@andreivmaksimov
andreivmaksimov / docker-compose.yml
Created April 3, 2019 23:38
Running Jaeger v1.11 backed by Elasticsearch OSS v6.7.0 using Docker Compose
version: '2.2'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch-oss:6.7.0
environment:
- "discovery.type=single-node"
- "ES_JAVA_OPTS=-Xmx256m -Xms256m"
ulimits:
memlock:
@janeczku
janeczku / rancher-url-change.md
Last active March 18, 2024 17:37
Change the hostname/URL and certificate of an existing Rancher installation

Steps to change the URL of Rancher installation and switch from a self-signed certificate to a certificate signed by recognized CA.

  1. Change the Rancher server-url setting to the new URL:
    • Navigate to https://<old_rancher_hostname>/g/settings/advanced
    • Edit server-url to https://<new_rancher_hostname>
  2. Clear the private CA certificate for the old certificate
    • Navigate to https://<old_rancher_hostname>/g/settings/advanced
    • Next to cacerts click context menu -> View in API
    • Click Edit
    • Clear the content of the value field
# -*- coding: utf-8 -*-
import json
import toml
def read_pipenv_lock():
with open('Pipfile.lock') as lock:
return json.loads(lock.read())
@tomchavakis
tomchavakis / jaeger-elasticsearch
Last active April 19, 2020 08:39
jaeger docker-compose with elasticsearch collector
version: "3"
services:
collector:
image: jaegertracing/jaeger-collector:1.8
environment:
- SPAN_STORAGE_TYPE=elasticsearch
- ES_SERVER_URLS=http://localhost:9200
ports:
- "14269"
@matthewpalmer
matthewpalmer / nfs-server.yaml
Created October 22, 2018 00:56
Example for NFS server in Kubernetes
# Note - an NFS server isn't really a Kubernetes
# concept. We're just creating it in Kubernetes
# for illustration and convenience. In practice,
# it might be run in some other system.
# Create a service to expose the NFS server
# to pods inside the cluster.
kind: Service
apiVersion: v1
@holmberd
holmberd / php-pools.md
Last active July 23, 2024 15:06
Adjusting child processes for PHP-FPM (Nginx)

Adjusting child processes for PHP-FPM (Nginx)

When setting these options consider the following:

  • How long is your average request?
  • What is the maximum number of simultaneous visitors the site(s) get?
  • How much memory on average does each child process consume?

Determine if the max_children limit has been reached.

  • sudo grep max_children /var/log/php?.?-fpm.log.1 /var/log/php?.?-fpm.log
@ethanpil
ethanpil / wp-secure.conf
Created May 12, 2017 16:16
Wordpress Security for NginX
# wp-secure.conf
#
#
# This file includes common security considerations for wordpress using nginx.
#
# The goal is to block actions which are usually dangerous to wordpress.
# Additionally, we block direct access to PHP files and folders which should not
# be accessed directly from a browser.
#
# Also have included exceptions for plugins that are known to require this access.
@section-io-gists
section-io-gists / CustomMaintenancePage.vcl
Last active August 29, 2023 07:49
Varnish 4 - Custom maintenance page
import std;
acl whitelist {
"123.123.123.123";
"216.3.128.12";
}
sub vcl_recv {
# If not a whitelisted IP, then display maintenance page. Requires std library.
if(std.ip(regsub(req.http.X-Forwarded-For, "[, ].*$", ""), client.ip) !~ whitelist) {
@mariotacke
mariotacke / README.md
Created March 7, 2017 04:36
Default nginx log format (combined) and grok pattern
@arkka
arkka / upgrade.py
Last active November 17, 2020 21:39
Upgrade service via Rancher API using python
import os
import requests
import json
import time
environmentName = 'some-env'
serviceName = 'some-service'
newImage = 'docker:arkka/some-image:tag'
# Find stack based on their name