Skip to content

Instantly share code, notes, and snippets.

View jbub's full-sized avatar

Juraj Bubniak jbub

View GitHub Profile
@jbub
jbub / archives.sh
Last active May 25, 2017 13:43
example usage of zip and tar archiving tools
# crossplatform, poor compression, fast
zip -r archive_name.zip path/to/compress
# extract zip in current directory
unzip archive_name.zip
# compress with tar, poor compression, very fast
tar cvf archive_name.tar path/to/compress
@jbub
jbub / pypi.sh
Created August 11, 2013 05:21
how to build your own python package and upload it to pypi
# build source distribution
python setup.py sdist
# build wheel distribution
python setup.py bdist_wheel
# register with pypi test server
python setup.py register -r test
# configure your .pypirc
@jbub
jbub / scp-copy.sh
Created September 11, 2013 13:57
Copy remote directory to local directory
# copy remote directory to local directory
scp -r -P 22 user@your.server.example.com:/path/to/foo /home/user/Desktop/
@jbub
jbub / go-sublime.json
Last active December 23, 2015 01:29
In order to get GoSublime working in Sublime Text 3 you need to provide GOPATH. The simplest way seems to be updating your GoSublime.sublime-settings.
{
"env": {
"GOPATH": "$HOME/Projekty/GO/dev/src",
}
}
@jbub
jbub / crontab.sh
Created October 30, 2013 15:30
Redirect program output to null output, cron will not send any email notification.
@reboot /path/to/program >/dev/null 2>&1
@jbub
jbub / sqlalchemy.py
Created November 15, 2013 09:56
Sqlalchemy declarative example.
# coding=utf-8
from sqlalchemy import Column, String, Integer, create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, scoped_session
engine = create_engine('mysql://root@localhost/test')
Base = declarative_base()
@jbub
jbub / kill.sh
Last active April 3, 2017 11:16
Kill all salt-master processes.
ps aux | grep -ie salt-master | grep -v grep | awk '{print $2}' | xargs kill -9
@jbub
jbub / sublimetext.json
Last active January 2, 2016 09:59
Sublime Text 3 user settings.
{
"color_scheme": "Packages/User/Tomorrow-Night.tmTheme",
"draw_white_space": "selection",
"find_selected_text": true,
"font_face": "Ubuntu Mono",
"font_options":
[
"subpixel_antialias"
],
"font_size": 13.0,
@jbub
jbub / pip.yaml
Created January 25, 2014 13:16
Install newest pip, setuptools, virtualenv with your python app dependencies.
download_pip:
cmd.run:
- name: "curl -O https://raw.github.com/pypa/pip/master/contrib/get-pip.py"
- cwd: /tmp
- unless: "test -f /tmp/get-pip.py"
- require:
- pkg: curl
install_pip:
cmd.run:
@jbub
jbub / email_export.sql
Created February 17, 2014 14:50
Export order emails as comma separated values.
SELECT string_agg(DISTINCT email, ',') FROM orders_order WHERE date_add >= '2013-12-20'