Skip to content

Instantly share code, notes, and snippets.

Avatar
😳

Vehbi Sinan Tunalioglu vst

😳
View GitHub Profile
@vst
vst / README.md
Last active Mar 11, 2020
Setting up a Local Docker Registry
View README.md

Setting up a Local Docker Registry

Note: Follow the official guide.

bash setup.sh myusername mypassword
  • Authentication information is stored under /data/docker/registry/auth.
  • Storage directory is set to be /data/docker/registry/storage.
@vst
vst / packages.list
Last active Nov 9, 2018
List of Debian/Ubuntu Packages I usually need on a fresh installation
View packages.list
ack
axel
curl
emacs
git
htop
jq
mc
network-manager
pandoc
@vst
vst / macro.vba
Created Sep 19, 2018
Open/Libre Office Save All Sheets as CSV
View macro.vba
' Run the SaveAllAsCSV subroutine.
' Creates a CSV file from the active sheet under the given directory.
'
' Based on https://forum.openoffice.org/en/forum/viewtopic.php?t=41284
sub SaveAsCSV(filename As String)
' Declare the document variable:
dim document as object
' Get the document:
@vst
vst / mixins.py
Created Sep 19, 2012
Some Django model mixins
View mixins.py
# Copyright (c) 2012, Vehbi Sinan Tunalioglu <vst@vsthost.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# - Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
@vst
vst / todoist.py
Last active Mar 17, 2018
A command line tool for Todoist
View todoist.py
## Got this script initially from https://gist.github.com/kbl/5970131
###########
# IMPORTS #
###########
import ConfigParser
import argparse
import json
import os
View sample.pl
#!/usr/bin/env perl
=head1 NAME
sample.pl - Sample Perl Script
=head1 SYNOPSIS
perl sample.pl
perldoc sample.pl
View casts.py
"""
Provides a cast operations module.
>>> cast_to_decimal(1.0001)
Decimal('1.0001')
>>> cast_to_decimal(1)
Decimal('1')
>>> cast_to_decimal("1.0001")
Decimal('1.0001')
>>> cast_to_decimal(Decimal("1.0001"))
View setup.py
"""
Provides the setup module.
"""
from ___YOURMODULE___ import __version__
from setuptools import setup
from setuptools import find_packages
import os
## The absolute directory path:
View currencies.py
from enum import Enum
from decimal import Decimal
class Currency:
"""
Defines an ISO 4217 compatible currency object model.
>>> Currency("XXX", "My Currency", 2)
<Currency XXX 2 My Currency>
View multiplicity.py
from enum import Enum
from math import inf
class Multiplicity(Enum):
"""
Defines multiplicities.
>>> Multiplicity.OPTIONAL.min
0