Skip to content

Instantly share code, notes, and snippets.

View boina-n's full-sized avatar

Nadjmou BOINA boina-n

  • Genopsys
  • Anywhere
  • 00:37 (UTC +04:00)
View GitHub Profile
@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:username@127.0.0.1/concourse --external-url http://concourse.mydomain
User=root
[Install]
WantedBy = multi-user.target
@boina-n
boina-n / Info debug DNS Server.txt
Last active October 22, 2017 16:26
Debug a DNS Server
# tcpdump -nni eth0 dst port 53 -c 100000 -s 512 -C 10M -w /tmp/dnscapture.pcap
# chkconfig --list |grep iptable
# sbin/rndc status
# ip addr show
# sar -n DEV 1 60
@boina-n
boina-n / InstallBind9FromSource.sh
Created October 22, 2017 16:23
InstallBind9FromSource
cd /tmp
url=http://ftp.isc.org/isc/bind9/9.9.8-P2/bind-9.9.8-P2.tar.gz
wget $url
bindv=9.9.8-P2
compil=TCP3sec-nossl-rrl-xtds-ipv6-64bits
tar -zxvf bind-$bindv.tar.gz
patch /tmp/bind-$bindv/bin/named/client.c < /usr/local/progs/compil-resources/client.patch
less /tmp/bind-$bindv/bin/named/client.c
cd bind-$bindv
./configure --prefix=/usr/local/progs/bind-$bindv-$compil/ --enable-threads --without-openssl --enable-rrl --enable-ipv6
@boina-n
boina-n / LineSwitch5510.txt
Created October 22, 2017 16:20
LineSwitch5510
LineSwitch5510
-------------------
Model : Ethernet Routing Switch 5510-48T
Most important things to check on switch's are :
* port description nor reason to make sure you working on the right port
* port vlan's to add or remove a port
* port state and status { status is what have been forced by the user }
* port speed, make sure you're not confusing the current port speed and supported speed
*