This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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"] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo ip route delete default | |
sudo ifconfig usb0 up | |
sudo dhclient usb0 | |
sudo ip route add default via 192.168.42.129 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
date=$(date +%d/%m/%y) | |
daterev=$(date +%Y%m%d) | |
timestamp=$(date +%s) | |
dir=/home/vcap/pcfdev-check | |
if [ ! -d "$dir" ]; then | |
mkdir -p $dir | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
filename="/path/to/your/file.log" | |
subject="Subject of my email" | |
txtmessage="This is the message I want to send" | |
{ | |
sleep 1; | |
echo "EHLO mydomain.intra" | |
sleep 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export MAVEN_OPTS="-Dhttps.proxyHost=1.2.3.4 -Dhttps.proxyPort=3128" | |
./mvnw clean package | |
mkdir -p /root/script/cfbackup | |
java -jar target/gencfscript-0.0.2-SNAPSHOT.jar http://api.pcfdev admin admin --skip-ssl-validation --hideProgress > /root/script/cfbackup/$(date +"%Y%m%d").cfbackup.sh | |
0 0 * * * /root/script/usagereport.sh &>/dev/null |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apikey=YourApiKeyhere | |
filename=pcfdev-v0.24.0+PCF1.9.0-linux.zip | |
url=https://network.pivotal.io/api/v2/products/pcfdev/releases/4027/product_files/12667/download | |
wget -O $filename --header="Authorization: Token $apikey" $url | |
# If you are behind a proxy: | |
curl -x http://myproxyaddress:port --proxy-user username:password' -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Token $apikey" -X GET $url -o $filename |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vcap@agent-id-pcfdev-0:~$ while true ; do iostat -p sda -x ; sleep 1 ;done | |
Linux 4.2.0-42-generic (agent-id-pcfdev-0) 02/09/2017 _x86_64_ (16 CPU) | |
avg-cpu: %user %nice %system %iowait %steal %idle | |
0.80 0.00 4.49 0.10 0.00 94.61 | |
Device: rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await r_await w_await svctm %util | |
sda 0.19 28.61 4.30 15.53 262.87 1166.64 144.22 1.07 53.79 19.09 63.40 3.64 7.21 | |
sda1 0.19 28.61 4.28 15.37 262.78 1166.64 145.49 1.06 54.18 19.17 63.93 3.65 7.18 | |
sda2 0.00 0.00 0.01 0.00 0.04 0.00 8.34 0.00 0.34 0.34 0.00 0.34 0.00 |