Skip to content

Instantly share code, notes, and snippets.

View remove-orphan-images.sh
#!/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 Dec 3, 2014
simple TCP connect test script
View tcpconnect.py
#!/usr/bin/env python
import socket
import sys
import time
def run():
host = sys.argv[1]
port = int(sys.argv[2])
View gist:9963195
Example:
I run the stats query and get:
{
"indices": {
"example_index_name": {
"total": {
"search": {
"groups": {
@iserko
iserko / roh_parser.py
Created Mar 14, 2014
A cute little Royal Opera House website parser using Selenium
View roh_parser.py
#!/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 / redis_migrate.py
Last active Apr 18, 2019
A simple script to migrate all keys from one Redis to another
View redis_migrate.py
#!/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 / update_no_ip.py
Created Feb 19, 2014
A simple script that gets your current public IP and then updates the no-ip service
View update_no_ip.py
#!/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"
@iserko
iserko / gist:1218866
Created Sep 15, 2011
Croatian (Hrvatski) IBAN control number checker
View gist:1218866
#!/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 = ""
@iserko
iserko / convert_repo.sh
Created Jan 28, 2011
Shell script for easily joining multiple GIT repositories into a single repository by rewriting the GIT history
View convert_repo.sh
#!/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