sumnima sumnima sumnima sumnima sumnima sumnima sumnima
Categories
blog cloudflare digitalocean Nginx

whitelisting cloudflare in nginx digitalocean

Create /etc/nginx/cloudflare-allow.conf

# https://www.cloudflare.com/ips
# IPv4
allow 199.27.128.0/21;
allow 173.245.48.0/20;
allow 103.21.244.0/22;
allow 103.22.200.0/22;
allow 103.31.4.0/22;
allow 141.101.64.0/18;
allow 108.162.192.0/18;
allow 190.93.240.0/20;
allow 188.114.96.0/20;
allow 197.234.240.0/22;
allow 198.41.128.0/17;
allow 162.158.0.0/15;

# IPv6
allow 2400:cb00::/32;
allow 2606:4700::/32;
allow 2803:f800::/32;
allow 2405:b500::/32;
allow 2405:8100::/32;

Then in your /etc/nginx/sites-available/site.com add:

server {
  listen 80; ## listen for ipv4; this line is default and implied
  listen [::]:80 default ipv6only=on; ## listen for ipv6

  include /etc/nginx/cloudflare-allow.conf;
  deny all;

  server_name direct.site.com www.site.com site.com;

  #...the rest of your config here...
}
Categories
blog OS X

OSX Terminal SSH port

ssh -p portnumber mysite.com
Categories
blog Linux Nginx ubuntu

Ubuntu php5-fpm unknown instance

sudo pkill php5-fpm; sudo service php5-fpm start
Categories
blog mysql

MySQL Access denied for user ‘root’@’localhost’

sudo apt-get remove --purge mysql-server mysql-client mysql-common
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt install mysql-server
Categories
blog Nginx

Increase file upload size limit in PHP-Nginx

Changes in php.ini

To change max file upload size to 100MB

Edit…

vim /etc/php5/fpm/php.ini

Set…

upload_max_filesize = 100M
post_max_size = 100M

Change in Nginx config

Add following line to http{..} block in nginx config: /etc/nginx/nginx.conf

http {
	#...
        client_max_body_size 100m;
	#...
}

Reload PHP-FPM & Nginx

service php5-fpm reload
service nginx reload

Categories
blog mysql

ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: YES)

sudo dpkg-reconfigure mysql-server-5.5

change the root password.

Categories
bigcommerce bigmadness blog offer Theme

Bigmadness.com Xmas Fever 50% off Code: big50off

https://twitter.com/officialstupid/status/676987514045997056

 

Categories
blog ecommerce magento magento 2 mysql

magento 2 installation on digitalocean #bookmark

last part.

go to bin

php magento sampledata:deploy
php magento setup:di:compile
php magento setup:upgrade 
 

Categories
blog OS X

magento 2 SUCKS!!!!!

Categories
.htaccess blog

htaccess update

############################################
## workaround for HTTP authorization
## in CGI environment

RewriteRule .* – [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

############################################
## TRACE and TRACK HTTP methods disabled to prevent XSS attacks

RewriteCond %{REQUEST_METHOD} ^TRAC[EK]
RewriteRule .* – [L,R=405]

######################################
## Add custom headers
<IfModule mod_headers.c>
Header set X-Content-Type-Options “nosniff”
Header set X-XSS-Protection “1; mode=block”
</IfModule>
Categories
blog ecommerce magento magento 2 mysql

magento 2 installation digitalocean lamp bookmark

magento 2 installation digitalocean lamp #bookmark

apt-get update
apt-get install git wget
wget -O /usr/local/bin/composer http://getcomposer.org/composer.phar
chmod +x /usr/local/bin/composer
cd /var/www/html

download and upload magento file https://www.magentocommerce.com/download

upload and unzip 
tar xjf file.tar.bz2
cd /var/www/html/theory
composer install
chown -R root:www-data /var/www/html/theory
find /var/www/html/theory -type f -print0 | xargs -r0 chmod 640
find /var/www/html/theory -type d -print0 | xargs -r0 chmod 750
chmod -R g+w /var/www/html/theory/{pub,var}
chmod -R g+w /var/www/html/theory/{app/etc,vendor}

DATABASE

https://www.digitalocean.com/community/tutorials/a-basic-mysql-tutorial

mysql -u root -p
SHOW DATABASES;
CREATE DATABASE database name;
 DROP DATABASE database name;
 
GRANT ALL PRIVILEGES ON databasename.* TO 'databaseuser'@'localhost' IDENTIFIED BY 'passwordfordatabase';

 

Categories
blog Elementary OS Linux ubuntu

remove folder and all of its contents – ubuntu

completely remove a folder and all of its contents, including both files and sub folders:

rm -R DIRECTORY_NAME

Categories
blog OS X

php5 for magento 2

sudo apt-get install php5-xsl

Sudo apt-get install php5-mcrypt

apt-get install php5-intl

service apache2 restart

Categories
blog digitalocean mysql

digitalocean upgrade mysql server 5.6

sudo apt-get purge mysql-server*

and after that, I did this:

sudo apt-get install mysql-server-5.6 

 

 

 

 

Start:

sudo /etc/init.d/mysql start

Stop:

sudo /etc/init.d/mysql stop

Restart / reload configs:

sudo /etc/init.d/mysql restart

Check run status:

sudo /etc/init.d/mysql status
Categories
blog ecommerce WooCommerce wordpress

woocommerce redirect to a custom page after logging out

// redirects for login / logout
add_filter(‘woocommerce_login_redirect’, ‘login_redirect’);

function login_redirect($redirect_to) {

return home_url();
}

add_action(‘wp_logout’,’logout_redirect’);

function logout_redirect(){

wp_redirect( home_url() );

exit();
}

Categories
.htaccess blog

.htaccess Deny IPs

Deny from 24.213.139.114
Deny from 87.144.218.222
Deny from 95.5.32.79
Deny from 213.251.186.27
Deny from 88.191.93.186
Deny from 91.121.136.44
Deny from 50.56.92.47
Deny from 174.143.148.105
Deny from 82.170.168.91
Deny from 24.213.139.114
Deny from 61.147.110.14
Deny from 188.134.42.65
Deny from 122.164.215.155
Deny from 65.49.68.173
Deny from 220.155.1.166
Deny from 218.38.16.26
Deny from 50.56.92.47
Deny from 24.213.139.114
Deny from 91.200.19.84
Deny from 31.44.199.131
Deny from 49.50.8.63
Deny from 171.221.126.73    – 8 days ago CN

Categories
blog css VIDEO youtube

How to create fluid width videos with CSS #BOOKMARK

http://www.creativebloq.com/html5/create-fluid-width-videos-8112993

<iframe> video (YouTube, Vimeo, etc)

Our little 100% width trick isn’t going to help us when dealing with video that is delivered via iframe. Setting a height is required, otherwise browsers will render the iframe at a static height of 150px, which is far too squat for most video and makes for more R&E (Ridiculous and Embarrassing). Literally all browsers will render iframe, canvas, embed, and object tags as 300px x 150px if not otherwise declared. Even if this isn’t present in the UA stylesheet.

The iframe above is missing its height attribute. While it's 100% width, its height is a static (and impractical) 150px
The iframe above is missing its height attribute. While it’s 100% width, its height is a static (and impractical) 150px

Fortunately there are a couple of possible solutions here. One of them was pioneered by Thierry Koblentz and presented on A List Apart in 2009: Creating Intrinsic Ratios for Video. With this technique, you wrap the video in another element which has an intrinsic aspect ratio, then absolute position the video within that. That gives us fluid width with a reasonable height we can count on.

    <div class=”videoWrapper”>
<!– Copy & Pasted from YouTube –>
<iframe width=”560″ height=”349″ src=”http://www.youtube.com/embed/n_dZNLr2cME?rel=0&hd=1″ frameborder=”0″ allowfullscreen></iframe>
</div>

    .videoWrapper {
position: relative;
padding-bottom: 56.25%; /* 16:9 */
padding-top: 25px;
height: 0;
}
.videoWrapper iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}

9 box
Whatever YouTube iframe embed code you paste within the .videoWrapper, you’ll see it presented in a fluid 16:9 box
Categories
blog domains

Clear the Google Chrome DNS cache

Clear the @Google #Chrome #DNS cache chrome://net-internals/#dns – #BOOKMARK

Categories
blog ecommerce WooCommerce wordpress

WooCommerce: always showing add-to-cart button even before variation is selected

add_action( ‘woocommerce_before_add_to_cart_button’, function(){
// start output buffering
ob_start();
} );

add_action( ‘woocommerce_before_single_variation’, function(){
// end output buffering
ob_end_clean();
// output custom div
echo ‘

‘;
} );

http://stackoverflow.com/questions/29377643/woocommerce-always-showing-add-to-cart-button-even-before-variation-is-selected

Categories
blog ecommerce WooCommerce wordpress

woocommerce Change Related Product Text

gettext – The Most Useful Filter in WordPress http://speakinginbytes.com/2013/10/gettext-filter-wordpress/

/**
* Change text strings
*
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
*/
function my_text_strings( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case ‘Related Products’ :
$translated_text = __( ‘You may also like these’, ‘woocommerce’ );
break;
}
return $translated_text;
}
add_filter( ‘gettext’, ‘my_text_strings’, 20, 3 );