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
#install | |
sudo apt-get install yui-compressor | |
#to use, js and css files only | |
yui-compressor /path/to/file -o /path/to/new/file |
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
#---- renew ssl when you get the error | |
#---- Client with the currently selected authenticator does not support any combination of challenges that will satisfy the CA. | |
certbot --authenticator standalone --installer apache -d <domain> --pre-hook "systemctl stop apache2" --post-hook "systemctl start apache2" |
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
#restart nginx | |
service nginx restart | |
#restart php | |
service php7.0-fpm restart | |
#list all services running | |
service --status-all | |
#add path |
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
#--- good resource | |
http://gitready.com/ | |
#--- When you want to commit files that used to be ignored or vice versa | |
git rm -r --cached . | |
git add . | |
git commit -m "Commit follows the .gitignore again" | |
#--- Get the remote URL from a repository | |
git config --get remote.origin.url |
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 | |
//================================== | |
// ONLY ONE ITEM IN THE CART AT TIME | |
//================================== | |
add_filter( 'woocommerce_add_cart_item_data', 'woo_custom_add_to_cart' ); | |
function woo_custom_add_to_cart( $cart_item_data ) { | |
global $woocommerce; | |
// REMOVE ALL OTHER ITEMS | |
$woocommerce->cart->empty_cart(); |
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
# -- UBUNTU + PHP7 + NGINX | |
# -- must add it to you pgp location | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; #replace if already there... | |
# -- must to check the listen path to php fpm sock is this file | |
nano /etc/php/7.0/fpm/pool.d/www.conf | |
# -- search for "listen = ", this path must be | |
/var/run/php/php7.0-fpm.sock |
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
# mac | |
brew install putty | |
#linux | |
apt-get install putty-tools | |
puttygen keybase.ppk -O private-openssh -o output.pem | |
#connect | |
ssh -i output.pem user@your.server.com |
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
#add this content to your .bash_profile file | |
export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]\$ " | |
export CLICOLOR=1 | |
export LSCOLORS=ExFxBxDxCxegedabagacad | |
alias ls='ls -GFh' | |
#create a new file called darkside.terminal and add the following content | |
<?xml version="1.0" encoding="UTF-8"?> |
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
#add this code to your .bash_profile | |
#------ | |
export ANDROID_SDK_ROOT='/Users/<YOURUSER>/Library/Android/sdk' | |
export PATH=$PATH:$ANDROID_SDK_ROOT/tools:$ANDROID_SDK_ROOT/platform-tools:$ANDROID_SDK_ROOT/tools/lib/x86_644 | |
#------ |
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
#!/bin/bash | |
#-- create the swap | |
sudo fallocate -l 1G /swapfile | |
#-- change permission | |
sudo chmod 600 /swapfile | |
#-- do the swap | |
sudo mkswap /swapfile |