Skip to content

Instantly share code, notes, and snippets.

Scott Moser smoser

  • Cisco
  • US
Block or report user

Report or block smoser

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
smoser /
Created Feb 12, 2020
little endian / big endian things

little endian conversion

I was working on gpt package in go and I didn't realize that the author had handled conversion to little endian when writing header.

I was under the impression that I had to create the header with the little endian value.

For example, the Size of a standard header is 92 bytes.

smoser /
Last active Jan 22, 2020
printer setup brother mfc9125-cn

Printer configuration / setup

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


  • 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 /
Last active Nov 5, 2019
script and log showing dreamhost slow loads over ipv4/http

slow cirros downloads over ipv4/http

Problem is currently experiencing extremely long load times over HTTP and ipv4.

Notes about the problem:

smoser /
Last active Oct 21, 2019
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 to an existing git repo.


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

   Add remote repo for packagke on
smoser /
Created Jun 12, 2019
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
$ cd cloud-utils
$ git remote-add-ubuntu -v cloud-utils
smoser /
Last active May 29, 2019
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 /
Last active May 29, 2019
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 /
Last active Jun 5, 2019
megacli raid adapter and lvm tests
smoser /
Created May 24, 2019
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 /
Last active Jun 2, 2019
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- ubuntu-

And then

qemu-system-x86_64 -enable-kvm -device virtio-scsi-pci,id=virtio-scsi-xkvm \
You can’t perform that action at this time.