Skip to content

Instantly share code, notes, and snippets.

View lukewpatterson's full-sized avatar

Luke Patterson lukewpatterson

View GitHub Profile
import groovy.json.JsonSlurper
import org.sonatype.nexus.repository.storage.Asset
import org.sonatype.nexus.repository.storage.StorageFacet
def DOCKER_REPOSITORY_NAME = 'docker-hosted'
def dockerRepository = repository.repositoryManager.get(DOCKER_REPOSITORY_NAME)
def dockerBlobStore = blobStore.blobStoreManager.get(dockerRepository.configuration.attributes.storage.blobStoreName)
def storageTx = dockerRepository.facet(StorageFacet.class).txSupplier().get()
try {
@lukewpatterson
lukewpatterson / gist:4242707
Created December 9, 2012 00:24
squeezing private SSH key into .travis.yml file
Tricks to add encrypted private SSH key to .travis.yml file
To encrypt the private SSH key into the "-secure: xxxxx....." lines to place in the .travis.yml file, generate a deploy key then run: (to see what the encrypted data looks like, see an example here: https://github.com/veewee-community/veewee-push/blob/486102e6f508214b04414074c921475e5943f682/.travis.yml#L21
base64 --wrap=0 ~/.ssh/id_rsa > ~/.ssh/id_rsa_base64
ENCRYPTION_FILTER="echo \$(echo \"-\")\$(travis encrypt veewee-community/veewee-push \"\$FILE='\`cat $FILE\`'\" | grep secure:)"
split --bytes=100 --numeric-suffixes --suffix-length=2 --filter="$ENCRYPTION_FILTER" ~/.ssh/id_rsa_base64 id_rsa_
@lukewpatterson
lukewpatterson / VirtualBox C++ Code
Created December 4, 2012 21:48
VirtualBox Code
bool UIMessageCenter::warnAboutVirtNotEnabled64BitsGuest(bool fHWVirtExSupported)
{
...
else
return messageOkCancel(mainWindowShown(), Error,
tr("<p>VT-x/AMD-V hardware acceleration is not available on your system. "
"Your 64-bit guest will fail to detect a 64-bit CPU and will "
"not be able to boot."),
0 /* pcszAutoConfirmId */,
tr("Close VM"), tr("Continue"));
@lukewpatterson
lukewpatterson / gist:6491377
Last active January 27, 2016 08:19
db2 in docker
FROM base
RUN echo "deb http://archive.canonical.com/ubuntu precise partner" >> /etc/apt/sources.list
RUN echo "deb-src http://archive.canonical.com/ubuntu precise partner" >> /etc/apt/sources.list
RUN echo "deb http://archive.ubuntu.com/ubuntu precise universe" >> /etc/apt/sources.list
RUN echo "deb-src http://archive.ubuntu.com/ubuntu precise universe" >> /etc/apt/sources.list
RUN apt-get update
RUN apt-get --yes install ksh
package com.keyholesoftware.blog;
public class App
{
public static void main( String[] args )
{
System.out.println( "Hello World!" );
}
}
@lukewpatterson
lukewpatterson / gist:4282391
Created December 14, 2012 03:09
google drive notes
https://developers.google.com/drive/service-accounts#use_regular_google_accounts_as_application-owned_accounts
https://developers.google.com/drive/scopes#google_drive_scopes
https://developers.google.com/drive/v2/reference/
https://developers.google.com/drive/v2/reference/files/copy
https://developers.google.com/oauthplayground/
@lukewpatterson
lukewpatterson / gist:4253996
Created December 10, 2012 22:39
downloads deploy notes
curl -u veeweebot -d '{"scopes": ["public_repo"], "note": "token link text", "note_url": "http://www.butterball.com/"}' https://api.github.com/authorizations
@lukewpatterson
lukewpatterson / shell dump
Created December 4, 2012 22:37
Timeout fail
Starting a webserver :7122
Serving file /home/travis/builds/veewee-community/travis-veewee-up/definitions/mybox/preseed.cfg
Waiting for ssh login on 127.0.0.1 with user vagrant to sshd on port => 7222 to work, timeout=10000 sec
..............................................................................................................................................................................................................
Executing your script (veewee vbox build 'mybox' --auto --debug --nogui)
took longer than 25 minutes and was terminated.
@lukewpatterson
lukewpatterson / .travis.yml
Created December 4, 2012 21:34
First attempt at local build
language: ruby
rvm:
- "1.9.3"
install:
- sudo echo "deb http://download.virtualbox.org/virtualbox/debian precise contrib" | sudo tee -a /etc/apt/sources.list
- wget http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add -
- sudo apt-get update
- sudo apt-get -y install linux-headers-$(uname -r)
- sudo apt-get -y install virtualbox-4.2
- VBoxManage -v
@lukewpatterson
lukewpatterson / log output
Created December 4, 2012 21:22
Builds kept timing out
Starting a webserver :7122
Executing your script (veewee vbox build 'mybox' --auto --debug --nogui)
took longer than 25 minutes and was terminated.
For more information about the test timeouts please checkout the section
Build Timeouts at http://about.travis-ci.org/docs/user/build-configuration/.
Done. Build script exited with: 1