Skip to content

Instantly share code, notes, and snippets.

@iammattcoleman
iammattcoleman / Luminous, Proxmox 4.4
Last active October 27, 2017 20:05
Ceph issues during Proxmox 4.4 -> 5 upgrade
root@mdc-ceph-3:~# mount | grep ceph
/dev/sdd1 on /var/lib/ceph/osd/ceph-7 type xfs (rw,noatime,attr2,inode64,noquota)
/dev/sdc1 on /var/lib/ceph/osd/ceph-6 type xfs (rw,noatime,attr2,inode64,noquota)
/dev/sda1 on /var/lib/ceph/osd/ceph-8 type xfs (rw,noatime,attr2,inode64,noquota)
root@mdc-ceph-3:~# blkid -o udev /dev/sda1
ID_FS_UUID=01256762-e0ed-4eb6-945e-89e5f1c223f0
ID_FS_UUID_ENC=01256762-e0ed-4eb6-945e-89e5f1c223f0
ID_FS_TYPE=xfs
ID_FS_PARTLABEL=ceph data
ID_FS_PARTUUID=503fa6f8-4853-46c9-b0ed-986a34c1b3fc
@iammattcoleman
iammattcoleman / checkPackagesNeedingRetrigger.php
Last active February 23, 2018 17:42
Check if retriggers are needed for packages listed on the 'excuses...' page
<?php
declare(strict_types=1);
if (!isset($argv[1])) {
echo 'USAGE: ', $argv[0], ' [package name]', PHP_EOL;
exit(1);
}
$packageName = $argv[1];
$excusesUrl = 'http://people.canonical.com/~ubuntu-archive/proposed-migration/update_excuses.html';
# targetcli <<EOF && rm /tmp/test1.img
> ls
> /backstores/fileio create test1 /tmp/test1.img 10M
> /iscsi create iqn.2020-04.com.datto.test1
> /iscsi/iqn.2020-04.com.datto.test1/tpg1/luns create /backstores/file
io/test1
> /loopback create naa.50014051ba74ae76
> /loopback/naa.50014051ba74ae76/luns create /backstores/fileio/test1
> /vhost create naa.5001405ef6e5af1a
> /vhost/naa.5001405ef6e5af1a/tpg1/luns create /backstores/fileio/test
@iammattcoleman
iammattcoleman / 1_allLinesUnder80Characters
Last active September 22, 2020 17:30
RFC: libvirt coding style
virBufferAddLit(&query, CIM_DATAFILE_WQL_SELECT
"WHERE "
"Name='c:\\\\windows\\\\system32\\\\vmms.exe'");
@iammattcoleman
iammattcoleman / take1
Last active September 29, 2020 00:22
virBuffer/char* memory leaks?
for (i = 0; i < maxinfo; i++) {
...
/* Attribute Name format : <domain_name>:Hv VP <vCPU_number> */
// TODO: this needs SQL injection protection
virBufferAsprintf(&query,
WIN32_PERFRAWDATA_HVSTATS_HYPERVHYPERVISORVIRTUALPROCESSOR_WQL_SELECT
"WHERE Name = \"%s:Hv VP %d\"",
domain->name, i);