Skip to content

Instantly share code, notes, and snippets.

View tschwaerzl's full-sized avatar
🍕
is power

Thomas Schwärzl tschwaerzl

🍕
is power
View GitHub Profile
@tschwaerzl
tschwaerzl / Preferences.sublime-settings
Last active October 11, 2015 11:28
sublime user settings for python
{
"color_scheme": "Packages/RailsCasts Colour Scheme/RailsCastsColorScheme.tmTheme",
"find_selected_text": true,
"fold_buttons": true,
"font_face": "Source Code Pro ExtraLight",
"font_size": 11,
"font_options":
[
"subpixel_antialias"
],
@tschwaerzl
tschwaerzl / gist:5402873
Last active December 16, 2015 07:59
Original source: http://djangosnippets.org/snippets/2650/ (Autor: lettoo) Description: How to automaticaly add css to all fields of a ModelForm
class MyModelForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(forms.ModelForm, self).__init__(*args, **kwargs)
for field_name in self.base_fields:
field = self.base_fields[field_name]
size = None
try:
size = field.max_length
except:
size = None
@tschwaerzl
tschwaerzl / .vimrc
Created November 5, 2013 22:21
.vimrc config
execute pathogen#infect()
set nocompatible
syntax on
filetype plugin indent on
set nowrap
set tabstop=2
set shiftwidth=2
set softtabstop=2
set expandtab
set laststatus=2
@tschwaerzl
tschwaerzl / my.cnf
Created January 28, 2014 19:52 — forked from kenelliott/my.cnf
[mysqld_safe]
nice = -15
[mysqld]
max_binlog_size = 256M #max size for binlog before rolling
expire_logs_days = 1 #binlog files older than this will be purged
## Per-Thread Buffers * (max_connections) = total per-thread mem usage
thread_stack = 256K #default: 32bit: 192K, 64bit: 256K
sort_buffer_size = 1M #default: 2M, larger may cause perf issues
@tschwaerzl
tschwaerzl / howto-install-wale.md
Last active February 6, 2018 10:12
How to install WAL-E with PostgreSQL 9.5 on Ubuntu 16.04 or Ubuntu 14.04

How to install Wal-E

This is a step per step guide on how to install and configure Wal-E on a Ubuntu 16.04 or Ubuntu 14.04 server.

Install

  1. First install the required packages from apt
@tschwaerzl
tschwaerzl / \lib\systemd\system\sidekiq-static.service
Created June 29, 2017 10:27 — forked from dsadaka/\lib\systemd\system\sidekiq-static.service
systemd unit files for sidekiq service. note backslashes in filenames are really front slashes.
# This file actually fires up multiple sidekiq services.
# to start: systemctl start sidekiq.target
#
[Unit]
Description=Fire up up to 6 sidekiqs
# If you want more than 6 processes, append [email protected], [email protected], etc. to the ExecStart line below
# Note that only as many as have been enabled will actually start.
# Note also that the Unit data for each sidekiq process is in /lib/systemd/system/[email protected]
[Service]
@tschwaerzl
tschwaerzl / slack.sh
Created August 8, 2017 08:20 — forked from andkirby/slack.sh
Shell/Bash script for sending slack messages.
#!/usr/bin/env bash
####################################################################################
# Slack Bash console script for sending messages.
####################################################################################
# Installation
# $ curl -s https://gist.githubusercontent.com/andkirby/67a774513215d7ba06384186dd441d9e/raw --output /usr/bin/slack
# $ chmod +x /usr/bin/slack
####################################################################################
# USAGE
# Send message to slack channel/user
@tschwaerzl
tschwaerzl / package_updates_check.py
Last active February 8, 2024 19:40 — forked from yumminhuang/package_updates_check.py
Python script to check apt-get updates and send result to Slack channel
#!/usr/bin/env python
#coding=utf-8
import apt
import apt_pkg
from time import strftime
import json
import os
import requests
import subprocess
@tschwaerzl
tschwaerzl / latex_osx.md
Created December 13, 2017 15:22
Thesis LaTeX Guide for OSX

Thesis LaTeX Guide for OSX

Requirements

# Install Basic TeX
brew cask install basictex

# Install Skim (awesome pdf viewer with autoreload)
brew cask install skim
@tschwaerzl
tschwaerzl / gist:448fa05671d61351029fc101eb5c1307
Created December 28, 2017 14:21
Rails: API only minimal gem list
source 'https://rubygems.org'
git_source(:github) do |repo_name|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
"https://github.com/#{repo_name}.git"
end
gem 'rails', '~> 5.1.4'
gem 'pg', '~> 0.18'
gem 'puma', '~> 3.7'