Skip to content

Instantly share code, notes, and snippets.

@svx
svx / readme
Created October 6, 2012 10:04
OpenVZ Gitlab template
This is a short readme on how to use the template. I'll create a detailed readme later, but for the moment I guess this should be fine.
Information
###########
Based on Debian 6.0.5 minimal AMD64
Gitlab 2.8 Stable
Additional packages: bash-completion, nano, fail2ban (preconfigured to block SSH hack attemps)
@svx
svx / pr.md
Created October 29, 2012 18:08 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@svx
svx / gist:4064432
Created November 13, 2012 07:08 — forked from miohtama/gist:4062655
Migrate several SVN projects to Github using a shell script
#!/bin/zsh
#
# Install svn2git https://github.com/nirvdrum/svn2git
# Install curl: sudo apt-get install curl
#
# Create API token Github on command line before running this script
#
# curl -u 'miohtama' -d '{"scopes":["repo"],"note":"migrate.sh"}' https://api.github.com/authorizations
#
# More info https://help.github.com/articles/creating-an-oauth-token-for-command-line-use
## Install necessary packages
$ sudo apt-get install virtualbox-ose qemu-utils genisoimage cloud-utils
## get kvm unloaded so virtualbox can load
$ sudo modprobe -r kvm_amd kvm_intel
$ sudo service virtualbox stop
$ sudo service virtualbox start
## URL to most recent cloud image of 12.04
$ img_url="http://cloud-images.ubuntu.com/server/releases/12.04/release"
### signal the start of configuration
- hosts: localhost
tasks:
- irc:
channel={{ irc_channel }} server={{ irc_server }} msg="Preparing to update the servers"
### configure each webserver
- hosts: webservers
@svx
svx / howto
Last active August 29, 2015 14:11 — forked from jensens/howto
1) use bootstrap.py from http://downloads.buildout.org/2/bootstrap.py
2) edit buildout.cfg and pin versions to:
[versions]
setuptools = 7.0
zc.buildout = 2.2.5
3) create a virtualenv as usal:
Basically, http://docs.plone.org/develop/addons/components/zcml.html#specify-files-and-code-from-another-package explains how to do it. But the example is not very clear, since in both cases the same packge is referenced. Therefore, a simple example:
Suppose you want to overwrite the folder_contents view in Plone. You only need to change some code in the class and you're happy with the template.
The view is defined in plone.app.content.browser with this zcml statement:
<browser:page
for="Products.CMFCore.interfaces._content.IFolderish"
class=".folder.FolderContentsView"
name="folder_contents"
@svx
svx / buildout.cfg
Last active August 29, 2015 14:25 — forked from datakurre/README.rst
Plone 5.0b3 (depends on buildout-nix in nixpkages unstable)
[buildout]
extends = http://dist.plone.org/release/5.0b3-pending/versions.cfg
parts = plone5
versions = versions
[instance]
recipe = plone.recipe.zope2instance
eggs = Plone
user = admin:admin
var = /tmp
@svx
svx / Ansible-Vault how-to.md
Created November 26, 2015 12:50 — forked from tristanfisher/Ansible-Vault how-to.md
A short tutorial on how to use Vault in your Ansible workflow. Ansible-vault allows you to more safely store sensitive information in a source code repository or on disk.

##Working with ansible-vault

I've been using a lot of Ansible lately and while almost everything has been great, finding a clean way to implement ansible-vault wasn't immediately apparent.

What I decided on was the following: put your secret information into a vars file, reference that vars file from your task, and encrypt the whole vars file using ansible-vault encrypt.

Let's use an example: You're writing an Ansible role and want to encrypt the spoiler for the movie Aliens.

@svx
svx / github-pandoc.css
Created April 6, 2016 11:41 — forked from dashed/github-pandoc.css
GitHub-like CSS for pandoc standalone HTML files (perfect for HTML5 output). Based on Marked.app's GitHub CSS. Added normalize.css (v2.1.3) in the prior to GitHub css.
/*! normalize.css v2.1.3 | MIT License | git.io/normalize */
/* ==========================================================================
HTML5 display definitions
========================================================================== */
/**
* Correct `block` display not defined in IE 8/9.
*/