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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
# default pool | |
create ltm pool pool-vip-80 | |
modify ltm pool pool-vip-80 members add { 1.1.1.1:80 { session disabled state down } } | |
modify ltm pool pool-vip-80 monitor http | |
# let' add some cloud servers manually | |
modify ltm pool pool-vip-80 { members add { 10.208.1.1:80 } } | |
# use the Rackconnect metadata feature |
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
# http vip | |
create ltm virtual vs-vip-80 destination 192.168.199.111:http | |
modify ltm virtual vs-vip-80 { profiles replace-all-with { tcp { } } } | |
modify lmt virtual vs-vip-80 { profiles add { http } } | |
modify ltm virtual vs-vip-80 { pool pool-vip-80 } |
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
create ltm pool pool-vip-80-url1 | |
modify ltm pool pool-vip-80-url1 members add { 1.1.1.1:80 { session disabled state down } } | |
modify ltm pool pool-vip-80-url1 monitor http | |
modify ltm pool pool-vip-80-url1 { members add { ip:port } } | |
create ltm pool pool-vip-80-url2 | |
modify ltm pool pool-vip-80-url2 members add { 1.1.1.1:80 { session disabled state down } } | |
modify ltm pool pool-vip-80-url2 monitor http | |
modify ltm pool pool-vip-80-url2 { members add { ip:port } } |
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
nova list | egrep -v 'ID|-----' | awk -F'|' '{print $2 }' | ( echo 'name pub-new(rc) ip priv-net ip init-net ip' ; while read cs; do nova show $cs | egrep ' name |accessIPv4|public network|private' | awk -F"|" '{for (i=1;i<=NF;i++) gsub (/^ */,"",$i); print $2,$3}' | sort | xargs echo | awk ' { print $4,$1,$2,$5,$6,$7,$8 }'; done ) | column -t | |
name pub-new(rc) ip priv-net ip init-net ip | |
APP01 accessIPv4 1.2.3.141 privatenetwork 10.208.64.184 publicnetwork 1111:1a11:1111:2222:3333:2222:ff08:a1ce,11.13.12.17 | |
APP01 accessIPv4 1.2.3.140 privatenetwork 10.208.97.95 publicnetwork 11.13.140.6,1111:2222:3333:4444:5555:ae11:ff08:70b5 | |
APP02 accessIPv4 1.2.3.238 privatenetwork 10.208.97.115 publicnetwork 11.13.140.46,1111:2222:3333:4444:5555:ae11:ff08:9586 | |
APP03 accessIPv4 1.2.3.142 privatenetwork 10.208.102.109 publicnetwork 11.13.177.167,1111:2222:3333:4444:5555:ae11:ff08:1300 |
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
#include <strings.h> | |
#include <string.h> | |
#include <sys/ioctl.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <fcntl.h> | |
#include <termios.h> | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <stdlib.h> |
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
.encoding = "windows-1252" | |
config.version = "8" | |
virtualHW.version = "8" | |
numvcpus = "4" | |
scsi0.present = "TRUE" | |
scsi0.virtualDev = "lsilogic" | |
memsize = "4096" | |
scsi0:0.present = "TRUE" | |
scsi0:0.fileName = "xenserver5.vmdk" | |
ide1:0.present = "TRUE" |
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 | |
set -e | |
set -x | |
template=`xe template-list name-label="Ubuntu Lucid Lynx 10.04 (64-bit)" --minimal` | |
vm=`xe vm-install template=$template new-name-label=vm-label` | |
network=`xe network-list bridge=xenbr0 --minimal` | |
vif=`xe vif-create vm-uuid=$vm network-uuid=$network device=0` | |
xe vm-param-set uuid=$vm other-config:install-repository=http://archive.ubuntu.com/ubuntu |
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
xe vm-export filename=vm-label1-export1.xva vm=vm-label | |
for i in $(seq 2 10); do | |
name="vm-$i" | |
echo -n "creating vm $name " | |
uuid=$(xe vm-import filename=vm-label1-export1.xva preserve=false) | |
xe vm-param-set name-label=$name uuid=$uuid | |
xe vm-start vm=$name | |
done |
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
# (1) | |
$ xe vm-copy vm=vm-10 new-name-label=gateway-vm | |
$ xe network-list | |
$ xe vif-create network-uuid=b211707c-0f56-b33e-22b0-ad1816914b8a device=3 vm-uuid=4fb0febb-5659-f9b5-abf6-21cd63632c5b | |
$ xe vif-plug uuid=02600ba0-b040-733f-bcce-e64661dcb352 | |
$ xe console vm=gateway-vm | |
# (2) | |
root@gateway-vm:/etc/network# cat interfaces |