Skip to content

Instantly share code, notes, and snippets.

View iakovgan's full-sized avatar

Iakov Gan iakovgan

  • Ingencio
  • France
View GitHub Profile
@iakovgan
iakovgan / tomcat-mkdeb.sh
Created September 30, 2020 16:23 — forked from stuart-warren/tomcat-mkdeb.sh
Create deb of Tomcat installing into its own dir (to allow multiple versions) Uses fpm
#!/bin/bash -xe
#
# sudo gem install fpm
# sudo apt-get install curl
# # Put this script in a folder called tomcat-packaging
# ./mkdeb.sh 7.0.40
# ./mkdeb.sh 6.0.37
#
VERSION=$1
""" a small example for finding intervals
"""
from pprint import pprint
# Data are sorted already by user and date
data = [
[ 'user1', '2016/1', 1, 15 ],
[ 'user1', '2016/2', 1, 15 ],
[ 'user1', '2016/3', 1, 15 ],
[ 'user1', '2016/6', 1, 15 ],
[ 'user1', '2016/7', 1, 15 ],
@iakovgan
iakovgan / deco_class.py
Created October 5, 2015 15:23
deco_class.py
import wrapt
@wrapt.decorator
def pass_through(wrapped, instance, args, kwargs):
print instance.attr
return wrapped(*args, **kwargs)
class Class(object):
attr = "Hi"
'''
This module provides:
Thread class: Thread with terminate method. 7
based on this: http://stackoverflow.com/questions/323972/is-there-any-way-to-kill-a-thread-in-python/15274929#15274929
Exemples: see tests
'''
import threading
import ctypes
import time