Skip to content

Instantly share code, notes, and snippets.

@rtluckie
rtluckie / vim_build.md
Last active August 29, 2015 14:01
vim_build

Install vim with all options I have ever needed.

sudo yum install -y \
gcc \
make \
ncurses-devel \
lua \
lua-devel \

ruby \

@rtluckie
rtluckie / Python2.6.9
Last active August 29, 2015 14:02
Install Python CentOS, Fedora
# Install requirements
VERSION=2.6.9
VERSION_SHORT=2.6
mkdir /tmp/python-install
cd /tmp/python-install
wget https://www.python.org/ftp/python/${VERSION}/Python-${VERSION}.tar.xz
tar xf Python-${VERSION}.tar.xz
cd Python-${VERSION}
./configure --prefix=/usr/local --enable-unicode=ucs4 --enable-shared LDFLAGS="-Wl,-rpath /usr/local/lib"
sudo make && sudo make altinstall
@rtluckie
rtluckie / ssh-copy-id-bulk.sh
Created June 5, 2014 05:38
bulk copy ssh keys
for X in `cat hosts.txt`
do
sshpass -p 'PASSWORD' ssh-copy-id -i ~/.ssh/id_rsa USER@${X}
done
@rtluckie
rtluckie / deploy.sh
Created July 10, 2014 20:50
deploy artifact to artifactory
art_url="https://artifactory.company.com/artifactory"
user="user"
pass="password"
function upload {
local_file_path=$1
target_folder=$2
if [ ! -f "$local_file_path" ]; then
@rtluckie
rtluckie / test
Last active August 29, 2015 14:06
```python
from artifactory import ArtifactoryPath
path = ArtifactoryPath(
"http://repo.jfrog.org/artifactory/distributions/org/")
for p in path.glob("**/*.gz"):
print p
```
@rtluckie
rtluckie / osx
Last active August 29, 2015 14:10
VIM - Build from source
# tested on osx 10.10.1 (14B25)
mkdir ~/tmp
hg clone https://code.google.com/p/vim/ ~/tmp/vim
cd ~/tmp/vim
./configure \
--prefix=$HOME/.local \
--enable-fail-if-missing \
--with-features=huge \
--enable-multibyte \
@rtluckie
rtluckie / audiocheck.net_download.sh
Created April 23, 2015 17:25
Download all samples from audiocheck.net
BASE_DIR="audiocheck.net"
mkdir ${BASE_DIR} && cd ${BASE_DIR} && \
for PAGE in $(curl http://www.audiocheck.net/soundtestsaudiotesttones_index.php | grep .php | sed 's|.*a href="\.\/\(.*.php\).*|\1|g' | grep php$); do
DIRNAME=$(echo ${PAGE} | sed 's|[a-z0-9]*_\(.*\)\.php|\1|g')
echo "Downloading ${DIRNAME}"
mkdir $(pwd)/${DIRNAME}
for FILE in $(curl http://www.audiocheck.net/${PAGE} | grep download.php | sed 's|.*<A HREF="download.php?filename=\([^\"]*\).*|\1|g'); do
FILE_NAME=$(echo $FILE | sed 's|Audio/audiocheck.net_\(.*\)|\1|g')
DOWNLOAD_TARGET="http://www.audiocheck.net/download.php?filename=${FILE}"
DOWNLOAD_PATH=$(pwd)/${DIRNAME}/${FILE_NAME}
@rtluckie
rtluckie / stash_set_branch_perms.py
Created June 23, 2015 16:38
bulk set stash branch permssions
import json
import requests
import logging as log
perms = [
{
"matcher": {
"id": "refs/heads/**",
"displayId": "refs/heads/**",
"type": {
@rtluckie
rtluckie / get_hooks.py
Created June 25, 2015 16:26
restrict branch names
#!/usr/bin/env python
import sys
import os
import subprocess
import logging
import re
import getpass
logging.basicConfig(level=logging.DEBUG, format="%(levelname)s: %(message)s\n")
@rtluckie
rtluckie / dep_management.py
Created January 3, 2016 20:27
Initial attempt to check installed deps vs deps listed in requirements.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: sw=4:ts=4:expandtab
"""
Initial attempt to check installed deps vs deps listed in requirements.
"""
from __future__ import absolute_import
from __future__ import division