Skip to content

Instantly share code, notes, and snippets.

View kkappel's full-sized avatar
🏠
Working from home

Klaus Kappel kkappel

🏠
Working from home
View GitHub Profile
@kkappel
kkappel / resize.sh
Created September 15, 2015 12:18
resize jpeg images in current folder with ImageMagick
#!/bin/sh
# resize jpeg images in current folder with ImageMagick
#
# (c) 2014 by Klaus Kappel
# directory where target files are located
TARGET=mini
# Size of target images: 1280x1024 or 1280 (x = horizontal size)
SIZE=1280
# Type (suffix) of Source Images: JPG, png, tif, etc.
@kkappel
kkappel / odf2html.sh
Last active June 5, 2019 23:18
export all LibreOffice or MS-Word files to html, uses OpenOffice or Libre Office and tidy
#!/bin/bash
# odf2html.sh - export all odt od doc files to html by shellscript
# Inspired by Marco Fioretti,
# who wrote this Article in 2012: http://www.techrepublic.com/blog/linux-and-open-source/how-to-convert-doc-and-odf-files-to-clean-and-lean-html/
# Klaus Kappel
CONFIG=tidy.conf
# first clean the dir, if script runs in cron job
# rm -rf $2
@kkappel
kkappel / jpeg2mp4.sh
Created September 15, 2015 12:10
create mpeg4 video out of a batch of jpeg files
#!/bin/sh
# create mpg video from jpegs
# Resolution: FullHD (1080i)
# Orientation: Portrait
#
# tested with Ubuntu 14.04
# dependencies: sudo apt-get install imagemagick avconv
# (c) 2015 by Klaus Kappel <kkappel@novalisa.net>
# use under conditions of the GPL2, see http://www.gnu.org
@kkappel
kkappel / mk-lslr.sh
Created September 15, 2015 12:08
Create and update Index file of filesystem like old ftp servers
#!/bin/sh
# Create an Index File like in old ftp servers
# use it for your external hd's to share content
# expl. Video or MP3 Collections
cd .
ls -lR -Ils-lR > ls-lR
cp -a ls-lR.gz ls-lR.old.gz
gzip -d ls-lR.old.gz
@kkappel
kkappel / web2py_env.py
Last active August 29, 2015 14:16 — forked from aabril/web2py_env.py
'''
this snippet is used to load a web2py with postgresql environment
you must install web2py (so gluon.*) from pyeggs : "pip install web2py"
it will read your db.py models from the same directory
'''
# web2py env
from gluon.shell import exec_environment
import psycopg2
from gluon import DAL, Field
from gluon.template import render