This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from sqlalchemy.exc import IntegrityError | |
from sqlalchemy.sql.expression import ClauseElement | |
def _get_or_create(session, model, defaults=None, **kwargs): | |
try: | |
query = session.query(model).filter_by(**kwargs) | |
instance = query.first() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[global_config] | |
title_hide_sizetext = True | |
title_transmit_bg_color = "#ededed" | |
enabled_plugins = LaunchpadCodeURLHandler, APTURLHandler, LaunchpadBugURLHandler | |
title_transmit_fg_color = "#080808" | |
title_inactive_bg_color = "#ededed" | |
[keybindings] | |
[profiles] | |
[[default]] | |
use_system_font = False |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
</head> | |
<body> | |
<p></p> | |
<div style="border: 1px solid whiteSmoke"> | |
<iframe src="./postMessageB.html" frameborder="0" style="width: 100%;"></iframe> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Reset | |
Color_Off='\e[0m' # Text Reset | |
# Regular Colors | |
Black='\e[0;30m' # Black | |
Red='\e[0;31m' # Red | |
Green='\e[0;32m' # Green | |
Yellow='\e[0;33m' # Yellow | |
Blue='\e[0;34m' # Blue | |
Purple='\e[0;35m' # Purple |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [ `nm-tool | ack eth0 -A 5 | ack State | sed 's/ *//g' | cut -f 2 -d ':'` == "connected" ]; then | |
# Interface eth0 UP | |
: | |
else | |
# Interface eth0 DOWN. Try to restart | |
ifup eth0 | |
fi | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
==== ==== ==== ==== Issue #0 ==== ==== ==== ==== | |
Summary: | |
Description: | |
Priority: Critical | Major | Normal | Minor | |
Type: Bug | Feature | Optimization | |
State: Open | In Progress | Fixed | Closed | |
Assignee: | |
Comments: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
MEM=$(cat /proc/meminfo | ack 'MemFree: +(\d+)' --output "\$1" | bc) | |
CAC=$(cat /proc/meminfo | ack '^Cached: +(\d+)' --output "\$1" | bc) | |
FREE=$(echo "$MEM + $CAC" | bc) | |
THRESHOLD=1048576 | |
echo "Free Memory: $MEM kb" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Firewall configuration written by system-config-firewall | |
# Manual customization of this file is not recommended. | |
*nat | |
:PREROUTING ACCEPT [10:532] | |
:INPUT ACCEPT [0:0] | |
:OUTPUT ACCEPT [0:0] | |
:POSTROUTING ACCEPT [0:0] | |
# PPTP | |
-A POSTROUTING -s 10.18.1.0/24 -o eth0 -j MASQUERADE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unicodedata | |
import re | |
chars = (unichr(i) for i in xrange(0x110000)) | |
cc = ''.join(c for c in chars if unicodedata.category(c) == 'Cc') | |
# or equivalently and much more efficiently | |
cc = ''.join(map(unichr, range(0,32) + range(127,160))) | |
cc_re = re.compile('[%s]' % re.escape(cc)) |