sudo aptitude install freetds-bin freetds-common tdsodbc odbcinst php5-odbc unixodbc
[FreeTDS]
# Mikrotik "if" statement example | |
:global version [/system resource get version ] | |
:if (version>=6.5) do={ | |
# Do some stuff | |
} else={ | |
# Do some other stuff | |
} |
#!/bin/sh | |
git config --global color.diff auto | |
git config --global color.branch auto | |
git config --global color.interactive auto | |
git config --global color.status auto |
#!/bin/sh | |
sudo VBoxManage internalcommands createrawvmdk -filename /mnt/resources/$1.vmdk -rawdisk $2 | |
sudo chmod 777 /mnt/resources/$1.vmdk |
#!/bin/bash | |
desktop-file-install example.desktop |
<?php | |
$ttl = 5*60; // Minutes x seconds | |
header_remove("Pragma"); | |
header("Cache-Control: private,max-age=$ttl"); | |
header("Date: ".gmdate('D, d M Y H:i:s \G\M\T',time())); | |
header("Expires: ".gmdate('D, d M Y H:i:s \G\M\T',time()+$ttl)); | |
?> |
#!/bin/bash | |
git config alias.taglog "log --tags --decorate=full" |
// Copy and paste the content of this file in app/build.gradle | |
// Now you are able to use it under defaultConfig, for example: | |
// versionCode getRevCount() | |
// versionName getTag() + '-' + getRevHash() | |
System.println( "App: " + "com.example.app" + " v" + getTag() + '-' + getRevHash() + "(" + getRevCount() + ")" ) | |
def getTag() { | |
def cmd1 = "git rev-list --tags --max-count=1" | |
def proc1 = cmd1.execute() |
-- http://dossy.org/2011/09/mysql-geo-distance-code-and-samples/ | |
DELIMITER $$ | |
DROP FUNCTION IF EXISTS geodist $$ | |
CREATE FUNCTION geodist ( | |
src_lat DECIMAL(9,6), src_lon DECIMAL(9,6), | |
dst_lat DECIMAL(9,6), dst_lon DECIMAL(9,6) | |
) RETURNS DECIMAL(6,2) DETERMINISTIC | |
BEGIN |
# If something do something | |
:if ( [ :len [ /somepath find where somematch="match" ] ] > 0 ) do={ | |
# Do something | |
} else { | |
# Do something else | |
} |