Skip to content

Instantly share code, notes, and snippets.

View gist:8c7abdf38d0ba2e11ce870dbbff50e44
root@debian:~# cat rado.los
WARNING:
Some git sub-modules are out of date or modified, please consider runnning:
git submodule sync --recursive
git submodule update --init --recursive
You can ignore this warning if you are not compiling any ChibiOS keyboards,
or if you have modified the ChibiOS libraries yourself.
Making ergodox/ez with keymap rado
View docker issue
set itermExists to false
try
tell application "Finder" to get application file id "com.googlecode.iterm2"
set itermExists to true
end try
set terminalScpt to path to resource "terminal.scpt" in directory "Scripts"
set itermScpt to path to resource "iterm.scpt" in directory "Scripts"
if itermExists then
View xapi-demo.py
import XenAPI
s=XenAPI.Session('http://localhost/')
s.login_with_password('root', 'password')
s.xenapi.VM.get_all()
Out[30]:
['OpaqueRef:fed9f387-359c-5e34-04b3-7e9de0271e9b',
'OpaqueRef:f21c711b-5de7-fb1f-5320-ea4b8fbbdac2',
...
'OpaqueRef:0032adf3-04d3-6cf7-94fe-9d06af09bec7']
@rtomaszewski
rtomaszewski / isolated-network-vm.sh
Created May 19, 2014
create a vm on isolated network
View isolated-network-vm.sh
# (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
@rtomaszewski
rtomaszewski / import-vms.sh
Created May 17, 2014
create more vms using the import functions from xenserver
View import-vms.sh
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
View spin-vm.sh
#!/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
@rtomaszewski
rtomaszewski / vmware-workstation-xenserver.conf
Created May 14, 2014
VMware Workstation VM config for XenServer
View vmware-workstation-xenserver.conf
.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"
@rtomaszewski
rtomaszewski / gist-type-command.c
Created Mar 30, 2014
Uses stdin of the shell to simulate input string and type a command to run.
View gist-type-command.c
#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>
@rtomaszewski
rtomaszewski / rax-list-cs-ips.sh
Last active Aug 29, 2015
list Openstack Rackspace cloud servers ip in more readable way
View rax-list-cs-ips.sh
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