This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Ansible role test shim. | |
# | |
# Usage: [OPTIONS] ./tests/test.sh | |
# - distro: a supported Docker distro version (default = "centos7") | |
# - playbook: a playbook in the tests directory (default = "test.yml") | |
# - role_dir: the directory where the role exists (default = $PWD) | |
# - cleanup: whether to remove the Docker container (default = true) | |
# - container_id: the --name to set for the container (default = timestamp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections; | |
public class SingletonBase<T> where T : SingletonBase<T>{ | |
} | |
public class MyChildSingletonA : SingletonBase<MyChildSingletonA> { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from android import Android | |
droid = Android() | |
def launch_script(path, terminal=False): | |
terminal = 'FORE' if terminal else 'BACK' | |
activity = 'com.googlecode.android_scripting.action.LAUNCH_{0}GROUND_SCRIPT'.format(terminal) | |
extras = {'com.googlecode.android_scripting.extra.SCRIPT_PATH': path} | |
packagename = 'com.googlecode.android_scripting' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Vagrant commands | |
vagrant reload #! | |
vagrant status | |
vagrant suspend | |
vagrant resume | |
vagrant halt | |
vagrant up | |
vagrant package | |
vagrant destroy | |
vagrant box add <nombre> <url> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Argument = -h -v -i groupId:artifactId:version -c classifier -p packaging -r repository | |
#shopt -o -s xtrace | |
# Define Nexus Configuration | |
NEXUS_BASE=http://repository.example.com:8081/nexus | |
REST_PATH=/service/local | |
ART_REDIR=/artifact/maven/redirect |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.log4j.Logger; | |
import org.eclipse.core.resources.IProject; | |
import org.eclipse.emf.ecore.resource.ResourceSet; | |
import org.eclipse.jdt.core.IJavaProject; | |
import org.eclipse.jdt.core.JavaCore; | |
import org.eclipse.xtext.resource.XtextResourceSet; | |
import org.eclipse.xtext.ui.resource.IResourceSetProvider; | |
import org.eclipse.xtext.ui.resource.XtextResourceSetProvider; | |
import org.eclipse.xtext.ui.util.JdtClasspathUriResolver; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
EXTNAME := extension | |
KEYFILE := $(EXTNAME).pem | |
CRXFILE := $(EXTNAME).crx | |
EXTDIR := $(EXTNAME) | |
SHELL := /usr/bin/env bash | |
CHROME := open /Applications/Google\ Chrome.app -n --args | |
CWD := $(shell pwd) | |
SIZE := $(shell wc -c <$(CRXFILE) | tr -d ' ') | |
VERSION := $(shell python -c "import json,sys;print json.loads(sys.stdin.read()).get('version','')" < $(EXTDIR)/manifest.json) | |
ZIPFILE := $(EXTNAME)-$(VERSION).crx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Do elasticsearch optimize on logstash previous day index | |
# if $1 = all then optimize all indicies | |
esindex="/opt/elasticsearch/data/elasticsearch/nodes/0/indices" | |
# Grab yesterday's values | |
D=`date +%d -d yesterday` | |
M=`date +%m -d yesterday` | |
Y=`date +%Y -d yesterday` |