Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
#
# This script performs NOD virus database updates for clients listed in the file $clients
#
# Format $clients:
# -==== router_ip ====-
# client_ip
# client_ip
# client_ip
# -==== router_ip ====-
@hedgeven
hedgeven / annotate_exif_date.sh
Created December 9, 2013 08:57
Script for annotation of EXIF-date on photos
#!/bin/bash
[[ ! -z $1 ]] && [[ -d $1 ]] && input_dir=$1 || input_dir=`pwd`
file_mask="*.JPG"
font_name="DejaVu-Sans-Book" # see all available variants: convert -list font|grep Font
output_dir="output"
color=white
font_size=32
cd ${input_dir}
#!/usr/bin/env python3.3
# -*- coding: utf8 -*-
import requests
import re
import sys
from bs4 import BeautifulSoup
params = {
'TO_STATION_LIST': '901',
#!/usr/bin/env python2
import sys, os, shutil
import getopt
import urllib2
import base64
import socket
from urlparse import urlparse
#!/usr/bin/env python3.3
#
# hedgeven@linux.com, 2014
#
# Distributed under the MIT License.
# (See accompanying file LICENSE or copy at
# http://opensource.org/licenses/MIT)
#
#
# Script for downloading Aerostat podcasts (and maybe other podcasts)
@hedgeven
hedgeven / xmlparser.py
Last active August 29, 2015 14:01
simple xmlparser
#!/usr/bin/env python3
from urllib.request import urlopen
import xml.etree.ElementTree as ET
import os
import sys
import re
def help():
print("Usage: "+ __file__+ " TARGET..."+
"\nSimple script for parsing local and remote xml files")
#!/usr/bin/env python2
import re
import os
import sys
import time
import syslog
from socket import socket
WORK_DIR = '/var/cache/zabbix/mka2/'
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/*
* main.c
* Copyright (C) 2014 Vassiliy K <hedgeven@linux.com>
*
*
*/
#include <stdlib.h>
#include <stdio.h>
@hedgeven
hedgeven / clean_cache.php
Last active October 26, 2015 07:42
PHP script for recursive cleaning old files
<?php
function rrmdir($dir, $t) {
if (is_dir($dir)) {
$objects = scandir($dir);
foreach ($objects as $object) {
if ($object != "." && $object != "..") {
if (filetype($dir."/".$object) == "dir") {
rrmdir($dir."/".$object, $t);
} else {
#!/usr/bin/env python3
"""Generate aggregated network list from given file"""
import sys
from netaddr import IPSet, IPNetwork
def main(argv):
ipset = IPSet()
try: