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
smoser / README.md
Created Jun 12, 2019
add ubuntu git as a remote to current git repo
View README.md

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
cronrun: run command with logging for crontab entries
View README.md

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
dyndns (dynamic dns) server and client
View README.md

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 Jun 5, 2019
megacli raid adapter and lvm tests
View README.md
@smoser
smoser / README.md
Created May 24, 2019
cirros debug and use
View README.md

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 Jun 2, 2019
repack ubuntu desktop iso with console output
View README.md

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 Apr 1, 2019
qemu to linux mapping of smbios / dmi information
View README.md

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[,...]
type -smbios field Linux path dmidecode --string=F
@smoser
smoser / README.md
Created Jan 25, 2019
NAT setup on ubuntu through vpn
View README.md

nat setup through vpn

The goal of this excersise was to connect a system to my desktop system and let it share the vpn.

systems

  • desktop: It has the following interfaces

    • wlp3s0: wireless managed by network manager connected to a wireless network.
    • tun0: a vpn device set up and managed by network manager
    • enp0s25: an unconnected wireless nic.
  • laptop: this system needed wanted to be on the vpn. It has the following interfaces:

@smoser
smoser / README.md
Last active Dec 10, 2018
backdoor-image
View README.md

backdoor-image

Description

backdoor-image can be used to easily add user with passwordless sudo access to a image or a root filesystem.

Operating on an image requires the 'mount-image-callback' tool from cloud-utils. That can be installed on ubuntu via apt-get install -qy cloud-image-utils.

@smoser
smoser / README.md
Last active Apr 2, 2019
fix lxc ZFS filesystem cannot destroy error.
View README.md

Fix LXD error when cannot destroy filesystem dataset busy

Sometimes lxd with zfs gets hosed in a way that:

$ lxc delete --force golden-piranha
Error: Failed to destroy ZFS filesystem: cannot destroy 'default/containers/golden-piranha': dataset is busy

The script lxcl-fix-filesystem-busy below helps to fix that.

You can’t perform that action at this time.