Skip to content

Instantly share code, notes, and snippets.

View maliMirkec's full-sized avatar
🤘
I’m really good at this without realising how.

Silvestar Bistrović maliMirkec

🤘
I’m really good at this without realising how.
View GitHub Profile
@maliMirkec
maliMirkec / count_files
Created November 3, 2015 07:38
Count nubmer of files in folder
// Count nubmer of files in folder
find FOLDER_NAME -type f | wc -l
@maliMirkec
maliMirkec / my.sql
Created November 26, 2015 10:29
Useful sql commands: reinstall, reset password
// mysql version
apt-cache policy mysql-server
// mysql reconfig
sudo dpkg-reconfigure mysql-server-*.*
// phpmyadmin reconfig
sudo dpkg-reconfigure phpmyadmin
@maliMirkec
maliMirkec / server
Last active March 2, 2016 08:06
Set up server
https://github.com/DigitalOcean-User-Projects/Articles-and-Tutorials/blob/master/set_hostname_fqdn_on_ubuntu_centos.md
https://www.digitalocean.com/community/articles/how-to-set-up-a-host-name-with-digitalocean
https://www.digitalocean.com/community/tutorials/how-to-use-an-spf-record-to-prevent-spoofing-improve-e-mail-reliability
https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-dkim-with-postfix-on-debian-wheezy
@maliMirkec
maliMirkec / bitnami-apps-prefix.conf
Created May 16, 2016 20:48
Bitnami WAMP Wordpress vhosts fix.
# Bitnami applications installed in a prefix URL
Include "C:/Workspace/Bitnami/apps/phpmyadmin/conf/httpd-prefix.conf"
Include "C:/Workspace/Bitnami/apps/wordpress/conf/httpd-prefix.conf"
@maliMirkec
maliMirkec / jpegoptim
Last active May 27, 2016 08:11
Optimize images using jpegoptim script
// optime jpegs in folder
jpegoptim *.jpg —strip-all
// optimize jpegs recursivelly
find -type f -name "*.jpg" -exec jpegoptim --strip-all {} \;
@maliMirkec
maliMirkec / find-and-exclude
Last active May 27, 2016 09:31
Find and exclude files on Ubuntu
// http://www.cyberciti.biz/faq/find-command-exclude-ignore-files/
find . -type f \( -iname "*.jpg" ! -iname "*1024*" ! -iname "*800*" ! -iname "*768*" ! -iname "*300*" ! -iname "*150*" \)
@maliMirkec
maliMirkec / resize-images
Created May 27, 2016 11:10
Resize all images in folder
find . -type f \( -iname "*.jpg" ! -iname "*1024*" ! -iname "*800*" ! -iname "*768*" ! -iname "*300*" ! -iname "*150*" ! -iname "*article cover*" \) | xargs mogrify -resize 750
@maliMirkec
maliMirkec / .htaccess
Created July 5, 2016 20:11
.htaccess vestacp
<ifmodule mod_deflate.c>
SetOutputFilter DEFLATE
AddOutputFilterByType DEFLATE text/html text/css text/plain text/xml application/x-javascript application/x-httpd-php
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip
Header append Vary User-Agent env=!dont-vary
</ifmodule>
@maliMirkec
maliMirkec / phpmyadmin_fix
Last active July 6, 2016 07:09
Fix phpmyadmin controluser message
curl -O -k https://raw.githubusercontent.com/skurudo/phpmyadmin-fixer/master/pma-ubuntu.sh && chmod +x pma-ubuntu.sh && ./pma-ubuntu.sh
@maliMirkec
maliMirkec / .bash
Created August 26, 2016 05:55
Add nginx signing key
// get nginx key
curl -O https://nginx.org/keys/nginx_signing.key
// install
apt-key add nginx_signing.key