Skip to content

Instantly share code, notes, and snippets.

@smoser
smoser / bdmapping
Created February 3, 2011 15:11
bdmapping: utility for providing the correct block-device-mapping args for ebs instances on EC2
#!/bin/sh
Usage() {
cat <<EOF
${0##*/} [-c] instance-type
print ephemeral store block-device-mapping arguments for 'instance-type'
If '-c' given, also print "--instance-type <instance-type>"
examples:
@smoser
smoser / freenx-userdata
Created April 4, 2011 20:42
userdata script for setting up freenx-server on ubuntu ec2
#!/bin/sh
# us-east-1 ami-42916c2b canonical ebs/ubuntu-natty-daily-i386-desktop-20110327
# ec2-run-instances --instance-type t1.micro --user-data-file /home/smoser/t/nx-setup.ud ami-42916c2b
{
set -x
iusername="nxtest"
ipasswd="foo.bar-NX"
lp_auth="smoser" # auth the user '${lp_auth}' to 'ubuntu' with ssh-import-id
[ -z "${lp_auth}" ] || sudo -Hu ubuntu ssh-import-id ${lp_auth}
@smoser
smoser / notify-send-nox
Created April 7, 2011 16:38
send a message like notify-send without X
#!/bin/sh
# send a notify message without access to DISPLAY
# taken from src/notify-osd.xml in notify-osd and from example in gdbus(1)
# 'notify-send' requires 'DISPLAY' and access to other context
# this script does not
#
# **** UGH ****
# This depends on DBUS_SESSION_BUS_ADDRESS variable, which is still "per-session"
# so, in an environment where you have access to neither, you can't really do this.
#
@smoser
smoser / oneiric-to-cdimage
Created May 2, 2011 16:16
Add oneiric to cdimage
------------------------------------------------------------
revno: 1037
committer: Stephen Scott Moser <smoser@nectarine>
branch nick: cdimage
timestamp: Mon 2011-05-02 15:46:25 +0000
message:
add knowledge of 'oneiric', the 'Oneiric Ocelot'
diff:
=== modified file 'bin/make-web-indices'
--- bin/make-web-indices 2011-04-27 20:50:21 +0000
@smoser
smoser / x2go-vs-vnc.sh
Created May 17, 2011 20:21
x2go versus vnc
#!/bin/sh
# run ami-e945739d
# eu-west-1 ami-e945739d canonical ubuntu-natty-daily-i386-desktop-20110508
% sudo apt-add-repository ppa:x2go/ppa
% sudo apt-get update
% sudo apt-get install x2goserver tightvncserver unity-2d
% pass="foo.bar-123"
% mkdir skel/.vnc
% xsess=gnome-2d
% xsess=unity-2d # in /usr/share/xsessions/
@smoser
smoser / inscreen
Last active December 18, 2022 15:29
run a command in screen
#!/bin/sh
#
# upstream: git://gist.github.com/1019125.git
VERBOSITY=0
LOCK=""
CR="
"
error() { echo "$@" 1>&2; }
@smoser
smoser / late
Created June 17, 2011 16:52
example content for preseed_late
#!/bin/bash
#
# This file is executed via preseed_late with content like:
# d-i preseed/late_command string wget -O /target/root/late http://nelson/uquick/late; chroot /target /bin/bash /root/late
#
#
set > /root/late.environ
UMOUNT_PROC=false
UMOUNT_SYS=false
@smoser
smoser / README.md
Last active October 12, 2020 17:14
ubuntu-auto-install: install a ubuntu image with kvm

Ubuntu Auto Install

This allows user to do automated installation of ubuntu. Provided here a a few different files/scripts for making this easier.

I've used this to verify that d-i kernel and initramfs from -proposed work as shown in bug 1511497.

The provided 'preseed' below can be used as a fully automated installation of ubuntu. Boot with qemu like:

note python web server is useful for this (python -m SimpleHTTPServer 9999)

@smoser
smoser / ubuntu-ami
Created July 22, 2011 21:22
get the right ubuntu ami
#!/bin/sh
VERBOSITY=0
TEMP_D=""
NAME="ubuntu-ami"
DOT_D="$HOME/.$NAME"
CACHE_D="$HOME/.cache/$NAME"
cachelife=86400
error() { echo "$@" 1>&2; }
@smoser
smoser / nova-lxc-oneiric-userdata
Created August 25, 2011 03:03
nova and lxc on ubuntu oneiric
#!/bin/sh
{
## EDIT THESE DETAILS FOR YOU ##
NONROOT_USER="ubuntu" # leave this as ubuntu if you're using cloud image
LP_USER="smoser" # change this to your launchpad id for ssh-import-id
SMOSER_PREFS=1 # do you want things setup like smoser likes?
EXTRA_PKGS="vim" # whatever extra packages you'd like installed
USEFUL_PKGS="bzr"
## END NECESSARY EDITING