Skip to content

Instantly share code, notes, and snippets.

View boina-n's full-sized avatar

Nadjmou BOINA boina-n

  • Genopsys
  • Anywhere
  • 04:25 (UTC +04:00)
View GitHub Profile
@boina-n
boina-n / php-pools.md
Created April 17, 2024 02:04 — forked from holmberd/php-pools.md
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
@boina-n
boina-n / readme.md
Created April 7, 2024 18:13 — forked from edisoncosta/readme.md
woo-commerce fastcgi-cache session-conflict solution (attempt)

You can jump to code directly

How it works?

1. Cache product pages

Following line does't have /products.* page. This tells Nginx to cache all product pages by default.

Idea is fast loading product pages will improve scalability of a store and also conversion.

@boina-n
boina-n / bash-smtp.sh
Created June 1, 2020 17:58
Send email with bash in in TLS, SSL or in plain text
#!/bin/bash
subject="Subject of my email"
txtmessage="This is the message I want to send"
username='mail@exemple.com'
password='************'
From="mail01@exemple.com"
rcpt='testemail5739230@yopmail.com'
from_name='N BOINA'
rcpt_name='Nicolas Hulot'
@boina-n
boina-n / InfoBloxToBind.sh
Created October 22, 2017 15:56
Convert Infoblox zones to Bind Zones
#!/bin/bash
echo "#############################################################"
echo "#############################################################"
echo "## Infoblox to bind export script ##"
echo "## This script should be run on ##"
echo "## a server allowed transfer the zones ##"
echo "## the zones by transfer ##"
echo "#############################################################"
echo "#############################################################"
@boina-n
boina-n / smtp-telnet.sh
Last active November 9, 2022 03:58
Use telnet to send email with an attachement
#!/bin/bash
filename="/path/to/your/file.log"
subject="Subject of my email"
txtmessage="This is the message I want to send"
{
sleep 1;
echo "EHLO mydomain.intra"
sleep 1;
@boina-n
boina-n / ldapsearch.sh
Created December 17, 2018 10:50
ldap search for CN
cat /tmp/list.cuid.txt | while read line ; do echo $( echo "$line;"$(ldapsearch -H ldaps://$ldapserver -w $ldappassword -b "dc=domain,dc=exemple,dc=com" -D "CN="$cuid",OU=Utilisateurs,OU=France Telecom,DC=domain,DC=exemple,DC=com" -s sub "CN=$line" | grep "displayName:\|department:\|telephoneNumber:\|mail:" | awk -F ":" '{ $1 ~ "telephone ; print $2 }' | tr '\n' ';' ) ); done | tee /tmp/list.cuid.csv
@boina-n
boina-n / gist:5fa1013f84ce4fc2aa1ed278eb16a99c
Created June 24, 2020 12:47
Kubernetes Json filters memo
# Get label of each nodes:
oc get nodes -o=json | jq '.items[] | .metadata.name, .metadata.labels'
@boina-n
boina-n / curl.txt
Last active June 24, 2020 07:19
Curl and openssl for verification of SSL certificat - CheatSheet
$ hostname=app20-nadj2-test.apps.fr1.di-paas.domain
# If you are just interested in the code response with curl
$ curl -s -o /dev/null -vL $hostname 2>&1 | grep "<\|>"
> GET / HTTP/1.1
> Host: app20-nadj2-test.apps.fr1.di-paas.domain
> User-Agent: curl/7.64.1
> Accept: */*
@boina-n
boina-n / pvc-resizing.txt
Last active June 24, 2020 07:12
How to extend PVC. #Kubernetes #Openshift
## How to extend a PV:
pvcname=pvc60
volumename=volume60
mountpath=/opt/app-root/src/mount60
# Deploy a test app
oc new-app --template=openshift/httpd-example --name=app01
# Create a PVC
$ oc new-app --template=httpd-example -p name=$appname