Skip to content

Instantly share code, notes, and snippets.

Avatar

Nadjmou BOINA boina-n

View GitHub Profile
@boina-n
boina-n / ldapsearch.sh
Created Dec 17, 2018
ldap search for CN
View ldapsearch.sh
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
View gist:5fa1013f84ce4fc2aa1ed278eb16a99c
# Get label of each nodes:
oc get nodes -o=json | jq '.items[] | .metadata.name, .metadata.labels'
@boina-n
boina-n / curl.txt
Last active Jun 24, 2020
Curl and openssl for verification of SSL certificat - CheatSheet
View curl.txt
$ 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 Jun 24, 2020
How to extend PVC. #Kubernetes #Openshift
View pvc-resizing.txt
## 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
View gist:a59efdcae5286e3896bf054f5e96ce9e
$ oc new-app --template=httpd-example -p name=$appname
@boina-n
boina-n / apt-proxy.sh
Last active Jun 1, 2020
set proxy for apt in ubuntu
View apt-proxy.sh
cat <<EOF > /etc/apt/apt.conf.d/01proxy
Acquire::http::Proxy "http://10.0.2.2:8080"; EOF
@boina-n
boina-n / shell-trick01.txt
Created Jun 7, 2017
How to find a file containing a text
View shell-trick01.txt
# The text in the file to be found: "83oMef5367"
find . -type f -exec grep -nH "83oMef5367" {} \;
@boina-n
boina-n / TsharkDnsPacket.sh
Created Oct 22, 2017
Tshark a DNS Packet
View TsharkDnsPacket.sh
$ wc -l ok.cleaning_center.pcap.20151201.19h01m17s-1448992877.645994-1448992920.921620.v.1.txt
8994730 ok.cleaning_center.pcap.20151201.19h01m17s-1448992877.645994-1448992920.921620.v.1.txt
From resperf source: https://github.com/cobblau/dnsperf
static char *qtypes[] = {"A", "NS", "MD", "MF", "CNAME", "SOA", "MB", "MG",
"MR", "NULL", "WKS", "PTR", "HINFO", "MINFO", "MX", "TXT",
"AAAA", "SRV", "NAPTR", "A6", "AXFR", "MAILB", "MAILA", "*", "ANY"};
@boina-n
boina-n / keybase+git-crypt.md
Last active Jun 1, 2020 — forked from 3noch/keybase+git-crypt.md
How to add a Keybase user to your repo using git-crypt
View keybase+git-crypt.md
keybase track <keybase.io user>
keybase pgp pull <keybase.io user>
gpg --edit-key <keybase.io user>
  > lsign
  > save
git-crypt add-gpg-user <keybase.io user>
@boina-n
boina-n / bash-smtp.sh
Created Jun 1, 2020
Send email with bash in in TLS, SSL or in plain text
View bash-smtp.sh
#!/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'
You can’t perform that action at this time.