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

Keybase proof

I hereby claim:

  • I am svx on github.
  • I am svx (https://keybase.io/svx) on keybase.
  • I have a public key whose fingerprint is 53F2 CC11 8D44 E709 63D6 9854 2BCE 315C 7C6B AE3F

To claim this, I am signing this object:

@svx
svx / sublime-rst-builder
Created November 6, 2014 13:27
sublime-builder for RST
About
=====
This is a custom sublime-builder for setting up restview [https://pypi.python.org/pypi/restview] as RST viewer.
Dependencies
------------
- restview
Install
@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 / gist:0f0b88ac2da4aaa38098
Created July 14, 2015 09:19
PlonePAS MemberDataTool
from App.class_init import InitializeClass
from Acquisition import aq_base
from AccessControl import ClassSecurityInfo
from zope.interface import implements
from Products.BTreeFolder2.BTreeFolder2 import BTreeFolder2
from Products.CMFCore.permissions import ManagePortal
from Products.CMFCore.utils import getToolByName
from Products.CMFCore.MemberDataTool import MemberData as BaseMemberData