Skip to content

Instantly share code, notes, and snippets.

View brodul's full-sized avatar

Andraz Brodnik brodul

View GitHub Profile
import xml.etree.ElementTree as ET
import StringIO
from najdisi_sms import SMSSender
import requests
sms = SMSSender('brodul', 'nom')
file_obj = StringIO.StringIO(
requests.get((
# Edit this configuration file to define what should be installed on
# the system. Help is available in the configuration.nix(5) man page
# or the NixOS manual available on virtual console 8 (Alt+F8).
{ config, pkgs, ... }:
{
#
TEX = pdflatex -shell-escape -interaction=nonstopmode -file-line-error
PAN = pandoc --listings -o
BIB = bibtex
TEXS := $(patsubst %.md,%.md.tex,$(wildcard *.md))
.PHONY: all view clean
all: clean diploma.pdf
@brodul
brodul / config.nix
Last active September 5, 2015 20:11
{
packageOverrides = pkgs: rec {
atom =
with pkgs;
let
atomEnv = buildEnv {
name = "env-atom";
paths = [
#!/bin/bash
# this is runned as backup_user
# the user is in the backup group
# Add key
if [ -z "$SSH_AUTH_SOCK" ] ; then
eval `ssh-agent -s`
ssh-add
fi
#!/bin/sh
set -e
npm install
export PATH="node_modules/.bin:node_modules/hubot/node_modules/.bin:$PATH"
# how to parse an ini file in bash :D
python3 - <<END
import configparser
@brodul
brodul / pushup.sh
Last active August 29, 2015 14:26
100 pushup challange shell script
###
# 100 pushup challange shell script
#
# Dependencies:
# - alsa
# - alsa-tools
# - espeak
#
###
@brodul
brodul / wallpaper_script.py
Created April 20, 2015 11:55
Wallpaper script
from urllib import urlretrieve
import collections
import hashlib
import json
import os
import pickle
import urllib2
url = "http://www.reddit.com/r/wallpapers/.json?limit=100"
url_cache = '/home/brodul/.wallpaper_cache'
GLAVNICA, glavnica = 6000, 6000
for each in range(12):
obresti = glavnica * (0.2 + each * 0.15) * 30 / 360 / 100
glavnica += obresti
print
print glavnica
print glavnica - GLAVNICA
PLAY [tag_test] ***************************************************************
TASK: [user name=pikapika comment="pikapika App User" home=/srv/pikapika] *****
<107.167.182.70> ESTABLISH CONNECTION FOR USER: brodul
<107.167.182.70> REMOTE_MODULE user name=pikapika comment="pikapika App User" home=/srv/pikapika
<107.167.182.70> EXEC ['ssh', '-C', '-tt', '-vvv', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 'ControlPath=/home/brodul/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 'KbdInteractiveAuthentication=no', '-o', 'PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey', '-o', 'PasswordAuthentication=no', '-o', 'ConnectTimeout=10', u'107.167.182.70', "/bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1398764093.06-227944966233568 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1398764093.06-227944966233568 && echo $HOME/.ansible/tmp/ansible-tmp-1398764093.06-227944966233568'"]
<107.167.182.70> PUT /tmp/tmpdVFDvZ TO /home/brodul/.ansible/tmp/ansible-tmp-1398764093.06-227944966