This file contains 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 | |
cmd=${0##*/} | |
ssh -t $1 "$(sed '1,/^#xxxREMOTExxx#$/d' < $0) > /tmp/$cmd.$$.sh && sh /tmp/$cmd.$$.sh; rm /tmp/$cmd.$$.sh" | |
exit $? | |
#xxxREMOTExxx# | |
#!/bin/sh | |
echo "This is executed on the remote server" |
This file contains 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/bash | |
MAX=80 | |
[email protected] | |
HOST=`hostname` | |
DISKS=`df -h | awk -v max=$MAX 'NR>1 && NF>1 { perc = (NF==5) ? $4 : $5; sub("%","",perc); if (0+perc >= 0+max) print perc"%", $NF }'` | |
if [ "$DISKS" != "" ]; then | |
echo -e "Warning we are running out of disk space on $HOST \n$DISKS" | mail -s "Running out of disk space on $HOST" $EMAIL | |
fi |
This file contains 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
use \MangoPay\Libraries\OAuthToken; | |
function extractValues(OAuthToken $token) { | |
$ref = new \ReflectionClass(OAuthToken::CLASS); | |
$values = []; | |
$props = $ref->getProperties(); | |
foreach($props as $prop) { | |
if (!$prop->isPublic()) { |
This file contains 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
- hosts: all | |
vars: | |
node_version: "0.10.28" | |
tasks: | |
- name: Check for node.js | |
shell: test "$(node -v 2> /dev/null)" = v{{node_version}} | |
register: nodejs_installed | |
ignore_errors: True | |
tags: | |
- nodejs |
This file contains 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
Start Terminal.app and then type: | |
$ cd ~/Library/Application Support/Steam/SteamApps/common/Shatter/Shatter.app/Contents/Frameworks/Cg.framework | |
$ ln -s Versions/1.0/Cg Cg |
This file contains 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
<?php | |
function colorize($str, $fg = 'white', $bg = false) | |
{ | |
$fg = str_replace(array('-','_'), '', $fg); | |
switch($fg) { | |
case 'black': $fg = "0;30"; break; | |
case 'yellow': $fg = "1;33"; break; | |
case 'brown': $fg = "0;33"; break; | |
case 'green': $fg = "0;32"; break; |
This file contains 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
<?php | |
class MyPlugin extends Plugin | |
{ | |
private $modules = array(); | |
private function loadModules() | |
{ | |
$base_path = dirname(__FILE__) . '/modules/'; | |
$dh = opendir( $base_path ); |
This file contains 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
" Barebones example of how to make a simple vim syntax file. | |
" Language: todofile | |
" Maintainer: leihog | |
"if exists ("b:current_syntax") | |
" finish | |
"endif | |
let b:current_syntax = "todo" | |
" v:folddashes a string that contains dashes to represent the foldlevel. |
This file contains 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
diff --git 0.11/access/macro.py 0.11/access/macro.py | |
index 7ea2e23..70ed06f 100644 | |
--- 0.11/access/macro.py | |
+++ 0.11/access/macro.py | |
@@ -11,6 +11,7 @@ import re | |
from trac.core import * | |
from trac.wiki.api import IWikiMacroProvider | |
from trac.wiki.formatter import format_to_html | |
+from trac.perm import PermissionSystem, IPermissionStore | |
This file contains 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/bash | |
# | |
# Use this to include all vhost files in to lighttpd.conf | |
# In lighttpd.conf add the line: include_shell "/etc/lighttpd/vhosts.sh" | |
# | |
VHOST_PATH="/etc/lighttpd/vhosts/*" | |
for f in $VHOST_PATH | |
do | |
cat $f |
NewerOlder