This file contains 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
// this code is from a simple add function in c: | |
// | |
// // hello.c | |
// int add(int a, int b) { | |
// return a + b; | |
// } | |
// | |
// compiles it with emcc (http://webassembly.org/getting-started/developers-guide/) | |
// $ git clone https://github.com/juj/emsdk.git |
This file contains 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 | |
DOMAIN=$1 | |
XML=`sudo virsh dumpxml $DOMAIN` | |
MAC=`echo "$XML" | grep 'mac address' | awk -F\' '{print $2}'` | |
VIRNETWORK=`echo "$XML" | grep 'source network' | awk -F\' '{print $2}'` | |
VIRBRIDGE=`sudo virsh net-info $VIRNETWORK | grep Bridge | awk '{print $2}'` | |
VIRNET=`ifconfig $VIRBRIDGE | grep inet | awk '{print $2}' | awk -F. '{print $1"."$2"."$3".*"}'` | |
nmap -sn $VIRNET &> /dev/null |
This file contains 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
javascript:(function(){var%20d=document,useMine=true,prevEl;function%20AddHandler(orig,mine) | |
{return%20function(e){if(useMine)mine(e);else%20if(orig)orig(e);};}function%20Myonmouseover(e) | |
{var%20evt=e||window.event;var%20elem=evt.target||evt.srcElement;elem.style.outline='2px%20solid%20gray'; | |
prevEl=elem;}function%20Myonmouseout(e){var%20evt=e||window.event;var%20elem=evt.target||evt.srcElement;elem.style.outline='';} | |
function%20Myonclick(e){var%20evt=e||window.event;var%20elem=evt.target||evt.srcElement;elem.style.display='none';} | |
function%20Myonkeydown(e){var%20evt=e||window.event;if(evt.keyCode==27){prevEl.style.outline='';useMine=false;}} | |
d.onmouseover=AddHandler(d.onmouseover,Myonmouseover);d.onmouseout=AddHandler(d.onmouseout,Myonmouseout); | |
d.onclick=AddHandler(d.onclick,Myonclick);d.onkeydown=AddHandler(d.onkeydown,Myonkeydown);})() |