Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View boina-n's full-sized avatar

Nadjmou BOINA boina-n

  • Genopsys
  • Anywhere
  • 10:11 (UTC +04:00)
View GitHub Profile
@boina-n
boina-n / attributes.rb
Created April 22, 2019 08:34 — forked from lizthegrey/attributes.rb
Hardening SSH with 2fa
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'
/*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 December 28, 2018 16:13
because i suck in mysql ... How to create a simple mysql DB with records
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 December 26, 2018 16:35
CREATE A CREDHUB USER in the UAA Identity provider.
### 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 December 26, 2018 15:23
Compare Pivotal Cloud foundry product between 2 plateforms
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 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 / openstack-attach-ports-to-machine.sh
Created December 11, 2018 14:57
How to attach ports to a machine on openstack
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 June 1, 2020 18:26 — forked from 3noch/keybase+git-crypt.md
How to add a Keybase user to your repo using git-crypt
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 / Share internet connection over SSH
Last active October 24, 2018 13:21
internet_over_ssh.txt
#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 October 24, 2018 13:01
check https certificate
#! /bin/sh
#SRV_LIST="myser.com \
#myserver2.com \
#myserver3.com"
SRV_LIST="$1"
checkcrt(){
SRV=$1
echo "===== $SRV"