Skip to content

Instantly share code, notes, and snippets.

Avatar

Nadjmou BOINA boina-n

View GitHub Profile
@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
@boina-n
boina-n / openstack-attach-ports-to-machine.sh
Created Dec 11, 2018
How to attach ports to a machine on openstack
View openstack-attach-ports-to-machine.sh
primary_subnet=PRD_APPLIS
secondary_subnet=ADM_APPLIS
primary_network=port_opsman01_I_PRD_APPLIS
secondary_network=port_opsman01_I_ADM_APPLIS
virtmachine=opsman01
#show a Default port
neutron port-show $primary_network
@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>
View Share internet connection over SSH
#For Concourse VM
ssh nadj@10.10.21.5 -g -R \*:60001:localhost:8080
ssh -i .ssh/my_id.keyl@10.11.13.7 -g -R \*:8081:0.0.0.0:60001
sudo iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j DNAT --to 127.0.0.1:8081
sudo iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 443 -j DNAT --to 127.0.0.1:8081
curl -x http://localhost:3128 -L pivotal.io -v |head
curl -x http://localhost:3128 -L google.Com -v
@boina-n
boina-n / check_https.sh
Created Oct 24, 2018
check https certificate
View check_https.sh
#! /bin/sh
#SRV_LIST="myser.com \
#myserver2.com \
#myserver3.com"
SRV_LIST="$1"
checkcrt(){
SRV=$1
echo "===== $SRV"
@boina-n
boina-n / gist:1fb1153a7a368fd80c08d9c152f64f04
Created Oct 23, 2018
put cf deployment name in a variable
View gist:1fb1153a7a368fd80c08d9c152f64f04
boshenv=pcf
boshdep=$(bosh -e $boshenv deployments | grep ^cf\-[a-z0-9].*$ | awk '{ print $1 }')
bosh -e pcf -d $boshdep vms
@boina-n
boina-n / get_product_properties.sh
Created Aug 29, 2018
get configurable properties from products
View get_product_properties.sh
./omix.sh curl --path /api/v0/staged/products/p-isolation-segment-efoizefoi9867NUZD98ZD/properties | jq -r ".properties | with_entries(select(.value.configurable == true) | {key: .key, value: {value: .value.value}})"
You can’t perform that action at this time.