Skip to content

Instantly share code, notes, and snippets.

View ssbarnea's full-sized avatar
🎄
Sticking packages under the pypi tree.....

Sorin Sbarnea ssbarnea

🎄
Sticking packages under the pypi tree.....
View GitHub Profile
@ssbarnea
ssbarnea / ansiterm.py
Created December 2, 2011 17:22
test-ansi
import sys, os
try:
if not (sys.stderr.isatty() and sys.stdout.isatty()):
raise ValueError('not a tty')
from ctypes import *
class COORD(Structure):
_fields_ = [("X", c_short), ("Y", c_short)]
@ssbarnea
ssbarnea / pycharm-auto-complete-test.py
Created December 16, 2011 13:51
pycharm-auto-complete-test.py
#!/usr/bin/env python
class MyClass():
def alpha(self):
pass
def beta(self):
pass
def getProxy(self):
"""This is description...
@ssbarnea
ssbarnea / jira
Created April 2, 2012 12:02
Improved /etc/init.d/jira script.
#!/bin/sh -e
# JIRA startup script
#chkconfig: 2345 80 05
#description: JIRA
# Define some variables
# Name of app ( JIRA, Confluence, etc )
APP=jira
# Name of the user to run as
@ssbarnea
ssbarnea / confluence-remote-directory.sql
Last active March 9, 2017 18:32
PostgreSQL script to remove a confluence, jira or crowd user directory from the database. Very helpful for those that do get errors while trying to remove it, like https://jira.atlassian.com/browse/CWD-4606
-- Function: remove_last_directory()
-- DROP FUNCTION remove_last_directory();
CREATE OR REPLACE FUNCTION remove_last_directory()
RETURNS integer AS
$BODY$/*
author: Sorin Sbarnea
version: 1.0
homepage: https://gist.github.com/2352885
@ssbarnea
ssbarnea / confluence-rename-users.sql
Created April 10, 2012 17:17
Confluence user renaming PostgreSQL stored procedure.
DECLARE vdir integer;
BEGIN
-- BEGIN;
-- ^not needed for stored procedure
CREATE TABLE IF NOT EXISTS usermigration
(
oldusername character varying(255) NOT NULL,
@ssbarnea
ssbarnea / wrapper.sh
Created April 18, 2012 06:23
Bash wrapper script that calls another exec and logs it’s execution output and return code
#!/bin/bash
# install:
# * rename the original script to script.original
# * rename the wrapper.sh to script
# * DONE! all calls are going to be logged now
TIMESTAMP=`date -u +"%Y-%m-%dT%H:%M:%SZ"`
ME=`basename $0`
WRAPPED_COMMAND=$ME.original
@ssbarnea
ssbarnea / config.xml
Created May 28, 2012 16:41
Jenlinks Log Parser Plugin Rules
<?xml version='1.0' encoding='UTF-8'?>
<hudson>
<disabledAdministrativeMonitors>
<string>OldData</string>
<string>jenkins.security.RekeySecretAdminMonitor</string>
</disabledAdministrativeMonitors>
<version>1.522</version>
<numExecutors>2</numExecutors>
<mode>EXCLUSIVE</mode>
<useSecurity>true</useSecurity>
@ssbarnea
ssbarnea / keytool-trust
Created July 23, 2012 15:03
keytool utility script to import SSL certificates in one single line (HTTPS, IMAPS, LDAPS, ...)
#!/bin/bash
REMHOST=$1
REMPORT=${2:-443}
KEYSTORE_PASS=changeit
KEYTOOL=keytool
# FYI: the default keystore is located in ~/.keystore
if [ -z "$REMHOST" ]
@ssbarnea
ssbarnea / jira-disabled-old-users.groovy
Created July 24, 2012 16:21
jira-disable-old-users
import com.atlassian.jira.ComponentManager
import com.atlassian.jira.bc.projectroles.ProjectRoleService
import com.atlassian.jira.security.GlobalPermissionManager
import com.atlassian.jira.security.Permissions
import com.atlassian.jira.security.roles.actor.UserRoleActorFactory
import com.atlassian.jira.user.util.UserUtil
import com.atlassian.jira.util.SimpleErrorCollection
import com.atlassian.crowd.embedded.api.Group
import com.atlassian.crowd.embedded.api.User
import com.atlassian.jira.user.util.UserManager
bash-3.2$ brew --config
HOMEBREW_VERSION: 0.9.2
HEAD: eddfda112cb1e961dc5cbd0c77e2fd6e20e1a8b8
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: 8-core 64-bit sandybridge
OS X: 10.8-x86_64
Xcode: 4.4.1
CLT: 4.4.0.0.1.1249367152
GCC-4.0: N/A