Skip to content

Instantly share code, notes, and snippets.

@iserko
iserko / convert_repo.sh
Created January 28, 2011 12:26
Shell script for easily joining multiple GIT repositories into a single repository by rewriting the GIT history
#!/bin/bash
###########
# ./convert_repo.sh
# Author: Igor Serko <igor.serko@gmail.com>
# Description: Allows the user to join multiple git repositories under one single repository
# Procedure: Using git filter-branch we rewrite the history of every repo
# example of current tree
# -- REPOONE
# |-- repoone files
# -- REPOTWO
@iserko
iserko / redis_migrate.py
Last active June 1, 2022 19:18
A simple script to migrate all keys from one Redis to another
#!/usr/bin/env python
import argparse
import redis
def connect_redis(conn_dict):
conn = redis.StrictRedis(host=conn_dict['host'],
port=conn_dict['port'],
db=conn_dict['db'])
return conn
@iserko
iserko / gist:1218866
Created September 15, 2011 09:05
Croatian (Hrvatski) IBAN control number checker
#!/usr/bin/env python
"""
This script is primarily used to get the IBAN number for Croatian account numbers
"""
import os
import sys
def get_iso13616_numbers(chars):
out = ""
#!/bin/bash
# apt-get install jq
#set -eu
shopt -s nullglob
readonly base_dir=$1
if [ -z "$base_dir" ] ; then
echo 'please location docker registry store location!';
exit;
fi
@iserko
iserko / tcpconnect.py
Created December 3, 2014 21:53
simple TCP connect test script
#!/usr/bin/env python
import socket
import sys
import time
def run():
host = sys.argv[1]
port = int(sys.argv[2])
Example:
I run the stats query and get:
{
"indices": {
"example_index_name": {
"total": {
"search": {
"groups": {
@iserko
iserko / roh_parser.py
Created March 14, 2014 16:53
A cute little Royal Opera House website parser using Selenium
#!/usr/bin/env python
from email.mime.text import MIMEText
from pyvirtualdisplay.smartdisplay import SmartDisplay
from selenium import webdriver
import difflib
import os.path
import random
import smtplib
import time
@iserko
iserko / update_no_ip.py
Created February 19, 2014 00:02
A simple script that gets your current public IP and then updates the no-ip service
#!/usr/bin/env python
import argparse
import os.path
import requests
import sys
import ConfigParser
from datetime import datetime
IP_CACHE_FILE = "ipaddress.cache"
USER_AGENT = "no-ip Python Update Client/v1.0 igor.serko@gmail.com"