Skip to content

Instantly share code, notes, and snippets.

View novel's full-sized avatar

Roman Bogorodskiy novel

View GitHub Profile
/usr/sbin/bhyve -c 1 -m 214 -A -I -H -P -s 0:0,hostbridge -s 4:0,virtio-net,tap0,mac=52:54:00:e7:0f:14 -s 5:0,virtio-net,tap1,mac=52:54:00:cf:1a:91 -s 1:0,ahci-hd,/home/novel/bhyve_freebsd.img -s 2:0,ahci-hd,/home/novel/test.img -s 3:0,virtio-blk,/home/novel/test.img -s 31,lpc -l com1,/dev/nmdm0A bhyve-mutli
@novel
novel / xenfreebsd.xml
Last active August 29, 2015 14:22
Linux HVM guest
<domain type='xen'>
<name>xentest</name>
<uuid>4dea22b31d52d8f32516782e98ab3fa0</uuid>
<os>
<type>hvm</type>
<loader>/usr/local/lib/xen/boot/hvmloader</loader>
<boot dev='hd'/>
</os>
<memory>524288</memory>
<vcpu>1</vcpu>
def test_that_stuff_blah(self):
request = HttpRequest()
request.path = "bebe/1/action"
request.method = "GET"
response = imported_view(request)
assert_equal(response.status_code, 200)
assert_true("something important" in response.content)
# foo mock
self.foomock = type('Foo', (), {})
self.foomock.get_release_numbers = lambda boo: ["STABLE", "LATEST"]
self.foomock.magic = lambda boo, arg1, arg2: (31337, -2)
def test_that_stuff_blah(self):
request = HttpRequest()
request.path = "bebe/1/action"
request.method = "GET"
imported.view_func.func_globals["foo"] = self.foomock()
imported.view_func.func_globals["remote_service_request"] = \
lambda path, getargs, postargs: "hehehe"
response = imported_view(request)
(20:45) novel@underworld:~ %> gpart show ad0s2
=> 0 213953670 ad0s2 BSD (102G)
0 524288 1 freebsd-ufs (256M)
524288 4142736 2 freebsd-ufs (2.0G)
4667024 524288 4 freebsd-ufs (256M)
5191312 524288 5 freebsd-ufs (256M)
5715600 208238070 6 freebsd-ufs (99G)
(20:45) novel@underworld:~ %> sudo gpart modify -i2 -t freebsd-swap ad0s2
ad0s2b modified
from distutils.command.install import install
...
class lc_install(install):
def run(self):
install.run(self)
man_dir = os.path.abspath("./man/")
(10:50) novel@fsol:~ %> lc-locations-list
1 US-West-1 US
2 US-East-1 US
(10:50) novel@fsol:~ %> lc-image-list -l 2|grep -i centos
image CentOS 5.3 (32-bit) w/ None (id = 1531)
image CentOS 5.3 (64-bit) w/ None (id = 1532)
(10:50) novel@fsol:~ %> lc-node-add -i 1531 -n myeastnode -s "1GB" -l 2
<Node: uuid=25351b0e79c48c5098670c013ee534e97fa52b0a, name=myeastnode, state=0, public_ip=[u'fake'], provider=GoGrid ...>
(10:56) novel@fsol:~ %>
#!/usr/bin/env python
from libcloud.types import Provider
from libcloud.providers import get_driver
GG_ACCESS_ID = ""
GG_SECRET = ""
if __name__ == "__main__":
Driver = get_driver(Provider.GOGRID)
#!/usr/bin/env python
import libcloud.providers
import libcloud.types
from secret import USERNAME, PASSWORD
class Example(object):
def __init__(self):