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 | |
user=$(whoami) | |
touch /home/$user/deluge_log | |
ip=<your ip here> | |
port=<port here> | |
log_level=critical | |
#log_level=debug | |
killall deluged |
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 | |
# Unflag OVH traffic | |
echo "Loading OVH IPs 0%..." | |
iptables -A OUTPUT -t mangle -p tcp -m iprange --dst-range 213.186.32.0-213.186.63.255 -j MARK --set-mark 0 | |
iptables -A OUTPUT -t mangle -p tcp -m iprange --dst-range 213.186.40.0-213.186.47.255 -j MARK --set-mark 0 | |
iptables -A OUTPUT -t mangle -p tcp -m iprange --dst-range 213.186.49.0-213.186.49.31 -j MARK --set-mark 0 | |
iptables -A OUTPUT -t mangle -p tcp -m iprange --dst-range 213.186.35.0-213.186.35.255 -j MARK --set-mark 0 | |
iptables -A OUTPUT -t mangle -p tcp -m iprange --dst-range 213.186.36.0-213.186.36.255 -j MARK --set-mark 0 | |
iptables -A OUTPUT -t mangle -p tcp -m iprange --dst-range 213.186.37.0-213.186.37.255 -j MARK --set-mark 0 |
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
<html> | |
<head> | |
<title>Testing Fucking Forms onSubmit</title> | |
<script src="http://code.jquery.com/jquery-1.6.1.min.js" type="text/javascript"></script> | |
<script type="text/javascript"> | |
$(document).ready(function(undefined) { | |
$('#someForm').submit(function() { | |
var canSumbit = true; | |
$('input.tester').each(function() { | |
if($(this).val().length != 4) { |
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
$(document).ready(function() { | |
var $fs = $('#ServerAdminAddForm fieldset.global'); | |
var slotController = { | |
slotCount: 0, | |
addSelector: function() { | |
var $template = '\ | |
<div class="input select">\ | |
<label for="ServerSlotCount">Number of Slot Types</label>\ | |
<select id="ServerSlotCount">\ |
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
$(document).ready(function(undefined) { | |
function removeMovement(obj) { | |
$(obj).parent().remove(); | |
} | |
function addMovement(count) { | |
next = count+1; | |
html = '<div id="movement'+count+'">\ | |
<button type="button" onClick="removeMovement(this);">remove</button>\ | |
<select name="movement'+count+'">'; |
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
# Based on: http://stackoverflow.com/questions/2218075/using-git-with-your-cakephp-project | |
# Procedure: | |
# 1. Remove app/tmp/ from .gitignore | |
# 2. touch app/tmp/.keep | |
# 3. git add app/tmp/.keep | |
# 4. git commit | |
# 5. Add app/tmp/ to .gitignore | |
# Clean tmpfiles and delete .gitignore |
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
sudo apt-get install build-essential libsqlite3-dev zlib1g-dev libncurses5-dev libgdbm-dev libbz2-dev libreadline5-dev libssl-dev libdb-dev | |
wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz | |
tar -xzf Python-2.7.3.tgz | |
cd Python-2.7.3 | |
./configure --prefix=/usr --enable-shared | |
make | |
sudo make install | |
cd .. |
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
if (isset($_SERVER['HTTP_ORIGIN'])) { | |
$origin = $_SERVER['HTTP_ORIGIN']; | |
foreach (Configure::read('AccessControlAllowOrigin') as $domain) { | |
if (strpos($origin, $domain) !== FALSE) { | |
header("Access-Control-Allow-Origin: ".$origin); | |
break; | |
} | |
} | |
header("Access-Control-Allow-Credentials: true"); | |
header("Access-Control-Allow-Methods: POST, GET, OPTIONS"); |
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 | |
$files = scandir(__DIR__ . '/mongoose/js'); | |
foreach ($files as $file) { | |
if (stripos($file, '.js') !== FALSE) { | |
echo '<script type = "text/javascript" src = "' . $file . '"></script>' | |
} | |
} |
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
o = { | |
tfns: ['a','b', 'c'], | |
templates: {}, | |
templates2: {}, | |
loadTemplates: function () { | |
var t = this.tfns; | |
console.log('loading templates'); | |
$.each(this.tfns, function(i,e) { |
OlderNewer