Skip to content

Instantly share code, notes, and snippets.

@smoser
smoser / bdmapping
Created Feb 3, 2011
bdmapping: utility for providing the correct block-device-mapping args for ebs instances on EC2
View bdmapping
#!/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 Apr 4, 2011
userdata script for setting up freenx-server on ubuntu ec2
View freenx-userdata
#!/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 Apr 7, 2011
send a message like notify-send without X
View notify-send-nox
#!/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
Add oneiric to cdimage
View 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
View x2go-vs-vnc.sh
#!/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 Nov 6, 2019
run a command in screen
View inscreen
#!/bin/sh
#
# upstream: git://gist.github.com/1019125.git
VERBOSITY=0
LOCK=""
CR="
"
error() { echo "$@" 1>&2; }
@smoser
smoser / late
Created Jun 17, 2011
example content for preseed_late
View 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 Oct 12, 2020
ubuntu-auto-install: install a ubuntu image with kvm
View README.md

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 Jul 22, 2011
get the right ubuntu ami
View 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 Aug 25, 2011
nova and lxc on ubuntu oneiric
View nova-lxc-oneiric-userdata
#!/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