Skip to content

Instantly share code, notes, and snippets.

View boina-n's full-sized avatar

Nadjmou BOINA boina-n

  • Genopsys
  • Anywhere
  • 07:36 (UTC +04:00)
View GitHub Profile
@boina-n
boina-n / gist:5fa1013f84ce4fc2aa1ed278eb16a99c
Created June 24, 2020 12:47
Kubernetes Json filters memo
View gist:5fa1013f84ce4fc2aa1ed278eb16a99c
# Get label of each nodes:
oc get nodes -o=json | jq '.items[] | .metadata.name, .metadata.labels'
@boina-n
boina-n / pvc-resizing.txt
Last active June 24, 2020 07:12
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 / curl.txt
Last active June 24, 2020 07:19
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 / bash-smtp.sh
Created June 1, 2020 17:58
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'
@boina-n
boina-n / SSL certificat creation with cfssl
Created December 23, 2019 15:13
Create-certificat-with-cfssl.md
View SSL certificat creation with cfssl
## Create CA
{
cat > ca-config.json <<EOF
{
"signing": {
"default": {
"expiry": "8760h"
},
@boina-n
boina-n / gist:cc6a76f8a7a8aaa651af308462f764fd
Created August 8, 2019 14:22
Check Resources of VM on Cloud Foundry
View gist:cc6a76f8a7a8aaa651af308462f764fd
bosh -e pcf -d cf-xxxxxxxxxxxxxxxxxxxxxxx vms --vitals --json |jq -r '.Tables |.[].Rows[] | select(.instance|contains("router"))'
@boina-n
boina-n / omix.sh
Created May 23, 2019 13:08
Wrapped Pivotal om command
View omix.sh
#!/bin/bash
bosh-creds () {
om --target $OM_TARGET --skip-ssl-validation --username $OM_USERNAME --password $OM_PASSWORD curl --silent -p /api/v0/deployed/director/credentials/director_credentials | jq .credential.value
}
director-uaa-creds () {
om --target $OM_TARGET --skip-ssl-validation --username $OM_USERNAME --password $OM_PASSWORD curl --silent -p /api/v0/deployed/director/credentials/uaa_admin_user_credentials |jq -r .credential.value
}
@boina-n
boina-n / attributes.rb
Created April 22, 2019 08:34 — forked from lizthegrey/attributes.rb
Hardening SSH with 2fa
View attributes.rb
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'
View CF_UaaToLDAP.sql
/*DROP TABLE IF EXISTS `update_statements`;
create table update_statements (
commands varchar(1024)
);*/
-- ------------------- UAA TO LDAP PROCEDURE FOR CLOUD FOUNDRY ---------------------------------------------------------
DELIMITER $$
DROP PROCEDURE IF EXISTS UAA_MIG$$
CREATE PROCEDURE UAA_MIG()