- data = self.compressor.compress(chunk)
- CNONE: Allocate new string of size len(chunk) + 2, copy two type bytes, copy len(chunk) into it, point data at result.
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 | |
# Suppose you export a dataset via Samba, then Samba will do df(1), which will only | |
# show the space used by the dataset of the shared directory. If you have datasets nestled | |
# within, then the space used by them will not show up in the overall share space usage: | |
# | |
# /mnt/tank/ -- using X TB from the pool | |
# /mnt/tank/dataset1 -- using Y TB from the pool | |
# /mnt/tank/dataset2 -- using Z TB from the pool | |
# |
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 time | |
from PyQt5.QtCore import QThread | |
class Worker(QThread): | |
def __init__(self): | |
QThread.__init__(self) | |
self.counter = 0 |
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 PySide2 import QtWidgets, QtCore | |
class MyTableView(QtWidgets.QTableView): | |
SECTION_SIZE = 70 | |
def __init__(self, parent=None): | |
super(MyTableView, self).__init__(parent) | |
def setModel(self, mdl): | |
super().setModel(mdl) |
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
#!/usr/bin/env python | |
# coding: utf-8 | |
# Copyright (C) PyZMQ Developers | |
# Distributed under the terms of the Modified BSD License. | |
# | |
# Some original test code Copyright (c) 2007-2010 iMatix Corporation, | |
# Used under LGPLv3 | |
import argparse |
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
#include <msgpack.h> | |
// 2**32 - 1025 | |
#define _MAX_VALUE ( (uint32_t) 4294966271 ) | |
#define MIN(x, y) ((x) < (y) ? (x): (y)) | |
typedef struct { | |
HashIndex *chunks; | |
//msgpack_sbuffer sbuf; |
I use KDE in dom0, it looks much better than XFCE and is imho much easier to use (type-ahead search in the start menu for starters). Also, contrary to XFCE, which is based on Gtk2, even the relatively old version shipped in dom0 has decent Hi-DPI support, as opposed to none at all in XFCE. The best gtk2 can do is scale in 100 % (!) steps.
Hi-DPI is still a bit cumbersome, especially if you switch between lo DPI and hi DPI (eg. builtin screen and external screen).
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
static int | |
flags_from_portable(int pflags) | |
{ | |
int flags = 0; | |
if ((pflags & SSH2_FXF_READ) && | |
(pflags & SSH2_FXF_WRITE)) { | |
flags = O_RDWR; | |
} else if (pflags & SSH2_FXF_READ) { | |
flags = O_RDONLY; |
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
#include <string.h> | |
#include <stdint.h> | |
#include <openssl/evp.h> | |
uint8_t data[] = { | |
0x4c, 0x61, 0x64, 0x69, 0x65, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x47, 0x65, 0x6e, 0x74, 0x6c, | |
0x65, 0x6d, 0x65, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6c, 0x61, 0x73, | |
0x73, 0x20, 0x6f, 0x66, 0x20, 0x27, 0x39, 0x39, 0x3a, 0x20, 0x49, 0x66, 0x20, 0x49, 0x20, 0x63, | |
0x6f, 0x75, 0x6c, 0x64, 0x20, 0x6f, 0x66, 0x66, 0x65, 0x72, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x6f, | |
0x6e, 0x6c, 0x79, 0x20, 0x6f, 0x6e, 0x65, 0x20, 0x74, 0x69, 0x70, 0x20, 0x66, 0x6f, 0x72, 0x20, |
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
""" | |
show-odd-cache.py | |
----------------- | |
Usage: | |
python show-odd-cache.py <repository> [<column to sort on>] [<number of entries to show>] | |
Prints a list of the twenty cache entries with the highest reference count. | |
This makes certain kinds of cache corruption (by bad drives, RAM etc) easy. |
NewerOlder