Skip to content

Instantly share code, notes, and snippets.

View sammcj's full-sized avatar
🦃

Sam sammcj

🦃
View GitHub Profile
$ mco federation trace dev1-0.choria
Received response from dev1-0.choria in 24ms
Reported Route:
client.choria
nats1.fed
nats3.fed
fb builder:1
nats2.choria
nats1.choria
@sammcj
sammcj / fuckihatexml.sh
Last active July 13, 2016 10:00
/etc/libvirt/qemu/windowsvm.xml and friends
#
~ # lsmod|grep vf
vfio_pci 40960 0
vfio_iommu_type1 20480 0
vfio_virqfd 16384 1 vfio_pci
vfio 28672 2 vfio_iommu_type1,vfio_pci
irqbypass 16384 2 kvm,vfio_pci
~ # virsh nodedev-dumpxml pci_0000_01_00_0
<device>
@sammcj
sammcj / high_rated_netflix.txt
Created June 26, 2016 08:01
Sam's 4-5 star rated netflix films and shows as of 26/6/2016
Sam's 4-5 star rated netflix films and shows as of 26/6/2016
https://www.netflix.com/title/80043049
https://www.netflix.com/title/70279935
https://www.netflix.com/title/70039645
https://www.netflix.com/title/80106124
https://www.netflix.com/title/70267241
https://www.netflix.com/title/80104329
https://www.netflix.com/title/631281
https://www.netflix.com/title/18002692
@sammcj
sammcj / npm_ughhhhh.txt
Created June 15, 2016 06:34
npm kernel crashes
Jun 08 14:52:06 s1-b12 kernel: ------------[ cut here ]------------
Jun 08 14:52:06 s1-b12 kernel: WARNING: CPU: 19 PID: 5566 at fs/btrfs/inode.c:9258 btrfs_destroy_inode+0x227/0x2a0 [btrfs]
Jun 08 14:52:06 s1-b12 kernel: Modules linked in: fuse ufs hfsplus hfs vfat msdos fat veth ipt_MASQUERADE nf_nat_masquerade_ipv4 iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 xt_addrtype iptable_filter xt_conntrack nf_nat nf_conntrack binfmt_misc mptctl mptbase rpcrdma sunrpc ib_isert iscsi_target_mod ib_i
Jun 08 14:52:06 s1-b12 kernel: 8250_fintek scsi_transport_iscsi edac_core ipmi_msghandler acpi_power_meter shpchp pcc_cpufreq acpi_cpufreq ip_tables ext4 jbd2 mbcache sd_mod mgag200 i2c_algo_bit drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops ttm drm crc32c_intel serio_raw hpsa scsi_transport_sas be2net
Jun 08 14:52:06 s1-b12 kernel: CPU: 19 PID: 5566 Comm: npm Tainted: G W I 4.6.0-1.el7.elrepo.x86_64 #1
Jun 08 14:52:06 s1-b12 kernel: Hardware name: HP ProLiant BL460c G7, BIOS I27 08/
@sammcj
sammcj / xenserver_ext3_to_ext4.sh
Created May 26, 2016 05:12
Upgrade XenServer 7.0 to a supported filesystem
#!/bin/bash
# File managed by puppet
# Sam McLeod 2016
# Converts ext3 filesystems to ext4 in XenServer 7.0
# Since every XenServer 7.0 install is identical we don't need variables here
# Mount ext3 as ext4 on boot, note we're not adding discard because the SSDs are behind HP RAID
sed -i 's/ext3/ext4/g' /etc/fstab
sed -i 's/ext4 defaults/ext4 defaults,noatime/g' /etc/fstab
```
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 4.5.0 Kernel Configuration
#
CONFIG_64BIT=y
CONFIG_X86_64=y
CONFIG_X86=y
CONFIG_INSTRUCTION_DECODER=y
CONFIG_PERF_EVENTS_INTEL_UNCORE=y
```
# lspci -t
-+-[0000:ff]-+-08.0
| +-08.2
| +-08.3
| +-09.0
| +-09.2
| +-09.3
| +-0b.0
| +-0b.1
@sammcj
sammcj / pg_change_schema_owner.sh
Created March 31, 2016 00:58 — forked from bspkrs/pg_change_schema_owner.sh
Changes the owner on all tables, sequences, views, and functions in a PostgreSQL database with support for identifiers with whitespace and non-public schemas.
#!/bin/bash -x
usage()
{
cat << EOF
usage: $0 options
This script sets ownership for all tables, sequences, views, and functions for a given schema.
Run this script as your postgres OS user.
# 10x 1TB SSD in RAID 10
md200 : active raid10 sdt1[9] sdo1[4] sdp1[5] sds1[8] sdr1[7] sdl1[1] sdq1[6] sdk1[0] sdn1[3] sdm1[2]
4883148800 blocks super 1.2 512K chunks 2 far-copies [10/10] [UUUUUUUUUU]
bitmap: 0/37 pages [0KB], 65536KB chunk
# 10x 1TB SSD in RAID 10
md100 : active raid10 sdd1[3] sdf1[5] sde1[4] sdc1[2] sdh1[7] sdi1[8] sdg1[6] sdj1[9] sda1[0] sdb1[1]
4883148800 blocks super 1.2 512K chunks 2 far-copies [10/10] [UUUUUUUUUU]
bitmap: 0/37 pages [0KB], 65536KB chunk
@sammcj
sammcj / carsbikes.txt
Last active June 2, 2021 23:06
Cars and Bikes
In a conversation where we're trying to remember our cars / bikes over the years, may as well make it a ghist...
- In rough order of ownership.
- Some cars missing (TODO)
# Age 14
1976 Datsun 100A F/2 (First car)
1976 Triumph TC 2
1974 Triumph TC 2
1991 BMW 325IS E30