Skip to content

Instantly share code, notes, and snippets.

View boina-n's full-sized avatar

Nadjmou BOINA boina-n

  • Genopsys
  • Anywhere
  • 15:38 (UTC +04:00)
View GitHub Profile
@boina-n
boina-n / cf-kanboard-install.sh
Last active April 14, 2017 23:14
This is a script to install kanboard on Cloud Foundry
#!/bin/bash
cf login
wget https://kanboard.net/kanboard-latest.zip
unzip kanboard-latest.zip
cd kanboard
mkdir .bp-config
cat <<EOF >> .bp-config/options.json
{
"PHP_EXTENSIONS": ["gd","openssl","pdo", "pdo_mysql","pdo_sqlite","mbstring","mysql"]
}
@boina-n
boina-n / cf-haproxy.cfg
Created April 8, 2017 13:13
HaProxy conf for Cloud Foundry
defaults
mode http
log global
log 127.0.0.1 local2
option tcplog
option dontlognull
option http-server-close
option forwardfor
option redispatch
retries 3
@boina-n
boina-n / angular-start.sh
Last active August 16, 2017 09:10
memo for quickstart angular dev
git clone https://github.com/angular/quickstart.git quickstart
cd quickstart
npm install
npm start
# (*Nix) To delete no essential file of an Angular project
xargs rm -rf < non-essential-files.osx.txt
rm src/app/*.spec*.ts
rm non-essential-files.osx.txt
@boina-n
boina-n / DNS_Bench.sh
Created April 11, 2017 21:59
This is memo script that replay the DNS traffic captured in order to load a DNS Server for test purpose.
# To be executed on the DNS server and output to be copied
dif=bond1
dip=$(ip addr show dev $dif | egrep -o '(addr:)?([0-9]*\.){3}[0-9]*' | head -n1)
dmac=$(ip link show dev $dif | egrep -o '(link/ether:)?([0-9a-f]{2}\:){5}[0-9a-f]{2}' |head -n1)
echo -e "dmac=$dmac \ndip=$dip"
#To be executed on the injector
#Past the previous copied content from the DNS server
sif=bond1
@boina-n
boina-n / simple_resperf.sh
Created April 11, 2017 22:01
dns resperf test
for i in seq {1..9}; do resperf -d dns_domain_names.txt -s $host -f inet -p 53 -e 2> /dev/null |grep throughput ; done
@boina-n
boina-n / dns_autocompile.sh
Created April 11, 2017 22:03
This script automatically download the sources of bind and compile them. in order to create an install on the server
#!/bin/bash
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
@boina-n
boina-n / dns_autocompile.sh
Created April 11, 2017 22:04
This script automatically download the sources of bind and compile them. The executable are installed on a custom location.
#!/bin/bash
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
zone "toto-tr.fr.rt" {
type master;
masters { 213.154.64.11; };
file "slaves/db.toto-tr.fr.rt";
};
#Replace this :
(^[a-z0-9\-]+(\.[a-z0-9\-]+)*)
@boina-n
boina-n / jqpcfdev.sh
Created April 14, 2017 08:33
Help interpret json with jq command.
cf curl /v2/events | jq '.resources[].entity | select(.actee_type=="app") |{actor: .actor_name, type: .type, date: .timestamp, application: .actee_name}'
@boina-n
boina-n / ssl-cloud-foundry.sh
Last active April 26, 2017 15:34
How to generate an ssl wildcard certificat for Cloud Foundry.
openssl req -new -nodes -out wc.cf.boina.csr -newkey rsa:2048 -keyout wc.cf.boina.key -config <(
cat <<-EOF
[req]
default_bits = 2048
prompt = no
default_md = sha256
req_extensions = req_ext
distinguished_name = dn
[ dn ]