Skip to content

Instantly share code, notes, and snippets.

@smoser
smoser / README.md
Last active July 22, 2020 20:39
codimd-index create an index for codimd

codimd-index: maintain a global index for codimd pages.

We have a team codimd and it is wonderful. We have CMD_ALLOW_FREEURL=true so that users can create alias'd (named) pages.

Users can't see each others pages though, unless they know to look for them (codimd/#975).

This is just a "manually updated" script to generate a simple index page. It'd be wonderful if codimd/#103 was fixed, then we could generate a table and let user sort.

To run it, you need pyscopg2 (apt install python3-psycopg2).

Then:

@smoser
smoser / README.md
Created June 12, 2020 15:50
demo of yaml anchors and yaml-dump script.

yaml anchors demo

yaml anchors are:

  • useful
  • confusing
  • hard to google for

yaml can be quite hard to read and see if it is valid.

I use 'yaml-dump' script here to just load a file and dump it as json to more easily see what it loads as.

@smoser
smoser / README.md
Last active July 17, 2020 15:05
build-upstream-pkg build a package from upstream source

build-upstream-pkg

Usage: build-upstream-pkg [ options ] <<ARGUMENTS>>

   build-upstream-pkg <upstream-commitish> <packaging-commitish>

   options:
      --version  VERSION    make the upstream version VERSION
                            default is to use git-describe

--output DIR put created files in DIR

@smoser
smoser / README.md
Last active June 3, 2020 13:32
bash version of lxc-usernsexec

bash version of lxc-usernsexec

I was in need of something like lxc-usernsexec but ran into some issues lxc/#3420 using it (possibly user error). I put together a test case testing what I thought were valid invocations of lxc-usernsexec. That is here as test-usernsexec.

I looked at the implementation and came up with the bash version here ias 'usernsexec'. My version passes the test case.

My version doesn't get tty's for the executed command.

@smoser
smoser / README.md
Created May 18, 2020 15:19
ubuntu email setup through dreamhost relay with msmtp

usage of msmtp for email relay through dreamhost

I just needed the sendmail cli interface to work for things like bts or the occasional sending of an email.

msmtp seems like a good solution.

Heres what I did to get it functional

  • install mtsmtp-mta
@smoser
smoser / README.md
Last active December 1, 2020 21:59
rpm build in lxd
@smoser
smoser / README.md
Last active February 28, 2020 16:54
ssh-import-id Upstream and Ubuntu release process

ssh-import-id Release Process

Development

  • Bugs on launchpad: Bugs are done on launchpad. upstream, ubuntu package.
  • Version Control: Using Git on launchpad. ssh-import-id
  • Pull Requests / Merge Proposals: Use launchpad merge proposals to master first. Then release to ubuntu.
  • CI: I'm not sure what C-i is in place.

Upstream Release Process

To make a new ssh-import-id upstream release.

@smoser
smoser / README.md
Created February 12, 2020 20:00
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
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: