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 | |
# load resources | |
xrdb -merge .Xresources | |
#xsetroot -solid '#222'& | |
# map caps lock as extra escape | |
xmodmap -e 'clear Lock' -e 'keycode 0x42 = Escape'& | |
# start clipboard manager | |
parcellite& |
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
import serial | |
import time | |
sr = serial.Serial('/dev/ttyACM0', 9600) | |
data = '' | |
while(True): | |
data += sr.read(1) | |
if (data[-1:] == '\n'): |
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
import select | |
import socket | |
import os | |
serv = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
serv.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) | |
serv.bind(('', 9090)) | |
serv.listen(1) | |
sockets = [serv] |
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
unsigned int nonFloatingWindows = 0; | |
using lbPair = std::pair<const long unsigned int, | |
std::unique_ptr<IWindow>>; | |
// couting only non-floating windows to calcule the areas | |
// for tiling them. | |
std::for_each( | |
_desktops[_currentDesktop].begin(), | |
_desktops[_currentDesktop].end(), |
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
from pykickstart.parser import * | |
from pykickstart.version import makeVersion | |
import blivet | |
# parse kickstart | |
ksparser = KickstartParser(makeVersion()) | |
ksparser.readKickstart("test.ks") | |
# create blivet object | |
b = blivet.Blivet(ksparser.handler) |
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
>>> sda = b.devicetree.getDeviceByName("sda") | |
>>> new_part = b.newPartition(size=Size("10GiB"), parents=[sda]) | |
>>> b.createDevice(new_part) | |
>>> blivet.partitioning.doPartitioning(b) | |
Traceback (most recent call last): | |
File "<stdin>", line 1, in <module> | |
File "/usr/lib/python2.7/site-packages/blivet/partitioning.py", line 889, in doPartitioning | |
allocatePartitions(storage, disks, partitions, free) | |
File "/usr/lib/python2.7/site-packages/blivet/partitioning.py", line 1006, in allocatePartitions | |
disklabel = disklabels[_disk.path] |
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
// http://svn.python.org/view/python/trunk/Include/object.h | |
#define PyObject_HEAD \ | |
_PyObject_HEAD_EXTRA \ | |
Py_ssize_t ob_refcnt; \ | |
struct _typeobject *ob_type; | |
#define PyObject_VAR_HEAD \ | |
PyObject_HEAD \ | |
Py_ssize_t ob_size; /* Number of items in variable part */ |
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
--- | |
src/conf/domain_addr.c | 13 ++----------- | |
1 file changed, 2 insertions(+), 11 deletions(-) | |
diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c |
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
[root@localhost ~]# ls /dev/sd* | |
/dev/sda /dev/sda1 /dev/sda2 /dev/sdb | |
[root@localhost ~]# fdisk /dev/sdb | |
Welcome to fdisk (util-linux 2.27). | |
Changes will remain in memory only, until you decide to write them. | |
Be careful before using the write command. | |
Command (m for help): n |
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
def listen1(self): | |
self._console.eventAddCallback(libvirt.VIR_STREAM_EVENT_READABLE, | |
self._send_to_client, | |
None) | |
def libvirt_event_loop(): | |
while True: | |
libvirt.virEventRunDefaultImpl() |
OlderNewer