Skip to content

Instantly share code, notes, and snippets.

@smoser
smoser / README.md
Last active January 22, 2020 16:23
printer setup brother mfc9125-cn

Printer configuration / setup

This is to configure the 'Brother MFC-9125CN' for cups.

Installation

  • get deps (needs libc6-i386 if x86_64)

    sudo apt-get install --quiet --no-install-recommends --assume-yes libc6-i386 cups avahi-daemon
    
  • Install debs (needs force if this is x86_64)

@smoser
smoser / README.md
Last active November 5, 2019 21:42
script and log showing dreamhost slow loads over ipv4/http

slow cirros downloads over ipv4/http

Problem

download.cirros-cloud.net is currently experiencing extremely long load times over HTTP and ipv4.

Notes about the problem:

@smoser
smoser / README.md
Last active October 21, 2019 13:56
git-remote-add-centos: Add centos git repo for a package

git-remote-add-centos: Add centos remote for a package

This simply adds a remote to https://git.centos.org/ to an existing git repo.

Usage

Usage: git-remote-add-centos [options] [source] package

   Add remote repo for packagke on git.centos.org.
@smoser
smoser / README.md
Created June 12, 2019 17:53
add ubuntu git as a remote to current git repo

git-ubuntu is somewhat documented in ubuntu wiki here.

This script simply adds a git remote for a given package.

Then in the same git repo, you can have upstream and ubuntu package information easily with something like this:

$ git clone -o upstream https://git.launchpad.net/cloud-utils
$ cd cloud-utils
$ git remote-add-ubuntu -v cloud-utils

...

@smoser
smoser / README.md
Last active May 29, 2019 14:07
cronrun: run command with logging for crontab entries

cronrun : run command in cron

I often have errors where running a command from cron wasn't the same as running it from the command line. This is a small/silly attempt to remove those descrepencies and be able to just copy and paste what was in cron and expect that is the same.

I just put cronrun in /usr/local/bin and set it executable, and then set PATH in my crontab to include /usr/local/bin.

@smoser
smoser / README.md
Last active May 29, 2019 13:47
dyndns (dynamic dns) server and client

dyndns solution for dreamhost

This is a php service and shell client that interacts with Dreamhost's DNS API to update a dns record. I wouldn't suggest it is my best work, but it does work and has been working for me (per my logs from December of 2009 to May of 2019). So, it works.

There are probably other solutions at this point. At the point I wrote this there were not. Also, the 2-part solution here allows the service to determine the ip address of the client, so the client doesn't have to figure out its own

@smoser
smoser / README.md
Last active June 5, 2019 18:01
megacli raid adapter and lvm tests
@smoser
smoser / README.md
Created May 24, 2019 14:48
cirros debug and use

Cirros Debug and usage

Boot to initramfs only

Cirros has kernels and initramfs available for many arch. Sometimes you might just need to boot a kernel and look around, but not on a cloud.

It was intended that using 'dslist=none' on the kernel command line would do that, but a logic bug prevented it, you can still get this to work though with 0.4.0.

qemu-system-x86_64 -nographic -m 512 \
    -kernel cirros/kernel  -initrd cirros/initrd \
    -append "console=ttyS0 dslist=true rdroot"
@smoser
smoser / README.md
Last active May 12, 2020 14:36
repack ubuntu desktop iso with console output

repack ubuntu iso without graphical login.

This was useful for me to use remotely. Basically a live server image.

Basically run:

./fix-iso consolify -vv ubuntu-18.04.2.0-desktop-amd64.iso.dist ubuntu-18.04.2.0-desktop-amd64.iso

And then

qemu-system-x86_64 -enable-kvm -device virtio-scsi-pci,id=virtio-scsi-xkvm \

@smoser
smoser / README.md
Last active June 1, 2024 09:44
qemu to linux mapping of smbios / dmi information

Mappings for DMI/SMBIOS to Linux and dmidecode

Information can be put into dmi tables via some qemu-system hosts (x86_64 and aarch64). That information is exposed in Linux under /sys/class/dmi/id and can be read with dmidecode. The names are very annoyingly inconsistent. The point of this doc is to map them.

Mappings

Example qemu cmdline:

qemu-system-x86_64 -smbios type=<type>,field=value[,...]

qemu-system-x86_64 -smbios type=0,vendor=superco,version=1.2.3