Google+ Location Sharing on Android and iPhone

Google+ Location Sharing on Android and iPhone

Google also has its own solution. Previously, Google offered Google Latitude, but that’s been discontinued. Instead, Google now offers location sharing built into Google+. This does mean you and the other people you want to share locations will all need Google+ accounts.

One big benefit of this solution is that it works across both Android phones and iPhones — perfect for an environment where not everyone has an iPhone.

To use it, install the Google+ app for Android or for iPhone.

On Android, open the app, tap the menu button, select Settings, and select the account you want to use.

On iPhone, open the menu, select Locations, tap the gear icon, and tap “Settings.” Tap “Location sharing” and enable it. Tap “Edit” next to “Pinpoint Location,” choose the people (or circles) you want to share your location with, and tap “Done.”

You can also choose just to share your “City Location” — the city you’re in, but not precisely where you are — with a wider variety of people.

People who want to share their locations with you will all have to do this on their phones, and you’ll have to do it on yours to share your location with them.

Go to the Locations section in the Google+ app to see these locations.

Varnish 4 – Failover Director

vcl 4.0;
import directors;
backend static_server {
    .host = "aa.bb.cc.dd";
    .port = "80";
    .probe = { .url = "/"; .timeout = 200 ms; .interval = 1s; .window = 6; .threshold = 5; }
}
backend static_server_2 {
    .host = "aa.bb.cc.ee";
    .port = "80";
    .probe = { .url = "/"; .timeout = 200 ms; .interval = 1s; .window = 6; .threshold = 5; }
}


sub vcl_init {
    new cluster = directors.fallback();
    cluster.add_backend(static_server);
    cluster.add_backend(static_server_2);

}

sub vcl_recv {
    set req.backend_hint = cluster.backend();

    #unset req.http.Cookie;
    #unset req.http.Cache-Control;

}

Ref: http://smemoratesysop.blogspot.com/2015/05/failover-director-for-varnish-40.html

Resetting a lost MySQL root password on Ubuntu

Stop MySQL

The first thing to do is stop MySQL. If you are using Ubuntu or Debian the command is as follows:

sudo service mysql stop

Safe mode

Next we need to start MySQL in safe mode – that is to say, we will start MySQL but skip the user privileges table. Again, note that you will need to have sudo access for these commands so you don’t need to worry about any user being able to reset the MySQL root password:

sudo mysqld_safe --skip-grant-tables &

Note: The ampersand (&) at the end of the command is required.

Login

All we need to do now is to log into MySQL and set the password.

mysql -u root

Note: No password is required at this stage as when we started MySQL we skipped the user privileges table.

Next, instruct MySQL which database to use:

use mysql;

Reset Password

Enter the new password for the root user as follows:

update user set password=PASSWORD("mynewpassword") where User='root';

and finally, flush the privileges:

flush privileges;

Restart

Now the password has been reset, we need to restart MySQL by logging out:

quit

and simply stopping and starting MySQL.

On Ubuntu and Debian:

sudo service mysql restart

Login

Test the new password by logging in:

mysql -u root -p

You will be prompted for your new password.

Ref: http://www.rackspace.com/knowledge_center/article/mysql-resetting-a-lost-mysql-root-password

How to Fix the “Wi-Fi: No Hardware Installed” Error on Mac OS X

What is the System Management Controller?

The SMC is a subsystem in Mac computers that helps control power management, battery charging, video switching, sleep and wake mode, LED indicators, keyboard backlighting, and a bunch of other stuff.

When your computer goes in and out of sleep mode, the SMC will control what devices are powered down to save battery. And this is where the problem lies. The SMC gets the wrong signal and thinks the Wi-Fi adapter should stay powered off even when the computer comes back to life.

Resetting the System Management Controller (to Fix Your Wi-Fi Problem)

If you’re using a device that doesn’t have a removable battery, which is pretty much all devices that Apple has made for a very long time, you’ll need to close down your apps and then use a simple key combination.

Newer MacBook without a Removable Battery

  1. Plug the laptop into a power source
  2. Press and hold all of these keys at the same time: Control + Shift + Option + Power
  3. Release the keys
  4. Press the Power button to turn it back on

This should fix the problem

Original Article: http://www.howtogeek.com/227662/how-to-fix-the-wi-fi-no-hardware-installed-error-on-os-x/

CLI backup WordPress

Backup www folder and Database into single tar.gz file run every 2Am at Saturday

mkdir /backup
echo "[client]
user=user
password=your_pass" > /etc/mysql/mysqldump.cnf

Backup Script

vi /opt/backup.sh
#!/bin/bash
#run: /opt/backup.sh sitename_in_var_www DB_name
SITE=$1
DB=$2
TIME=$(date +"%d-%m-%Y")
FILE="$SITE.$TIME.tar"
BACKUP_DIR="/backup"
WWW_DIR="/var/www/$SITE"
DB_NAME="$DB"
DB_FILE="$DB.$TIME.sql"
WWW_TRANSFORM="s,^var/www/$SITE,www,"
DB_TRANSFORM="s,^backup,database,"
tar -cvf $BACKUP_DIR/$FILE --transform $WWW_TRANSFORM $WWW_DIR
mysqldump --defaults-file=/etc/mysql/mysqldump.cnf $DB_NAME > $BACKUP_DIR/$DB_FILE
tar --append --file=$BACKUP_DIR/$FILE --transform $DB_TRANSFORM $BACKUP_DIR/$DB_FILE
rm $BACKUP_DIR/$DB_FILE
gzip -9 $BACKUP_DIR/$FILE
exit 0

Make it executable

chmod 700 /opt/backup.sh

Manually run

/opt/backup.sh site_name site_database
Verify content
tar -ztvf /backup/sitename.02-10-2015.tar.gz

Crontab Schedule: backup wordpress @2AM every Saturday

crontab -e
00 2 * * 5 /opt/backup.sh site_name site_database >/dev/null 2>&1

Reference: https://jay-baker.com/wordpress-automated-backup-script-with-rsync-and-systemd/