Skip to content

Instantly share code, notes, and snippets.

View brodul's full-sized avatar

Andraz Brodnik brodul

View GitHub Profile
#!/usr/bin/env python
# sample usage: checksites.py eriwen.com nixtutor.com yoursite.org
import pickle, os, sys, logging
from httplib import HTTPConnection, socket
from smtplib import SMTP
def email_alert(message, status):
fromaddr = 'you@gmail.com'
@brodul
brodul / fabfile.py
Created February 3, 2012 11:29
List files with fabric
from fabric.api import env, run, cd
env.hosts = ["localhost"]
def list_dir(dir=None):
"""docstring for list_dir"""
dir = dir or env.cwd
string = run("for i in %s*; do echo $i; done" % dir)
files = string.replace("\r","").split("\n")
return files
# {{parts.this.hostname}} client configuration
Client {
Name = {{parts.this.hostname}}-fd
Address = {{parts.this.ip}}
FDPort = {{parts.ports.bacula_fd}}
Catalog = MyCatalog
Password = "{{fd}}" # password for FileDaemon
}
FileSet {
#
# Brodul Bacula Director Configuration file
#
# For Bacula release 5.0.3 (04 August 2010) -- ubuntu 10.04
#
# You might also want to change the default email address
# from root to your address. See the "mail" and "operator"
# directives in the Messages resource.
#
<?php
//$url = 'http://www.reddit.com/r/linux/comments/s5s5i/skype_alternatives_for_linux/.json';
$url = 'http://api.themoviedb.org/2.1/Movie.search/en/json/075345/transpor';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
@brodul
brodul / streaming.sh
Created July 25, 2012 19:38
Twitch.tv script for streaming
#! /bin/bash
# originaly from http://tinyurl.com/twitch-linux from taladan
# www.youtube.com/user/taladan
# gist created by brodul
INRES="1280x800" # input resolution
#OUTRES="1024x640" # Output resolution
OUTRES="800x500" # Output resolution
@brodul
brodul / streaming.sh
Created July 25, 2012 19:39
Twitch.tv script for streaming
#! /bin/bash
# originaly from http://tinyurl.com/twitch-linux from taladan
# www.youtube.com/user/taladan
# gist created by brodul
INRES="1280x800" # input resolution
#OUTRES="1024x640" # Output resolution
OUTRES="800x500" # Output resolution
#! /usr/bin/env python
"""
Script that checks all uncommented domains in a nginx or apache config directory.
The domain is checked for the HTTP return code and
if the there is a DNS record for the domain.
Optionaly you can provide the ip of you server and the script will check
if the domain is hosted on your server or not.
"""
You will need::
- an activated virtualenv with celery installed
- a rabbitmq on localhost running
There must be a running celery worker running::
celery -A tasks worker --loglevel=info &
#! /bin/bash
beep -l 350 -f 392 -D 100 -n -l 350 -f 392 -D 100 -n -l 350 -f 392 -D 100 -n -l 250 -f 311.1 -D 100 -n -l 25 -f 466.2 -D 100 -n -l 350 -f 392 -D 100 -n -l 250 -f 311.1 -D 100 -n -l 25 -f 466.2 -D 100 -n -l 700 -f 392 -D 100 -n -l 350 -f 587.32 -D 100 -n -l 350 -f 587.32 -D 100 -n -l 350 -f 587.32 -D 100 -n -l 250 -f 622.26 -D 100 -n -l 25 -f 466.2 -D 100 -n -l 350 -f 369.99 -D 100 -n -l 250 -f 311.1 -D 100 -n -l 25 -f 466.2 -D 100 -n -l 700 -f 392 -D 100 -n -l 350 -f 784 -D 100 -n -l 250 -f 392 -D 100 -n -l 25 -f 392 -D 100 -n -l 350 -f 784 -D 100 -n -l 250 -f 739.98 -D 100 -n -l 25 -f 698.46 -D 100 -n -l 25 -f 659.26 -D 100 -n -l 25 -f 622.26 -D 100 -n -l 50 -f 659.26 -D 400 -n -l 25 -f 415.3 -D 200 -n -l 350 -f 554.36 -D 100 -n -l 250 -f 523.25 -D 100 -n -l 25 -f 493.88 -D 100 -n -l 25 -f 466.16 -D 100 -n -l 25 -f 440 -D 100 -n -l 50 -f 466.16 -D 400 -n -l 25 -f 311.13 -D 200 -n -l 350 -f 369.99 -D 100 -n -l 250 -f 311.13 -D 100 -n -l 25 -f 392 -D 100 -n -l 350 -f 466.16 -D 100 -n -l 250 -f 392