Skip to content

Instantly share code, notes, and snippets.

@descubraomundo
descubraomundo / sync_sites
Last active December 19, 2015 00:19
Sync sites available with sites enable nginx
#NGINX
ln -s /etc/nginx/sites-available/myapp /etc/nginx/sites-enabled/myapp
#APACHE
ln -s /etc/apache2/sites-available/myapp /etc/apache2/sites-enabled/myapp
@descubraomundo
descubraomundo / gist:5907196
Created July 2, 2013 06:44
Find location of the php.ini file in use
php -i | grep 'Configuration File'
@descubraomundo
descubraomundo / general.js
Created July 2, 2013 18:52
Safe jQuery init
(function($) {
// Execute when page is loaded
$(function() {
});
})(jQuery);
@descubraomundo
descubraomundo / database
Created July 2, 2013 21:07
Create new database
CREATE DATABASE dbname CHARACTER SET utf8 COLLATE utf8_general_ci;
@descubraomundo
descubraomundo / package_remove
Created July 3, 2013 15:06
Remove Package Linux with dependencies
sudo apt-get autoremove package
@descubraomundo
descubraomundo / remove_ip_fail2ban
Last active December 19, 2015 07:29
Remove blocked ip from Fail2Ban
#Get sudo user
sudo -s
#List iptables
iptables -L -n
#Remove the desired ip
iptables -D fail2ban-ssh -s banned_ip -j DROP
@descubraomundo
descubraomundo / clear_file
Created July 15, 2013 05:26
Delete all lines from a file with VIM
:1,$d
@descubraomundo
descubraomundo / delete_all
Created July 19, 2013 21:20
Delete all files and folder
rm -rf *
@descubraomundo
descubraomundo / gist:6073237
Created July 24, 2013 18:38
Disable / Enable Mac Dashboard
# Disable
defaults write com.apple.dashboard mcx-disabled -boolean YES
killall Dock
# Enable
defaults write com.apple.dashboard mcx-disabled -boolean NO
killall Dock
backup: # mysqldump -u root -p[root_password] [database_name] > dumpfilename.sql
restore:# mysql -u root -p[root_password] [database_name] < dumpfilename.sql