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
| function validateImei($imei, $use_checksum = true) { | |
| if (is_string($imei)) { | |
| if (ereg('^[0-9]{15}$', $imei)) { | |
| if (!$use_checksum) return true; | |
| for ($i = 0, $sum = 0; $i < 14; $i++) { | |
| $tmp = $imei[$i] * (($i%2) + 1 ); | |
| $sum += ($tmp%10) + intval($tmp/10); | |
| } | |
| return (((10 - ($sum%10)) %10) == $imei[14]); | |
| } |
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
| //jQuery function to check if element exists. | |
| jQuery.fn.exists = function(){return this.length>0;} |
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
| $illegal_domain_names = array( | |
| 'gmail.con', | |
| 'gamil.com', | |
| 'gail.com', | |
| 'gmil.com', | |
| 'gmail.co', | |
| 'hotnail.com', | |
| 'hormail.com', | |
| 'hotmail.con', | |
| 'hotmil.com', |
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
| <?php | |
| function arrayToXml($array, $rootElement = null, $xml = null) { | |
| $_xml = $xml; | |
| if ($_xml === null) { | |
| $_xml = new SimpleXMLElement($rootElement !== null ? $rootElement : '<command/>'); | |
| } | |
| foreach ($array as $k => $v) { | |
| if (is_array($v)) { | |
| arrayToXml($v, $k, $_xml->addChild($k)); | |
| } else { |
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
| <?php | |
| function bg_exec($phpfile) { | |
| exec("nohup php " . $phpfile . " >/dev/null 2>&1 & echo $! &"); | |
| } |
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
| #!/usr/bin/php5 | |
| <?php | |
| /* | |
| * Speedtest.net linux terminal client. | |
| * This is free and open source software by Alex based on a script from Janhouse | |
| * Script uses curl, executes ifconfig commands in shell and writes temporary files in temp_down folder. Make sure you have everything set up before using it. | |
| */ | |
| header("content-type: text/plain"); | |
| /* * * Configuration * * */ | |
| $iface="eth0"; |
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 | |
| open -a "/Applications/Google Chrome.app" "https://www.youtube.com/v/$1&hd=1&autoplay=1" |
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/bash | |
| x=`ping -c1 google.com 2>&1 | grep unknown` | |
| if [ ! "$x" = "" ]; then | |
| echo "$(date +'%F %T') Restarting network" >/var/log/network_monitor.log | |
| service network restart | |
| 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
| function ansicolor($text , $color='cyan', $background = false, $bold = false) { | |
| $colorcodes = array('black' => 0, 'red' => 1, 'green' => 2, 'yellow' => 3, 'blue' => 4, 'magenta' => 5, 'cyan' => 6, 'white' => 7); | |
| return ($bold ? chr(27) . "[1m" : "") . chr(27) . "[" . ($background ? '4' : '3') . $colorcodes[$color] . "m" . $text . chr(27) . "[0m"; | |
| } |
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
| @echo off | |
| REM Select Channel and Program | |
| set /p _channel=Please enter channel: | |
| set /p _pro=Please enter program: | |
| REM Get your IP address | |
| for /f "delims=[] tokens=2" %%a in ('ping -4 %computername% -n 1 ^| findstr "["') do (set thisip=%%a) | |
| set "str1=udp://" |
OlderNewer