Skip to content

Instantly share code, notes, and snippets.

@ursuleacv
ursuleacv / timezone.html
Created January 29, 2018 15:17
Timezone List
<select name="timezone" id="timezone">
<option>
Africa/Abidjan
</option> <option>
Africa/Accra
</option> <option>
Africa/Addis_Ababa
</option> <option>
Africa/Algiers
</option> <option>
@ursuleacv
ursuleacv / php-fpm.conf
Last active December 18, 2019 04:37
Adjusting child processes for PHP-FPM (Nginx)
Alternate way to find php-fpm size in human readable format.
ps -eo size,pid,user,command --sort -size | awk '{ hr=$1/1024 ; printf("%13.2f Mb ",hr) } { for ( x=4 ; x<=NF ; x++ ) { printf("%s ",$x) } print "" }' | grep php-fpm
pm.max_children = Total RAM dedicated to the web server / MAXIMUM child process size - in my case it was 85MB
The server has 8GB of RAM, so:
pm.max_children = 6144MB / 85MB = 72
@ursuleacv
ursuleacv / gist:38a8f60b878b3fb5736a5572220fb7c1
Created January 8, 2018 15:10
nginx config tuning for best performance and security
https://www.owasp.org/index.php/SCG_WS_nginx#SSL_Module
https://github.com/denji/nginx-tuning
https://gist.github.com/plentz/6737338
https://gist.github.com/denji/8359866
@ursuleacv
ursuleacv / gist:75cfa7c624d72be3d56894f37c622f7b
Last active June 30, 2017 20:55
Centos Package tuple (…) could not be found in rpmdb
yum clean all
yum update
if doesn't work than
rpm --rebuilddb
yum update
composer dump-autoload
php artisan clear-compiled
php artisan config:cache
php artisan optimize --force
@ursuleacv
ursuleacv / sublime.txt
Last active March 4, 2020 15:55
Sublime append comma after numbers regex
# multi curstor edit
select all
CTRL + SHIFT + L
# Add comma after every string
find: (.*+$)
replace: $1,
# Add comma after every number
find: (^\d+$)
@ursuleacv
ursuleacv / index.html
Last active June 13, 2016 13:39
A very simple modal dialog
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">
php yiic.php rresque stop
php yiic.php rresque start --count=1
ps aux | grep resque
@ursuleacv
ursuleacv / gist:cb36de7a0b14d1a7054f
Created November 24, 2015 19:53
Media Queries for Standard Devices
/* ----------- 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)
@ursuleacv
ursuleacv / gist:921cd6eb5179a0120f4f
Created September 12, 2015 19:50
Apache could not start. Address already in use
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