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 | |
DB=tzdata2013d | |
TZ=Asia/Jerusalem | |
ZI=/usr/share/zoneinfo/ | |
wget -q http://www.iana.org/time-zones/repository/releases/${DB}.tar.gz | |
mkdir ${DB} | |
cd ${DB} | |
tar xzf ../${DB}.tar.gz | |
zic -d zoneinfo asia |
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
# System-wide .bashrc file for interactive bash(1) shells. | |
# To enable the settings / commands in this file for login shells as well, | |
# this file has to be sourced in /etc/profile. | |
# If not running interactively, don't do anything | |
[ -z "$PS1" ] && return | |
# check the window size after each command and, if necessary, | |
# update the values of LINES and COLUMNS. |
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 | |
cd /opt | |
sudo git clone git@github.com:xypiie/gritz.git | |
sudo echo <<'EOF' > /usr/local/bin/gritz | |
#!/bin/bash | |
cd /opt/gritz | |
./gritz.pl &>/dev/null & | |
EOF |
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 | |
set -e | |
case "$1" in | |
start) | |
iptables -t nat -F | |
iptables -t nat -X | |
PORTS=(22 80 443) |
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 | |
curl --request PUT \ | |
"https://api.xively.com/v2/feeds/FEED_ID_GOES_HERE.json" \ | |
--data '{"version":"1.0.0","datastreams":[{"id":"mem_usage","current_value":"'$((`grep MemTotal /proc/meminfo | awk '{print $2}'`-`grep MemFree /proc/meminfo | awk '{print $2}'`))'"}]}' \ | |
--header "X-ApiKey: API_KEY_GOES_HERE" |
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 | |
// router.php | |
if (PHP_SAPI == 'cli-server') { | |
$path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH); | |
if ($path[0] == '/') { | |
$path = substr($path, 1); | |
} | |
if (!is_file($path) && !is_dir($path)) { | |
// Fixes include issues when running from another directory than the router | |
chdir(__DIR__); |
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 | |
URL=$1 | |
DOMAIN=$2 | |
WAIT=$3 | |
if [ "${URL}" == "" ] || [ "${DOMAIN}" == "" ] | |
then | |
echo "Usage: $0 URL DOMAIN" | |
exit 1 | |
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
// ==UserScript== | |
// @name OpenLaw - Knesset version | |
// @namespace http://www.knesset.gov.il/ | |
// @version 0.2 | |
// @description Make the forms on knesset.gov.il work w/o M$ products | |
// @match http://www.knesset.gov.il/laws/heb/template.asp* | |
// @match http://knesset.gov.il/laws/heb/template.asp* | |
// @author uda | |
// @license MIT; http://opensource.org/licenses/MIT | |
// @copyright 2014, Yehuda Deutsch (http://0x59.net/) |
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
/** | |
* Examples: | |
* var R = Radix(2); | |
* R.to(10); will result in "1010" | |
* R.from("1010"); sill result in 10 | |
* var R = Radix(16); | |
* R.to(10); will result in "a" | |
* R.from("a"); sill result in 10 | |
* | |
* Notice: |
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
#!/usr/bin/env php | |
<?php | |
function transCode($sourceStringArray, $sourceMap, $targetMap) { | |
$newString = []; | |
foreach ($sourceStringArray as $index => $char) { | |
if ($char == ' ') { | |
$newString[] = $char; | |
continue; |
OlderNewer