Skip to content

Instantly share code, notes, and snippets.

View boina-n's full-sized avatar

Nadjmou BOINA boina-n

  • Genopsys
  • Anywhere
  • 07:07 (UTC +04:00)
View GitHub Profile
@boina-n
boina-n / Share internet connection over SSH
Last active October 24, 2018 13:21
internet_over_ssh.txt
#For Concourse VM
ssh [email protected] -g -R \*:60001:localhost:8080
ssh -i .ssh/[email protected] -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"
@boina-n
boina-n / gist:1fb1153a7a368fd80c08d9c152f64f04
Created October 23, 2018 15:40
put cf deployment name in a variable
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 August 29, 2018 10:15
get configurable properties from products
./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}})"
@boina-n
boina-n / rename.sh
Last active April 7, 2018 10:43
rename list of file based on the separator "-" and have the extension .xml
#!/bin/bash
if [ "$#" != 2 ] ; then
echo 'donne des arguments mooonnn !!!!'
exit 0
fi
src=$1
dst=$2
list=$(ls $src)
mkdir -p $dst
@boina-n
boina-n / MySQL-write_script.sh
Created March 19, 2018 16:04
MySQL-write_script.sh
CREATE TABLE `cf_1e7d7278_f007_4a59_b423_e4804236eeb0`.`operation.2017112800` ( `CurrentDate` DATETIME NOT NULL ) ENGINE = InnoDB;
INSERT INTO `cf_1e7d7278_f007_4a59_b423_e4804236eeb0`.`operation.2017112800` (`CurrentDate`) VALUES (NOW());
#!/bin/bash
echo 'INSERT INTO `cf_1e7d7278_f007_4a59_b423_e4804236eeb0`.`operation.2017112800` (`CurrentDate`) VALUES (NOW());' | mysql -h vip-olaf-svcmysql.example.com -u ukIsd3JezjPp6HN3 -p9fAhqiXAENxOzuam
@boina-n
boina-n / rabbitmqctl-report.txt
Last active March 7, 2018 08:50
How to get rabbitmq instance report
uuid=4d67828a-d2b3-4283-b0d4-95e87947b42b
bosh -e pcf -d p-rabbitmq-74685ea63d3760472441 ssh rabbitmq-server/$uuid
sudo su -
cd /var/vcap/packages
export ERL_DIR=$PWD/erlang/bin/
cd rabbitmq-server/bin/
uuid=4d67828a-d2b3-4283-b0d4-95e87947b42b
./rabbitmqctl report > /tmp/rabbitmqctl-report-rabbitmq-server-$uuid.log
bosh -e pcf -d p-rabbitmq-74685ea63d3760472441 scp rabbitmq-server/$uuid:/tmp/rabbitmqctl-report-rabbitmq-server-$uuid.log /tmp/
@boina-n
boina-n / quota_enforcement.sh
Created February 21, 2018 10:09
How to enfore space quota plan on PCF
cf curl /v2/organizations/854e0b32-9ec7-3859-a59f-a992a1e7850c/spaces | jq -r ".resources[]" | jq '.entity | select(.space_quota_definition_url!="/v2/space_quota_definitions/a992a1e7850c-5f6e-301a-zdt9-954e0b32")' | jq '.name' | tr -d \" | while read p ; do cf set-space-quota $p {$space_quota_plan} ; done
@boina-n
boina-n / netpps.sh
Created December 19, 2017 21:57 — forked from joemiller/netpps.sh
shell: quick linux scripts for showing network bandwidth or packets-per-second
#!/bin/bash
if [ -z "$1" ]; then
echo
echo usage: $0 network-interface
echo
echo e.g. $0 eth0
echo
echo shows packets-per-second
[Unit]
Description = Concourse Web Server
After = postgresql.target
[Service]
ExecStart = /opt/concourse/bin/concourse web --basic-auth-username myusername --basic-auth-password MyPaSSWord --session-signing-key /opt/concourse/keys/session_signing_key --tsa-host-key /opt/concourse/keys/tsa_host_key --tsa-authorized-keys /opt/concourse/keys/authorized_worker_keys --postgres-data-source postgres://concourse:[email protected]/concourse --external-url http://concourse.mydomain
User=root
[Install]
WantedBy = multi-user.target