Links

GlusterFS fix faulty bricks

GlusterFS fix faulty bricks

Great tutorial to manage glusterFS : readthedocs if you are getting error like volume add-brick: failed: Incorrect number of bricks supplied 1 with count 2 Then you are trying to add  distribute leg, which requires multiple bricks based on replication setting, try following command gluster vol add-brick <vol-name> <brick1><brick2>

Fix Logitech MX Master Scroll Wheel Issue

Fix Logitech MX Master Scroll Wheel Issue

https://toemat.com/logitech-mx-master-fix/

Cache a large array: JSON, serialize or var_export?

Cache a large array: JSON, serialize or var_export?

http://techblog.procurios.nl/k/n618/news/view/34972/14863/cache-a-large-array-json-serialize-or-var_export.html

Writing modular JavaScript without polluting the global namespace

Writing modular JavaScript without polluting the global namespace

http://marcofranssen.nl/writing-modular-javascript-without-polluting-the-global-namespace/

HTML5 a tag download Attribute

HTML5 a tag download Attribute

In HTML5, you can download file when clicking on the link instead of redirecting to the file. Read More : http://www.w3schools.com/tags/att_a_download.asp

A proper way to prepare IN Query in WordPress

A proper way to prepare IN Query in WordPress


<?php
global $wpdb;
if ( is_array( $ids ) ) {
$in_str_arr = array_fill( 0, count( $ids ), '%d' );
$in_str = join( ',', $in_str_arr );
$form_id_where = $wpdb->prepare( "ID IN ($in_str)", $ids );
} else {
$form_id_where = $ids> 0 ? $wpdb->prepare( 'ID=%d', $ids ) : '';
}

WordPress Multisite Crontab using WP-CLI Raw

WordPress Multisite Crontab using WP-CLI Raw


WP_PATH="/var/www/site_path"
for SITE_URL in = $(wp site list –fields=domain,path,archived,deleted –format=csv –path="$WP_PATH" | grep ",0,0$" | awk -F ',' '{print $1 $2}')
do
echo $SITE_URL
for EVENT_HOOK in $(wp cron event list –format=csv –fields=hook,next_run_relative –url="$SITE_URL" –path="$WP_PATH" | grep 'now$' | awk -F ',' '{print $1}')
do
echo $EVENT_HOOK
wp cron event run "$EVENT_HOOK" –url="$SITE_URL" –path="$WP_PATH" > /dev/null 2>&1
done
done

view raw

wp-mu-cron.sh

hosted with ❤ by GitHub

How to add Swap on ubuntu

How to add Swap on ubuntu

https://www.digitalocean.com/community/articles/how-to-add-swap-on-ubuntu-12-04

Java User Agent Detection code

Java User Agent Detection code

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 Show hidden characters /* ******************************************* // LICENSE INFORMATION //