Skip to content

Instantly share code, notes, and snippets.

Steve Göring stg7

Block or report user

Report or block stg7

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@stg7
stg7 / argumentparsing.py
Created Aug 29, 2017
argument parsing with python3
View argumentparsing.py
#!/usr/bin/env python3
import sys
import argparse
def main(args):
""" Example for command line argument parsing using argparse,
if you ever need to program java you can use: [argparse4j](https://argparse4j.github.io/)
"""
parser = argparse.ArgumentParser(description='DESC', epilog="stg7 2016", formatter_class=argparse.ArgumentDefaultsHelpFormatter) # see also here for other options: https://docs.python.org/3/library/argparse.html#argumentparser-objects
@stg7
stg7 / dropbox_download.sh
Created Mar 28, 2017
download dropbox folder if it is too large for a direct download
View dropbox_download.sh
#!/bin/bash
# if someone send you a link to a dropbox shared folder and you don't want to install the dropbox client
# and it is not possible to download the whole folder via dropbox, than the following script could help you
# change DROPBOXURL to your link url
wget "DROPBOXURL" -O down.html
# where DROPBOX URL is something like: https://www.dropbox.com/sh/ID?dl=0
cat down.html \
| sed "s|href|\\nhref=|g" \
| grep "href=\":" \
@stg7
stg7 / svn2git.sh
Last active Mar 30, 2017
Porting a svn to git
View svn2git.sh
#!/bin/bash
# please install git-svn
input_svn="url/to/svn/like/for/checkout"
output_git="url/to/git/like/for/cloning"
mkdir -p _svn
mkdir -p _git
svn co "$input_svn" _svn
@stg7
stg7 / json_prettifier.py
Created Nov 6, 2016
Prints a json string in a pretty formatted output on stdout
View json_prettifier.py
#!/usr/bin/env python3
"""
Prints a json string in a pretty formatted output on stdout.
Example call:
echo "{\"a\":100, \"b\": [1,2,3]}" | ./json_prettifier.py
will print:
{
@stg7
stg7 / json_extractor.py
Created Nov 6, 2016
Extract json subelements via command line and printout results on stdout.
View json_extractor.py
#!/usr/bin/env python3
"""
Extract json subelements via command line and printout results on stdout.
Example call:
echo "{\"a\":100, \"b\": [1,2,3]}" | ./json_extractor.py b
will print:
[
@stg7
stg7 / extract_owncloud_sqlite3.py
Created Oct 21, 2016
a quick and dirty tool for extraction of contacts and calendar entries from an owncloud sqlite3 database to text formats (ics, vcf)
View extract_owncloud_sqlite3.py
#!/usr/bin/env python3
# a quick and dirty tool for extraction of contacts
# and calendar entries from an owncloud sqlite3 database to text formats (ics, vcf)
#
# run it in your data directory where owncloud.db is stored
import sqlite3
c = sqlite3.connect('owncloud.db')
You can’t perform that action at this time.