Skip to content

Instantly share code, notes, and snippets.

View uniomni's full-sized avatar

Ole Nielsen uniomni

  • Geoscience Australia
  • Canberra
View GitHub Profile
@uniomni
uniomni / gist:892074
Created March 29, 2011 09:22
GIT survival
Move current work to branch
git stash
git checkout -b bname
git stash apply
git commit -a -m "XXXX"
git push origin bname
git branch -avv
@uniomni
uniomni / gist:886394
Created March 25, 2011 05:09
Create large bootable USB stick
Jaunty (9.04) onwards provide USB Startup Disk Creator system tool. It uses the usb-creator to create USB bootable startup disk on USB drive. You may also start the application from the terminal with :
gksudo usb-creator-gtk
Then choose the desired ubuntu .iso image, the usb device you want to use, erase the disk and set the degree of persistence (the slider) you need. Note that the maximum space that can be allocated for persistence is limited to 4GB (maximum file size on a FAT32 filesystem is 4GB). This limit can be overcome and is explained later on. If you do want a larger degree of persistence, set persistence to 128mb for now and continue. Hit Make Startup Disk and wait till it finishes. You are now in possession of a USB drive that can be used to run/install ubuntu on most computers. Persistence gives you the freedom to save changes, in the form of settings or files etc, during the live session and the changes are available the next time you boot via the usb drive.
To make the persistence larger (>
@uniomni
uniomni / gist:803722
Created January 31, 2011 06:42
Recovering from (no branch) condition in submodule
From: http://superuser.com/questions/116153/rescuing-files-and-commits-from-no-branch-in-git
$ cd submodule_dir
$ git reflog # Find the commit
$ git checkout master
# SHA_OF_MISSING_COMMIT
$ git cherry-pick 404c584
@uniomni
uniomni / gist:803721
Created January 31, 2011 06:41
GIT: Pull somerepo into mainrepo
nielso@shiva:~/sandpit/AIFDR/pyplugin$ git branch uniomni-master
nielso@shiva:~/sandpit/AIFDR/pyplugin$ git checkout uniomni-master
Switched to branch 'uniomni-master'
nielso@shiva:~/sandpit/AIFDR/pyplugin$ git pull https://[email protected]/uniomni/pyplugin.git master
Password:
From https://github.com/uniomni/pyplugin
* branch master -> FETCH_HEAD
Already up-to-date.
nielso@shiva:~/sandpit/AIFDR/pyplugin$ git checkout master
@uniomni
uniomni / gist:798173
Created January 27, 2011 06:48
Submodules example
Example: Including an existing repository as a submodule
git add [email protected]:uniomni/riab_server.git submodules/riab_server
# These seem to be only necessary after a fresh clone of the super project
cd submodules/riab_server
git submodule init
git submodule update
# Here's a great example going through submodules:
@uniomni
uniomni / gist:779194
Created January 14, 2011 04:56
Geoserver REST command examples

REST commands, generated by Risk-in-a-Box and known to work

Upload shapefile + associated style. Then activate style and make it default.

PUT -H "Content-type: application/zip" "http://localhost:8080/geoserver/rest/workspaces/exposure/datastores/AIBEP_schools/file.shp" --data-binary "@AIBEP_schools.zip"
POST -H "Content-type: text/xml" "http://localhost:8080/geoserver/rest/styles" --data-ascii "<style>AIBEP_schoolsAIBEP_schools.sld</style>"
PUT -H "Content-type: application/vnd.ogc.sld+xml" "http://localhost:8080/geoserver/rest/styles/AIBEP_schools" --data-binary "@AIBEP_schools.sld"
PUT -H "Content-type: text/xml" "http://localhost:8080/geoserver/rest/layers/AIBEP_schools" --data-ascii "AIBEP_schoolstrue"