Skip to content

Instantly share code, notes, and snippets.

Nadjmou BOINA boina-n

Block or report user

Report or block boina-n

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
@boina-n
boina-n / SSL certificat creation with cfssl
Created Dec 23, 2019
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 / unbound tcp-upstream
Created Dec 23, 2019
set tcp upsteam on unbound
View unbound tcp-upstream
ubuntu@vps716403:/etc/unbound/unbound.conf.d$ cat /etc/unbound/unbound.conf.d/qname-minimisation.conf
server:
###########################################################################
# BASIC SETTINGS
###########################################################################
# Time to live maximum for RRsets and messages in the cache. If the maximum
# kicks in, responses to clients still get decrementing TTLs based on the
# original (larger) values. When the internal TTL expires, the cache item
# has expired. Can be set lower to force the resolver to query for data
# often, and not trust (very large) TTL values.
@boina-n
boina-n / gist:cc6a76f8a7a8aaa651af308462f764fd
Created Aug 8, 2019
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
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 Apr 22, 2019 — 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()
@boina-n
boina-n / gist:a413549622d364c415edb9e62bf11c26
Created Dec 28, 2018
because i suck in mysql ... How to create a simple mysql DB with records
View gist:a413549622d364c415edb9e62bf11c26
create database boina-n_db01;
show databases;
use boina-n_db01;
create table mytable01 (name varchar(20), sex CHAR(1), birth DATE);
SHOW TABLES;
inset into mytable01 value ('boina-n','M','1989-12-22')
select * from mytable01;
@boina-n
boina-n / add-credhub-user-in-director-uaa.ssh
Created Dec 26, 2018
CREATE A CREDHUB USER in the UAA Identity provider.
View add-credhub-user-in-director-uaa.ssh
### CREATE A CREDHUB USER
"UAAC Target: uaac target ${DIRECTOR_UAA_URI} --skip-ssl-validation
"UAAC Login: uaac token owner get ${DIRECTOR_UAA_LOGIN_USER} ${DIRECTOR_UAA_ADMIN_USER} -s ${DIRECTOR_UAA_LOGIN_PASS} -p ${DIRECTOR_UAA_ADMIN_PASS}
"Credhub USER: uaac client add --name ${CREDHUB_CLIENT} --scope \"uaa.none\" --authorized_grant_types client_credentials --authorities \"credhub.write,credhub.read\" -s ${CREDHUB_CLIENT_SECRET} credhub
@boina-n
boina-n / pcf-compare.sh
Last active Dec 26, 2018
Compare Pivotal Cloud foundry product between 2 plateforms
View pcf-compare.sh
diff <(jq -S . director_properties.prod.json) <(jq -S . director_properties.stg.json)
< "keep_unreachable_vms": true,
---
> "keep_unreachable_vms": false,
56c56
< "disk_size": 153600,
---
> "disk_size": 102400,
@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
You can’t perform that action at this time.