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
# multi curstor edit | |
select all | |
CTRL + SHIFT + L | |
# Add comma after every string | |
find: (.*+$) | |
replace: $1, | |
# Add comma after every number | |
find: (^\d+$) |
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
DEMO: https://jsfiddle.net/k3zfzxgx/ | |
<!-- HTML --> | |
<div id="loginModal" class="modal"> | |
<div class="modal-content modal-login"> | |
<div class="modal-header"> | |
<span class="modal-close">×</span> | |
<h2>My title</h2> | |
</div> | |
<div class="modal-body"> |
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 yiic.php rresque stop | |
php yiic.php rresque start --count=1 | |
ps aux | grep resque |
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
/* ----------- Non-Retina Screens ----------- */ | |
@media screen | |
and (min-device-width: 1200px) | |
and (max-device-width: 1600px) | |
and (-webkit-min-device-pixel-ratio: 1) { | |
} | |
/* ----------- Retina Screens ----------- */ | |
@media screen | |
and (min-device-width: 1200px) |
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 netstat -ltnp | grep ':80' | |
This would return the following: | |
tcp 0 0 :::80 :::* LISTEN 1047/httpd | |
Then I ran the following command: | |
sudo kill -9 1047 |
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
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 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 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 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 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 |