Skip to content

Instantly share code, notes, and snippets.

View costash's full-sized avatar

Constantin Șerban-Rădoi costash

View GitHub Profile
<root>
<objects>
<type>links</type>
<id>ethernet</id>
<name>ethernet_12</name>
<source>switchOpenflow_3</source>
<destination>computer_2</destination>
<deviceSourcePort>2</deviceSourcePort>
<deviceDestinationPort>0</deviceDestinationPort>
<isMOtherTemplate>false</isMOtherTemplate>
@costash
costash / simple.json
Created February 25, 2014 18:00
Simple topology for mininet created with miniedit.
{
"application": {
"dpctl": "",
"ipBase": "10.0.0.0/8",
"netflow": {
"nflowAddId": "0",
"nflowTarget": "",
"nflowTimeout": "600"
},
"openFlowVersions": {
costash@ubuntu:~/workspace/research_licenta/test_scripts$ ./qemu_commands.sh
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Linux version 3.12.0 (costash@ubuntu) (gcc version 4.8.1 (Ubuntu/Linaro 4.8.1-10ubuntu9) ) #1 SMP PREEMPT Sun Mar 2 16:44:51 EET 2014
[ 0.000000] Command line: console=ttyS0 uts="host1" root=/dev/root rootflags=trans=virtio,version=9p2000.u ro rootfstype=9p
[ 0.000000] e820: BIOS-provided physical RAM map:
[ 0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable
[ 0.000000] BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] reserved
[ 0.000000] BIOS-e820: [mem 0x0000000000100000-0x000000001fffdfff] usable
[ 0.000000] BIOS-e820: [mem 0x000000001fffe000-0x000000001fffffff] reserved
@costash
costash / vm.json
Last active August 29, 2015 13:57
Simple description for Qemu VMs that should given at startup.
{
"object_type": "vm_startup",
"range_low": 1,
"range_high": 50,
"max_ram": "384m",
"base_name": "VM_test",
"kernel_image": {
"dir": "/path_to_kernel",
"image_name": "linux",
"init_params": {
@costash
costash / init_script.sh
Created March 10, 2014 18:56
Scripts to start up one VM. Connection to console can be made with "socat - /tmp/host1/vm-host1-mgmt-console.pipe"
#!/bin/bash
# This script is passed to kernel init when a Qemu VM starts up. It basically
# sets up things like hostname, mounts the home directory and others.
info() {
echo "^[[1;34m[+] ^[[0m $@"
}
info "Running init script"
costash@ubuntu:~/workspace/PW/tema1/pwtema1$ ruby -I. generate_homework.rb "SERBAN-RADOI I. Constantin" -t
Validating homework
Se verifica pagina index.html
1. [Verificare Existenta Pagina] Passed : Pagina este prezenta
2. [Verificare Titlul Pagina] Passed : Titlul este corect
3. [Verificare Existenta Meta Keywords] Passed : Tag-ul meta exista
4. [Verificare existenta attribut content pentru tagul meta] Passed : OK
5. [Verificare keyword XiDFxszicaqHbvueHgZX] Passed : OK
6. [Verificare keyword hPQNfWMdqZ] Passed : OK
7. [Verificare existenta div JwMugawUNk] Passed : OK
class VmHandler( object ):
"""A VmHandler provides primitives for handling a Qemu VM."""
def __init__( self, vmName='host', qemuBinary='qemu-system-x86_64',
ram='384m', rootPath='/', kernelDir='/tmp/install',
kernelImageName='linux', initScript='vm_init.sh', **kwargs ):
"""Create VMHandler object.
vmName: Name of the VM
qemuBinary: Binary used for running Qemu
ram: Amount of ram available for Qemu VM