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 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install # ok, fine, this step probably takes more than 30 seconds... | |
curl https://www.npmjs.org/install.sh | sh |
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
iptables -A INPUT -s 119.63.193.0/24 -j DROP | |
iptables -A INPUT -s 180.76.0.0/20 -j DROP | |
iptables -A INPUT -s 180.76.2.0/24 -j DROP | |
iptables -A INPUT -s 180.76.3.0/24 -j DROP | |
iptables -A INPUT -s 180.76.5.0/24 -j DROP | |
iptables -A INPUT -s 180.76.6.0/24 -j DROP | |
iptables -A INPUT -s 180.76.8.0/24 -j DROP | |
iptables -A INPUT -s 180.76.9.0/24 -j DROP | |
iptables -A INPUT -s 180.76.11.0/24 -j DROP | |
iptables -A INPUT -s 180.76.12.0/24 -j DROP |
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
class YourFileLogRoute extends CFileLogRoute | |
{ | |
protected function formatLogMessage($message,$level,$category,$time) | |
{ | |
return @date('Y/m/d H:i:s',$time)." [". Yii::app()->request->userHostAddress."]"." [$level] [$category] $message\n"; | |
} | |
} | |
# Do not insert 404 error in logs file | |
# http://www.yiiframework.com/forum/index.php?/topic/22510-no-route-chttpexception/page__p__110030__fromsearch__1#entry110030 |
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 cron.php sendpinsmsemail fill > fill.txt | |
php cron.php sendpinsmsemail send > send.txt |
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
Stop the MySQL process | |
$ service mysqld stop | |
Once MySQL has stopped | |
Restart it with the --skip-grant-tables option | |
$ mysqld_safe --skip-grant-tables & | |
Connect to MySQL using the root user. | |
$ mysql -u root |
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
5005550001 This phone number is invalid. 21211 | |
5005550002 Twilio cannot route to this number. 21612 | |
5005550003 Your account doesn't have the international permissions necessary to SMS this number. 21408 | |
5005550004 This number is blacklisted for your account. 21610 | |
5005550009 This number is incapable of receiving SMS messages. 21614 | |
All Others Any other phone number is validated normally. Input-dependent |
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 | |
// post to page | |
$page_post = (new FacebookRequest( $session, 'POST', '/'. $page_id .'/feed', array( | |
'access_token' => $access_token, | |
'name' => 'Facebook API: Posting As A Page using Graph API v2.x and PHP SDK 4.0.x', | |
'link' => 'https://www.webniraj.com/2014/08/23/facebook-api-posting-as-a-page-using-graph-api-v2-x-and-php-sdk-4-0-x/', | |
'caption' => 'The Facebook API lets you post to Pages you administrate via the API. This tutorial shows you how to achieve this using the Facebook PHP SDK v4.0.x and Graph API 2.x.', | |
'message' => 'Check out my new blog post!', | |
) ))->execute()->getGraphObject()->asArray(); |
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
http://www.eyecon.ro/datepicker/#download |
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
$t1 = microtime(); | |
function crypto_rand_secure($min, $max) { | |
$range = $max - $min; | |
if ($range < 0) return $min; // not so random... | |
$log = log($range, 2); | |
$bytes = (int) ($log / 8) + 1; // length in bytes | |
$bits = (int) $log + 1; // length in bits | |
$filter = (int) (1 << $bits) - 1; // set all lower bits to 1 | |
do { | |
$rnd = hexdec(bin2hex(openssl_random_pseudo_bytes($bytes))); |
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
<div class="wrapper active-page1"> | |
<div class="page page1"> | |
<h2>Здравствуйте</h2> | |
</div> | |
<div class="page page2"> | |
<h2>Листайте страницу</h2> | |
</div> | |
<div class="page page3"> | |
<h2>Чтобы увидеть</h2> | |
</div> |