Skip to content

Instantly share code, notes, and snippets.

Michal Kubenka mkubenka

Block or report user

Report or block mkubenka

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
from tastypie.exceptions import NotFound
from tastypie.resources import ModelResource
from tastypie.authentication import BasicAuthentication, ApiKeyAuthentication
from tastypie.models import ApiKey
from django.contrib.auth.models import User
__author__ = 'martinsandstrom'
class ApiTokenResource(ModelResource):
mkubenka / zram
Last active Aug 29, 2015 — forked from janlam7/zram
View zram
# -*- sh -*-
: << =cut
=head1 NAME
zram - Plugin to monitor zram usage
mkubenka / NSString+KBAdditions.h
Last active Mar 16, 2016 — forked from kevboh/NSString+KBAdditions.h
Add support for iOS7.
View NSString+KBAdditions.h
@interface NSString (KBAdditions)
- (CGFloat)fontSizeWithFont:(UIFont *)font constrainedToSize:(CGSize)size minimumScaleFactor:(CGFloat)minimumScaleFactor;
View sphinx_
use warnings;
use strict;
use utf8;
use File::Basename;
mkubenka / gist:b4324b553a7fad89e29c
Created Oct 28, 2015 — forked from saetia/gist:1623487
Clean Install – OS X 10.11 El Capitan
View gist:b4324b553a7fad89e29c

OS X Preferences

most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat
mkubenka /
Created Jan 27, 2016 — forked from Ashex/
Get Account ID from boto3 via IAM or Role ARN
import boto3
import argparse
def main():
argparser = argparse.ArgumentParser(description='Testing ARN stuff')
argparser.add_argument("--role", help="If running with a role provide it here", required=True)
argparser.add_argument("--profile", help="Credential profile", required=True)
argparser.add_argument('--region', help='AWS Region to work within, defaults to eu-central-1', default='eu-central-1', required=False)
args = argparser.parse_args()
role = args.role
mkubenka / Vagrantfile
Last active May 29, 2019
Windows on AWS with Vagrant
View Vagrantfile
require 'inifile'
require 'date'
Vagrant.configure("2") do |config| = "dummy"
config.vm.guest = "windows"
config.vm.boot_timeout = 600
config.vm.provider :aws do |aws, override|
mkubenka /
Created Apr 18, 2016
Download Outlook Smart Network Data Service Data for last 90 days
# Enable automated data access under
import datetime
import requests
import shutil
for i in range(90):
date = + datetime.timedelta(-i)
mkubenka /
Created Apr 23, 2016
OpenVPN Access Server Letsencrypt
apt-get -y install git bc
git clone /opt/letsencrypt
mkdir /etc/letsencrypt
mkubenka / clean.ps1
Last active Apr 30, 2017
Remove the ‘Modern apps’ (anything from the ‘Store’) from the profile you are using to create your Windows 10 image.
View clean.ps1
# Remove some Windows Store pakacges which are blocking Sysprep
# Execution of scripts has to be neabled: Set-ExecutionPolicy RemoteSigned
$AppsList = "Microsoft.Bing" , "Microsoft.BingFinance" , "Microsoft.BingMaps" , "Microsoft.BingNews"`
, "Microsoft.BingSports" , "Microsoft.BingTravel" , "Microsoft.BingWeather" , "Microsoft.Camera"`
, "microsoft.microsoftskydrive" , "Microsoft.Reader" , "microsoft.windowscommunicationsapps"`
, "microsoft.windowsphotos" , "Microsoft.XboxLIVEGames" , "Microsoft.ZuneMusic"`
, "Microsoft.ZuneVideo" , "Microsoft.Media.PlayReadyClient"
, "9E2F88E3.Twitter", ""
You can’t perform that action at this time.