Skip to content

Instantly share code, notes, and snippets.

View filipposc5's full-sized avatar

Filippos Chalvatzoglou filipposc5

View GitHub Profile
@filipposc5
filipposc5 / cxora.py
Last active December 30, 2015 23:59
cxOracle multithreaded test script
import time
import string
import sys
import traceback
from cxOracle import cx_Oracle
#from collections import Counter grr not available..
#from threading import Thread
import threading
#set smartindent
#set tabstop=4
@filipposc5
filipposc5 / pxe2 (sa-ks.cfg)
Last active December 31, 2015 22:59
ks.cfg for hp server automation core (opsware lab) - non production..
$ cat /pxe/2
# ks.cfg for cores by filippos !
install
text
network --bootproto dhcp
cdrom
lang en_US.UTF-8
keyboard us
zerombr
@filipposc5
filipposc5 / img.sh
Created March 18, 2014 01:48
image sharing..
#imagemagick
#image filename style: IMG_5619.JPG
for i in *.JPG ;do identify ${i} | perl -e 'while (<>) { my ($img, $h, $w) = (split /[x\ ]/, $_)[0,2,3]; print "$img -crop ${h}x${w}-" . int($h*0.01) . "-" . int($w*0.01) ." -resize \"99%\" s${img}\n" } ' | xargs convert ; done
@filipposc5
filipposc5 / pip-order.sh
Last active August 29, 2015 14:06
pip req ordering (1 level)
# from within virtualenv
len=0;ARRAY=(); for i in $(cat ~filippos/cfymisc/manager.reqs.txt) ; do len=$[$len +1]; p=${i/==*/}; pip show $p | grep -q '^Requires: $' && ARRAY=($i ${ARRAY[*]}) || ARRAY[$len]=$i ; done ; for i in ${ARRAY[*]}; do echo $i ; done
@filipposc5
filipposc5 / jinjat.py
Created November 7, 2014 17:56
Jinja template starting point
from jinja2 import Template
from sys import argv, exit
import shlex, subprocess
import json
import ast
def apply_template(file,values):
print "............"
print file
print values
@filipposc5
filipposc5 / build-python.sh
Last active August 29, 2015 14:11
Build python
#!/bin/bash
# build my python!
# bash ba.sh /tmp/build-agent/ http://storv11088:8008
# Config section
PYVER=2.7.6
# export https_proxy=http://h:p
# export http_proxy=http://h:p
@filipposc5
filipposc5 / guess-rh.sh
Created December 16, 2014 10:55
Guess redhat version
#!/bin/bash
rpm -q --queryformat '%{Release}' $(rpm -q --whatprovides /etc/redhat-release ) | cut -d. -f1
@filipposc5
filipposc5 / salt-shaker.sh
Created September 14, 2015 14:00
salt shaker in bash .. just kidding ..
cat ../logstash-formula/formula-requirements.txt | while read x ; do o1=$(echo $x | sed s/=.*$//g | sed 's/git@/https:\/\/codeload./' | sed 's/m:/m\//' | sed 's/.git$/\/zip\//'); o2=$(echo $x | sed s/.*==//g) ; wget -O a.zip $o1$o2 ; ls -l a.zip; unzip a.zip ; rm -f a.zip ; o3=$(echo $x | sed 's/.*\/\(.*\)\.git.*/\1/') ; echo $o3 ; mv ${o3}* $o3 ; done
@filipposc5
filipposc5 / dtrace-file.md
Created October 1, 2015 12:31
While troubleshooting crontab
classy:~ root# dtrace -n 'syscall::open*:entry /execname == "crontab"/ { printf("%s %s",execname,copyinstr(arg0)); }' 
dtrace: description 'syscall::open*:entry ' matched 4 probes
CPU     ID                    FUNCTION:NAME
  0    181                       open:entry crontab /dev/dtracehelper
  0    181                       open:entry crontab /tmp/crontab.TdnlWVWmE4
  2    967              open_nocancel:entry crontab /usr/share/locale/en_GB.UTF-8/LC_COLLATE
  2    967              open_nocancel:entry crontab /usr/share/locale/en_GB.UTF-8/LC_CTYPE
  2    967              open_nocancel:entry crontab /usr/share/locale/en_GB.UTF-8/LC_MONETARY
  2    967              open_nocancel:entry crontab /usr/share/locale/en_GB.UTF-8/LC_NUMERIC
@filipposc5
filipposc5 / git-crypt-delete
Last active October 12, 2015 14:48 — forked from ashb/git-crypt-delete
git-crypt-delete
#!/bin/bash
set -o pipefail
case "$1" in
--list|-l)
list_only=1
;;
--dry-run|-n)