MySQL on Fedora 27

While updating my class image to Fedora 27, I noticed that it installed the Akonadi Server. The documentation on the Akonadi server lacked some straightforward documentation. It also offered a bundled set of software that limited how to approach MySQL development.

So, I removed all those packages with the following syntax:

dnf remove `rpm -qa | grep akonadi`

After removing those Akonadi packages, I installed the MySQL Community Edition from the Fedora repo with this syntax:

yum install -y community-mysql*

Having installed MySQL Community Edition, I started the service with this command:

sudo service mysql start

Then, I ran the mysql_secure_installation script to secure the installation:

mysql_secure_installation

The script set the root user’s password, remove the anonymous user, disallow remote root login, and remove the test databases. Then, I verified connecting to the MySQL database with the following syntax:

mysql -uroot -ppassword

I enabled the MySQL Service to start with each reboot of the Fedora instance. I used the following command:

systemctl enable mysqld.service

It creates the following link:

ln -s '/etc/systemd/system/multi-user.target.wants/mysqld.service' '/usr/lib/systemd/system/mysqld.service'

Now, I need to install and configure Apache, PHP, and upgrade Oracle Database 11g XE’s APEX 4 to 5.

via Planet MySQL
MySQL on Fedora 27

Worst Man-Made Disasters In History

Man-made disasters, ones in which human activity (or inaction) causes or indirectly leads to environmental destruction and health issues, can have devastating long-term effects. The Onion looks back at the worst man-made disasters in modern history.


Castle Bravo (1954):

This American thermonuclear hydrogen test at the Marshall Islands caused significant radiological contamination, which is why it was so smart to test it someplace that wasn’t the U.S.


Ecocide In Vietnam (1950s-1970s):

The U.S. justified its mass destruction of farmland during the Vietnam War by insisting it was vital to defeat the growing dangers posed by rice.


Shrinking Of The Aral Sea (1960s-Present):

Boo-hoo, some water disappeared, get over it already.


Thomas Jefferson Middle School (1972-Present):

Asbestos, lead paint, black mold—the whole nine yards.


Bhopal Disaster (1984):

You really don’t even want to know about this.


Chernobyl Nuclear Explosion (1986):

This catastrophic nuclear explosion was a large-scale tragedy contaminating many people, but you should totally Google it if you wanna see some real gnarly tumors.


Exxon Valdez Oil Spill (1989):

This devastating incident caused the deaths of at least 2,800 sea otters, 300 harbor seals, and a bunch of other, less photogenic animals.


Deepwater Horizon Oil Spill (2010):

The moment when oil companies discovered there is truly no limit to human indifference.


Battleship (2012):

Hasbro tried to cash in on one of its most tried-and-true board games, but even Liam Neeson and Rihanna couldn’t bring light to this disaster of a film.


Old Poland Spring Bottle Spill (2096):

Some idiot forgets to screw the cap all the way back on the bottle containing Earth’s last remaining fresh water. 

via The Onion
Worst Man-Made Disasters In History

Syncthing Synchronizes Your Files Without Giving Them Up to a Third-Party Service

There’s nothing inherently wrong with Dropbox, Google Drive, or whatever popular service you use to back files up to the cloud and keep them synchronized between your multiple desktops and laptops. However, data privacy is becoming a bigger deal, and we wouldn’t question you if you’re ready to make the leap away from these kinds of services.

The open-source utility Syncthing is a great way to get all the benefits of local file synchronization without having to give up your data to another company (no matter how much they promise they’ll never look at it). The trade-off is that Syncthing is a bit trickier to manage than a service like Dropbox, which makes it painfully easy to upload, download, and sync your files across all your devices.

Switching to Syncthing requires some setup

To get started, head on over to Syncthing’s site and look for a link to SyncTrayzor—a windows utility that allows you to use the program through a pretty GUI instead of the headache-inducing command line. Download the appropriate version for your Windows PC (32- or 64-bit), or the portable version if you feel like being different, and install (or run) the app. Repeat that process on every computer you want to incorporate into your big file-synchronization plan.

Advertisement

When you launch SyncTrayzor, you’ll first want to link together all the different systems that will be sending and receiving files. For simplicity’s sake, we’ll pretend we’re linking together two Windows desktop PCs: System A and System B.

On System A, click on the “Add Remote Device” button. On System B, click on the Actions button in the upper-right corner and select “Show ID.” Copy the absurdly long device identification code from System B into the Device ID field on System A. Enter a Device Name for System B (like “Laptop.”) Click on save.

Now, repeat this process in reverse—add System A onto System B’s version of SyncTrayzor, using System A’s device ID. Think of this process as creating a friendship between your two devices. If both don’t want to be pals, they won’t trade secrets. If each recognizes the other, though, they’ll just chat and chat forever.

Advertisement

Got it? Now, SyncTrayzor on one of your computers (say, System A), and click on the “Add Folder” button in the upper-left portion of the app. Pick the folder you want to synchronize across your multiple systems, give it a Folder Label (a name) you’ll recognize, and select which devices you want to share the folder to. Repeat this process for every folder you want to synchronize (or just create a new folder somewhere called “Sync” and dump all your stuff in there, Dropbox-style).

SyncTrayzor should now, in theory, start automatically dumping your synchronized folder across all the systems you selected. If it’s screwing up at all, or doesn’t appear to be working, make sure that you don’t have some kind of internal network issue that’s messing things up. You can also restart SyncTrayzor from the Actions menu, which might clear up your issue on any (or all) systems.


via Lifehacker
Syncthing Synchronizes Your Files Without Giving Them Up to a Third-Party Service

The Fundamentals of Advanced Shooting: Master the Fundamentals

All my students want to become better shooters. Some aspire to being more than just proficient. They want to develop their skills to the point where they’re confident that they’re more than ready and can perform well, either in a self-defense situation or in competition. In short, they want to become and advanced shooter.

If I had to describe what it means to be an “advanced” shooter, it’s deceptively simple: mastery of the fundamentals. All of them. Then learning to execute them consistently and faster than the other guy. That’s it.

But doing things faster is one thing. Even a rank beginner can usually manage to yank a handgun out of a holster and squeeze off a few shots relatively rapidly. The goal is to do it repeatedly and with precision, and that takes training. Training in the fundamentals of stance, draw, grip, aim and control, followed by lots of practice and repetition.

The Key Is Standards
When we talk speed, the biggest challenge to getting there is achieving consistency and developing standards. When defining standards that a shooter works to attain, they must be observable, measurable and the big one…repeatable.

If you’re all over the place, the biggest mistake you can make is continuing to practice and run your drills at what feels like full speed. You might achieved some intermittent success at advanced speeds, but without mastering the fundamentals and developing consistency, you’re not truly advanced. It’s time to slow down and master the fundamentals.

You won’t truly be an advanced shooter until you can meet minimum accuracy standards, repeatedly and on command, at full speed. That’s when you’ll know you’re dialed in.

Luck Has Nothing to do with it
Early on in our classes, I ask students to only shoot as fast as they can while accurately hitting the target zone. Many mistake my instruction, thinking I want them to shoot as fast as they can, hoping that they’re lucky enough to hit the target. But luck isn’t a strategy.

Instead, I want students to hone in on perfecting good technique with minimal extraneous movement. To work on each part of the draw-and-fire sequence, with economy of motion, executing each aspect of the whole as perfectly as they can. Even if it takes them a full minute or more to complete a draw-and-fire five-shot sequence perfectly, with all five shots in the target zone, I’m happy.

The goal is to perfect the basic techniques so that they’re repeatable to the point where the shooter can’t miss at slower speeds. The light bulb truly goes on when the student recognizes speed is only a byproduct of mastering good technique, practiced until it’s truly second nature.

Only then do I have them begin to dial up the speed, gradually, in a controlled manner. As long as they’re achieving 75-80% accuracy while maintaining good form and technique, I’m happy while they work at gradually increased pace.

It’s Not That Hard
When your technique is dialed in, your mistakes become fewer and fewer. This bring about a higher level of confidence in your ability to perform on command, regardless of circumstances.

The goal is to be able to execute when you least expect it, because you’ve practiced and developed the muscle memory to perform well without thinking. I tell my students the story of a famous sculptor being asked by a student how he creates his masterpieces. The artist’s reply: it is simple, I chip away the rock until only the sculpture remains.

The principle is very similar for shooters. We try to get rid of any unnecessary or redundant movement so all we’re left with is the minimal motion necessary to accomplish the task. Over time, the byproduct of that perfected technique — developed with plenty of practice — is increased speed.

Becoming an advanced shooter is a matter of doing everything, all the essential skills involved, consistently and well. Only then can you go as fast as you can, letting it all out when it really counts.

 

Jeff Gonzales is a former US. Navy SEAL and preeminent weapons and tactics instructor. He brings his Naval Special Warfare mindset, operational success and lessons learned unapologetically to the world at large. Currently he is the Director of Training at The Range at Austin. Learn more about his passion and what he does at therangeuastin.com.

via The Truth About Guns
The Fundamentals of Advanced Shooting: Master the Fundamentals

FBI Claims 8 Active Shooters Thwarted By Good Guy With A Gun

Every time there’s a mass shooting, gun owners routinely comment that we only wish there’d been a good guy with a gun there to stop the attack. Anti-gunners routinely scoff at such a suggestion, arguing that good guys with a gun don’t stop mass shootings.

So, who is right?

Well, according to the FBI, we are.

Citizens, both armed and unarmed, successfully intervened in eight active shooter incidents over the last two years, according to a new report from the FBI.

The agency said the “selfless actions” of those who thwarted the attacks “likely saved many lives.” In total, the FBI recorded 943 casualties — 221 deaths and 722 injuries — across 50 mass shootings, including 20 in 2016 and 30 in 2017. All the shooters were male, ranging in age from 14 to 66, according to the report.

“The enhanced threat posed by active shooters and the swiftness with which active shooter incidents unfold support the importance of preparation by law enforcement officers and citizens alike,” the report concludes.

In one instance of citizen-involvement, an armed volunteer firefighter restrained a 14-year-old who opened fire at an elementary school playground in Townville, South Carolina, killing two and injuring three others. In another case, a citizen held an attacker at gunpoint inside a church in Antioch, Tennessee after he killed a person in the parking lot and wounded six others.

The most high profile was Stephen Willeford who famously stopped the shooter at Sutherland Springs last year.

However, what we see time and again is a simple statement that anti-gunners refuse to acknowledge. Guns save lives. They’ve saved an untold number of lives in just these eight incidents.

You never know when something like this is going to go down, which is why armed citizens are so important. The more places there are and the more of them there are, the greater the chance of an armed citizen being able to stop it.

The police, despite their best efforts and desires, simply can’t stop these things. They’re almost never in the right place at the right time. While I have little doubt that just about every police officer in the nation, with some exceptions, wouldn’t hesitate to rush into a such a situation, they don’t have the opportunity most of the time. By the time they get there, it’s too late for far too many people.

But an armed citizen can act. They can be there, ready to respond to the threat.

Meanwhile, anti-gun zealots spend all their time trying to disarm these people, the good people who put their lives on the line for their fellow man and fail to understand that the bad guys won’t stop. At most, they’ll shift weapons to something else. That’s only if they don’t know how to get their hands on firearms illegally, which many of them do.

It’s the armed citizen that stands against these atrocities. It’s also the armed citizen that is the one who will ultimately suffer for every policy proposed by anti-gun jihadis. Not that the anti-gunners care.

After all, in their minds, the good guy with a gun doesn’t exist, even though the FBI says otherwise.

via Bearing Arms
FBI Claims 8 Active Shooters Thwarted By Good Guy With A Gun

6 Apps to Customize Your Mac’s Keyboard Behavior

Advertisement

Do you want your Mac’s function keys back? Does the Caps Lock key seem like a waste of space? Would you rather put the unused right Shift key to better use?

If you’re looking for a way to customize basic keyboard behavior, add new shortcuts, remap keystrokes, or navigate quickly without reaching for your mouse, you can do it all with a few (mostly free) apps.

1. Karabiner-Elements

Karabiner-Elements for Mac

Previously known as “keyremap4macbook” and just “Karabiner” before that, Karabiner-Elements has been rebuilt for scratch specifically for macOS Sierra and above.

You can use it remap your entire keyboard, whether it’s a MacBook, Magic Keyboard, or third-party USB input. It can make simple modifications, like remapping one key to behave as if it was another, or make complex modifications based on rules of your choosing. Many of these rules are available for download so you don’t have to build them yourself.

Reclaim your function keys by disabling special functions like brightness and volume control. You can assign those media keys to entirely different functions, and apply the special functions to regular old keys—like Caps Lock or right Shift.

The app lets you set up profiles, apply your changes on a per-keyboard basis, or create blanket rules that affect all input devices. It’s one of those apps that you don’t need until you realize what it can do, and how much productivity you’ve been missing out on.

Download: Karabiner-Elements (Free)

2. Thor

Thor for Mac

Thor is a simple lightweight tool for switching to the right application with a dedicated shortcut. The app’s beauty lies in its simplicity: pick an app, click Record Shortcut, and specify a combination of keys. Thor will instantly switch to or launch the app of your choosing when you trigger the shortcut.

You can quickly disable Thor by double-tapping a modifier key of your choosing. The worst part is deciding on which shortcuts to use. I found the Control key most useful, since it doesn’t get in the way like some of the other modifiers. Plus, shortcuts like Control + S for Safari or Control + E for Evernote are easy to remember.

There are other apps that can do what Thor does, but they’re usually far more complex and built around other functions. They’re also nowhere near as lightweight; Thor clocks in with a download size of 2.8MB from the Mac App Store.

Download: Thor (Free)

3. Keyboard Maestro

Easily one of the most powerful apps of its kind on macOS, Keyboard Maestro provides a dizzying array of customization for those who need it. The app is built around the principle of triggers and actions, and its usefulness isn’t just limited to keystroke triggers either.

Arguably the app’s biggest selling point is the ability to create as many shortcuts as you want. One example is using a keyboard shortcut to type a piece of information, like your name or email address. The app also functions as a text expansion app


What Is Text Expansion & How Can It Help You Save Time?




What Is Text Expansion & How Can It Help You Save Time?

If you could save yourself even a small fraction of the time you spend typing, you could save hours of your time every week. That’s exactly what text expansion is for.
Read More

, allowing you to replace a trigger phrase like myname with a longer string like John Doe.

This is just the tip of what Keyboard Maestro can do, hence its $36 price tag. For your money you’ll get:

  • A fully-featured clipboard manager
  • AppleScript and XPath support
  • Window and mouse cursor manipulation
  • An application launcher and iTunes remote
  • Action-based macros, like the ability to open or delete specific files with a trigger
  • Touch Bar manipulation on the latest MacBook Pro
  • MIDI control, for triggering actions with MIDI input devices
  • Hundreds of actions and triggers

Fortunately, you can download Keyboard Maestro and try it out for yourself before you buy. If you’re an automation nerd, or simply looking for a way to trigger scripts, macros, and other desktop events, Keyboard Maestro is the ultimate app.

Download: Keyboard Maestro ($36, free trial available)

4. Fluor

Fluor for Mac

Just like Thor, Fluor is a simple app with a single goal: to define function key behavior depending on the currently active application. This is particularly handy when apps have a lot of keyboard shortcuts that require use of the function keys, or when playing games.

The app simply switches the behavior of the function keys, so in order to access the special (media) key functions, you have to hold the Fn key. You can create a custom set of rules for each app. Or you can activate an app, click on the Fluor icon in the menu bar, and select a preferred behavior.

It’s a great way to set up custom rules for particular apps, without having to pay for a more complex piece of software. This works best when used sparingly, so you don’t get confused about the default behavior when you hit a key.

Download: Fluor (Free)

5. Kawa

Kawa for Mac

Another basic app with one purpose, Kawa lets you bind a keyboard shortcut to a particular language input. It was designed out of necessity by the developer who frequently switched between keyboard layouts.

macOS uses the Command + Space shortcut to switch between input sources, but adding a third complicates this. Kawa lets you record language-specific keyboard shortcuts which instantly change the input to that of your choosing.

For best results, enable Show Input menu in menu bar under System Preferences > Keyboard > Input Sources so you can quickly glance at your currently selected language. Unfortunately the app is unsigned, so you’ll need to circumvent Gatekeeper restrictions to use it.

Download: Kawa (Free)

6. Shortcat

Shortcat for Mac

It’s no secret that taking your fingers off the keyboard slows you down. Shortcat aims to solve that problem by removing the need to reach for your mouse and trackpad. All you need to do is activate Shortcat with the keyboard shortcut, then start typing the name of an on-screen element.

Shortcat will highlight anything that matches your typed query. You can then “click” on the right element by holding Control and the relevant shortcut displayed on screen. You can also Tab between elements and click, double-click, or hover using the relevant shortcut.

If you’re willing to put the time into learning how to use Shortcat, you’ll be navigating your Mac without a pointing device like a pro. It works system-wide and in applications like Skype, though it won’t work for every third-party app you come across (I couldn’t get it working in Slack, for example).

Download: Shortcat ($18, free trial/beta available)

More Ways to Improve Mac Productivity

Now that your keyboard is set up the way you like it, try improving your Mac workflow with hot corners. By modifying your workstation to speed up your workflow, you’ll get more done in less time. To take this to the next level, download a few more Mac productivity wonders


13 Free Mac Productivity Apps You Haven’t Heard Of




13 Free Mac Productivity Apps You Haven’t Heard Of

There’s a misconception among Mac users that good apps are always paid, but you’ll find plenty of excellent free apps if you know where to look.
Read More

.



via MakeUseOf.com
6 Apps to Customize Your Mac’s Keyboard Behavior

My MySQL Database is Corrupted… What Do I Do Now?

How do MySQL tables get corrupted? There are many ways to spoil data files. Often, corruption is due to defects in the underlying platform, which MySQL relies on to store and retrieve data – disk subsystem, controllers, communication channels, drivers, firmware or other hardware faults. Data corruption can also occur if the MySQL server daemon restarts suddenly, or your server reboots due to a crash of other OS components. If the database instance was in the middle of writing data to disk, it could write the data partially which may end up with a page checksum that is different than expected. There have also been bugs in MySQL so even if the server hardware is ok, MySQL itself can cause corruption.

Usually when MySQL data gets corrupted the recommendation is to restore it from the last backup, switch to DR server or take down the affected node if you have Galera cluster to serve data immediately from other nodes. In some cases you can’t – if the backup is not there, the cluster was never set up, your replication is down for a very long time, or the DR procedure was never tested. Even if you have a backup, you may still want to take some actions to attempt recovery as it may take less time get back online.

MyISAM, the bad and ugly

InnoDB is more fault-tolerant than MyISAM. InnoDB has auto_recovery features and is much safer as compared to the older MyISAM engine.

MyISAM tables can easily get corrupted when lots of writes happen and a lot of locks happen on that table. The storage engine "writes" data to the filesystem cache, which may take some time before it is flushed to disk. Therefore if your server restarts suddenly, some unknown amount of data in the cache is lost. That’s a usual way for MyISAM data to be corrupted. The recommendation is to migrate from MyISAM to InnoDB, but there may be cases where this is not possible.

Primum non nocere, the backup

Before you attempt to repair corrupted tables, you should back your database files first. Yes, it’s already broken but this is to minimize the risk of possible further damage which may be caused by a recovery operation. There is no guarantee that any action you take will not harm untouched data blocks. Forcing InnoDB recovery with values greater than 4 can corrupt data files, so make sure you will do it with prior backup and ideally on a separate physical copy of the database.

To back up all of the files from all of your databases, follow these steps:

Stop the MySQL server

service mysqld stop

Type the following command for your datadir.

cp -r /var/lib/mysql /var/lib/mysql_bkp

After we have a backup copy of the data directory, we are ready to start troubleshooting.

Data corruption identification

The error log is your best friend. Usually, when data corruption happens, you will find relevant information (including links to documentation) in the error log. If you don’t know where it’s located, check my.cnf and variable log_error, for more details check this article https://dev.mysql.com/doc/refman/8.0/en/error-log-destination-configuration.html. What you should also know is your storage engine type. You can find this information in the error log or in information_schema.

mysql> select table_name,engine from information_schema.tables where table_name = '<TABLE>' and table_schema = '<DATABASE>';

The main tools/commands to diagnose issues with data corruption are CHECK TABLE, REPAIR TABLE, and myisamchk. The mysqlcheck client performs table maintenance: It checks, repairs (MyISAM), optimizes or analyzes tables while MySQL is running.

mysqlcheck -uroot -p <DATABASE>

Replace DATABASE with the name of the database, and replace TABLE with the name of the table that you want to check:

mysqlcheck -uroot -p <DATABASE> <TABLE>

Mysqlcheck checks the specified database and tables. If a table passes the check, mysqlcheck displays OK for the table.

employees.departments                              OK
employees.dept_emp                                 OK
employees.dept_manager                             OK
employees.employees                                OK
Employees.salaries
Warning  : Tablespace is missing for table 'employees/salaries'
Error    : Table 'employees.salaries' doesn't exist in engine
status   : Operation failed
employees.titles                                   OK

Data corruption issues may be also related to permission issues. In some cases, OS can switch mount point to read-only mode due to R/W issues or this can be caused by a user who accidentally changed ownership of the data files. In such cases, you will find relevant information in the error log.

[root@node1 employees]# ls -rtla
...
-rw-rw----. 1 mysql mysql  28311552 05-10 06:24 titles.ibd
-rw-r-----. 1 root  root  109051904 05-10 07:09 salaries.ibd
drwxr-xr-x. 7 mysql mysql      4096 05-10 07:12 ..
drwx------. 2 mysql mysql      4096 05-10 07:17 .

MySQL Client

MariaDB [employees]> select count(*) from salaries;
ERROR 1932 (42S02): Table 'employees.salaries' doesn't exist in engine

Error log entry

2018-05-10  9:15:38 140703666226944 [ERROR] InnoDB: Failed to find tablespace for table `employees`.`salaries` in the cache. Attempting to load the tablespace with space id 9
2018-05-10  9:15:38 140703666226944 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2018-05-10  9:15:38 140703666226944 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2018-05-10  9:15:38 140703666226944 [ERROR] InnoDB: Cannot open datafile for read-only: './employees/salaries.ibd' OS error: 81
2018-05-10  9:15:38 140703666226944 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2018-05-10  9:15:38 140703666226944 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2018-05-10  9:15:38 140703666226944 [ERROR] InnoDB: Could not find a valid tablespace file for `employees/salaries`. Please refer to http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting-datadict.html for how to resolve the issue.
ClusterControl
Single Console for Your Entire Database Infrastructure
Find out what else is new in ClusterControl

Recovering InnoDB table

If you are using the InnoDB storage engine for a database table, you can run the InnoDB recovery process.
To enable auto recovery MySQL needs innodb_force_recovery option to be enabled. Innodb_force_recovery forces InnoDB to start up while preventing background operations from running, so that you can dump your tables.

To do this open my.cnf and add the following line to the [mysqld] section:

[mysqld]
innodb_force_recovery=1
service mysql restart

You should start from innodb_force_recovery=1 save the changes to my.cnf file, and then restart the MySQL server using the appropriate command for your operating system. If you are able to dump your tables with an innodb_force_recovery value of 3 or less, then you are relatively safe. In many cases you will have to go up to 4 and as you already know that can corrupt data.

[mysqld]
innodb_force_recovery=1
service mysql restart

If needed change to the higher value, six is the maximum and most dangerous.

Once you are able to start your database, type the following command to export all of the databases to the databases.sql file:

mysqldump --all-databases --add-drop-database --add-drop-table > dump.sql

Start mysql, and then try to drop the affected database or databases using the DROP DATABASE command. If MySQL is unable to drop a database, you can delete it manually using the steps below after you stop the MySQL server.

service mysqld stop

If you were unable to drop a database, type the following commands to delete it manually.

cd /var/lib/mysql
rm -rf <DATABASE>

Make sure you do not delete the internal database directories.
After you are done, comment out the following line in the [mysqld] to disable InnoDB recovery mode.

#innodb_force_recovery=...

Save the changes to the my.cnf file, and then start the MySQL server

service mysqld start

Type the following command to restore the databases from the backup file you created in step 5:

mysql> tee import_database.log
mysql> source dump.sql

Repairing MyISAM

If mysqlcheck reports an error for a table, type the mysqlcheck command with -repair flag to fix it. The mysqlcheck repair option works while the server is up and running.

mysqlcheck -uroot -p -r <DATABASE> <TABLE>

If the server is down and for any reason mysqlcheck cannot repair your table, you still have an option to perform recovery directly on files using myisamchk. With myisamchk, you need to make sure that the server doesn’t have the tables open.

Stop the MySQL

service mysqld stop
cd /var/lib/mysql

Change to the directory where the database is located.

cd /var/lib/mysql/employees
myisamchk <TABLE>

To check all of the tables in a database, type the following command:

myisamchk *.MYI

If the previous command does not work, you can try deleting temporary files that may be preventing myisamchk from running correctly. To do this, change back to the data dir directory, and then run the following command:

ls */*.TMD

If there are any .TMD files listed, delete them:

rm */*.TMD

Then re-run myisamchk.

To attempt repair a table, execute the following command, replacing TABLE with the name of the table that you want to repair:

myisamchk --recover <TABLE>

Restart the MySQL server

service mysqld start

How to avoid data loss

There are several things you can do to minimize the risk of unrecoverable data. First of all backups. The problem with backups is that sometimes they can be overlooked. For cron scheduled backups, usually we write wrapper scripts that detect problems in the backup log, but that does not include cases when the backup didn’t start at all. Cron can sometimes hang and often there is no monitoring set on it. Another potential issue could be the case when the backup was never set up. The good practice is to run reports from a separate tool that will analyze the backup status and inform you about missing backups schedules. You can use ClusterControl for that or write your own programs.

ClusterControl operational backup report

ClusterControl operational backup report

To reduce the impact of the possible data corruption you should always consider clustered systems. It’s just a matter of time when the database will crash or get corrupted, so it’s good to have a copy which you can switch to. It could be Master / Slave replication. The important aspect here is to have safe automatic recovery to minimize the complexity of the switchover and minimize the recovery time (RTO).

ClusterControl auto recovery features

ClusterControl auto recovery features

via Planet MySQL
My MySQL Database is Corrupted… What Do I Do Now?

The Best Disney World Travel Tips From Our Readers

Cinderella’s Castle at the Magic Kingdom

This week we hacked a theme park instead of a city, with a frankly intimidating 275 comments full of tips on visiting Disney World. (Would have loved some tips for living at Disney World; maybe next time.) Here are some of the best.

Each Monday on Hack Your City, we ask readers for your best tips on a city: driving tips, restaurant recs, things to do, and any other advice for visitors and locals. Then on Thursday, we present the best comments. We’re working our way around the U.S. and around the globe.

Save money

  • “Bring your own food and drinks. Disney allows coolers and bags up to a certain size into the park (it will be checked at the gate for any contraband) but you are free to bring food and drinks into the park (no glass and no alcohol). Also, anywhere you can get fountain soft drinks will give you free cups of water.”—gatorbait28
  • “If you have an Amazon Prime Pantry account, we have items like snacks and water shipped directly to the room. We usually get items that we can make quickly and eat while waiting for transportation like instant oatmeal or doughnuts.”—Ron Jones
  • “When you get a burger, order a double burger and an extra bun. Conversely, some places will let you order just the entree without the sides (chicken nuggets without fries). This will save you about $2.”—echo125488
  • You can buy plenty of Disney souvenirs cheaper at other stores, which might seem weird, but as gatorbait points out, you can get a cheaper autograph book for the costumed characters to sign.
  • Characters also trade pins with guests. Mel buys about 50 pins on eBay before going to the park, so they and their son have plenty of pins to trade in for new ones. “My son always asks them for trivia questions. If you get the question right, they’ll show you what their mystery pins are prior to a trade.”
  • “If you’re going for more than 10 days over a 1 year period, the annual pass is the best deal. Annual passholders receive free parking at the parks. You also receive a discount at some dining locations and on some merchandise.”—PurpleWaterBottle
The Tree of Life at the Animal Kingdom

Use the meal plan

  • The meal plan isn’t for saving money; it could actually cost more. It’s for guaranteeing spots at the best restaurants, and saving yourself the time and decision-making process once you get into the park.
  • “I am a huge fan of the deluxe meal plan. The best way to use it is to have a big breakfast/brunch at one of the buffets, use your snacks throughout the day if you get hungry, and then use two meal credits for dinner at the nicest places in the resort. It sounds like a waste to use two meals at once (especially considering the price), but a lot of them are really worth it. Our best memory from our last trip was watching the fireworks from the California Grill at the Contemporary.”—jodathejoda
  • “If you get a package deal and get a meal plan, you can also make use of it at Disney Springs (formerly Downtown Disney) at a number of their restaurants.”—Texas Native
  • “It is way cheaper to just pay for meals out of pocket. Even if it is offered free, do not get it as taking the free meal plan means that you do not qualify for room discounts, which have a higher value.”—Jamie McKillop
  • “The Dining Plan is cheaper than buying the same foods al a carte. I think for 5 nights it’s about $1200 for 4 people (one child). That’s $60/day/person. Yes, you *can* eat more cheaply, but I really appreciate sitting down in a real restaurant a few times as a break from the heat and crowds. The quick service places are usually a nightmare.”—NotYeezus

Plan ahead

  • “Make sure to book your 3 fast passes before going to the park. If you are staying at a resort on property, you can book fast passes up to 60 days in advance. If you are not staying on property, you can book fast passes up to 30 days in advance.”—gatorbait28
  • “Once you decide to go on a trip, if you have a Target Red card, start buying Disney gift cards. You will get 5% off the face value (or 10-15% if they are having a gift card promotion). You can use the gift cards for anything in the parks, including food. We think of the cards as the Disney ‘savings’ account.”—Ron Jones
  • On certain days, resort guests can enter the park before anyone else for “magic hours,” say bnceo and Taipans. Check Disney’s calendar when planning your trip.
Sorcerer’s Hat at Hollywood Studios

Use these resources

  • Get Disney’s official app. “I cannot emphasize downloading the app and bringing spare battery chargers enough,” says Zoom. “Downloading the app lets you maximize your FastPass usage because it tells you the current wait times. It also lets you plan your route around the park more efficiently.”
  • Undercover Tourist’s crowd calendar predicts crowd sizes for each park on any given day. Some commenters disagree on how well these third-party guides really work, but at least most of them are cheap or free.
  • For $15, you can plan your trip on the Touring Plans app, which helps you optimize which rides to take in what order. “They keep tons of data for every ride, every day and can predict within ~30 seconds how long every ride wait will be,” says Ridley90.
  • AllenaTapia recommends looking up all the suggestions of “Tour Guide Mike,” a.k.a. Michael’s VIPs. Five years ago Allena used Mike’s strategies and “never waited in line more than 30 minutes, high season.”
  • “Use a Disney Travel Agent,” says jodathejoda. “They are free, and they help a ton in getting everything scheduled and making reservations.”
  • WinglessVictory has a tip from The Unofficial Guide to Disney World. “For rides that aren’t continuously loading (like Dumbo, and the tea cup ride) they recommend the Bubba Relay. Dad gets in line with the kids and Mom counts back however many people the ride will hold and gets in line. By the time Dad gets off with the kids, Mom will be toward the front of the line and she can take the kids on again.”

Time it right

  • Disney World is never quite out of season, but its crowds do ebb and flow. “Generally,” says WoodenRobot, “Orlando is least crowded after Labor Day weekend and before fall break.” Gatorbait28 also recommends January and February. But avoid marathon week in January, says dakpluto.
  • Show up early, 30-60 minutes before the morning “rope drop.” “You’ll have the run of the park for a few hours,” says MarkK. “My family has gotten there early enough that our bodies were brushing up against the chain they drop to let people in. We got on all the popular, slow-loading rides in the first two hours,” says HGHyouworksogood.
  • Nap in the afternoon! Many many commenters recommend this, especially if you’ve gotten to the park early. Get indoors, chill at your resort or hotel, then go back for the evening.

Prep your kids

  • Commenters agreed that strollers will save you. “If your kids are small enough to fit into a stroller, stuff them in one,” says HGHyouworksogood. “I did for my 5- and 3-year-old. It gets you around the park faster, saves their legs from walking fatigue and keeps them from wandering off.”
  • Or (and of course this depends on the kid) wait until your kids are older. “It may sound kinda harsh, but DO NOT go to Disney with kids under 5 years old. The simple fact is that they can’t endure it, don’t comprehend it and won’t remember it. Conversely, kids in the 8, 9, 10 range are enthralled by the experience, have much more physical and emotional stamina and will remember it forever.”—andrewb812
Spaceship Earth at Epcot

Get in position

  • For a good view of the Magic Kingdom parade, Brad Kuhn recommends standing near the very end of the route in the Main Street square. There’s a store next to the doors that the parade exits through; if you stand by the doors of the store, says Brad, you’ll see everyone straight on, then from the side. “Everyone keeps up their act until they’re way beyond the doors and out of sight so you don’t even see them break character watching them out the exit.”
  • “Proceed to the BACK of the park first. People tend to queue up for the first things they see,” says dakpluto. Read their comment for specific things to hit first in each park.
  • “It’s easy to miss, but there’s a Coca-Cola attraction in Epcot called Club Cool where you can try free Coke products from around the world. Some are great, like Kinley, a lemon-flavored soda from Israel.”—WoodenRobot
  • “Animal Kingdom is notorious for having rare characters standing outside of their park entrance. We always make sure to pay attention to the right side when entering or leaving the park because you never know who you’ll see.”—Mel
  • “At Magic Kingdom, one great way to pass up the time when it’s crowded is to do the Sorcerers of the Magic Kingdom card game. It’s fun for kids and adults alike and you get some souvenir cards for free. You can get a pack of cards per person per day.”—echo125488
  • “If you are at Epcot and want to watch Illuminations, the restaurant (the rose and crown) in UK is the best seat in the house. While the entire show is intended to be watched from any country, they actually load the fireworks frm directly across England.”—Shannon
  • “There are a ton of incredibly designed and themed resorts that are a treat just to explore. You can spend a whole day hopping from one resort to the next. If they ask why you’re there, tell them you’re eating at their full service restaurant. You can take buses either from the parks or Disney Springs. The best resorts are on the monorail in front of Magic Kingdom: The Grand Floridian, the Polynesian, and the Contemporary.”—mouseclicker (read their comment for more resort suggestions)
  • “MK has a barber shop right near the front which has reasonably priced haircuts ($15-20 from what I remember). They also offer first hair cuts for kids. This can be a relatively cheap, memorable experience for parents. The staff there are great and make the experience easy and fun for the kids.”—gatorbait28

Tell the staff what you’re celebrating

  • Whatever makes you or your trip special, tell someone on staff. “My wife and I honeymooned at the park, we mentioned that’s why we were there,” says Peter M. Smith. “A couple of pins were handed to us, we stuck them on our bags, and for the rest of the week we’d get random free things. An extra appetizer, glass of wine, etc…”
  • Really, “anything can be a cause for celebration,” says tweak45. “I talked to a woman on the shuttle who was there to celebrate successfully losing 100lbs. She got a celebration pin from her resort and everyone congratulated her the whole time, which I’m sure provided a hell of a lot of warm fuzzies.” Tweak45 and their partner got special pins on an anniversary trip, and the staff consistently congratulated them.
  • “When we’re celebrating birthdays, the birthday boy or girl will often get a free cupcake,” says PurpleWaterBottle. “Get one of the ‘First Time Visitor’ pins, and smile a lot,” says whiskeytango.

There are so many more tips that we don’t have time to list here. Go read the original thread, where we’ve starred over 50 tips under the “Staff” tab. Leave your own tips in the comments right here, and come back next week when we go to the second-happiest place on earth: Australia.


via Lifehacker
The Best Disney World Travel Tips From Our Readers

Watch: Tomahawks as Weapons

Watch: Tomahawks as Weapons

Paul Harrell opens this video by talking about some “TV shows where people are prepping for doomsday,” and I really got a kick out of this:

There’s a guy on there that had his buckskins on, and he supposed to be some sort of kung-fu mountain man, showing you how to use a tomahawk as a weapon.”

My next laugh came after he’d thrown and stuck five tomahawks into a log.

Now I’m just just your average spaz. I’ve actually won a lot of competitions for tomahawk and knife throwing.

It’s always nice to know you’re not listening to an average spaz.

His final conclusion?

A tomahawk is a formidable weapon. Throwing it, that’s a parlor trick. Because what happens when you throw a tomahawk at somebody, then you don’t have a weapon because you threw it away, and now he’s got two: the gun he brought, and the tomahawk you just gave him.

Nothing like a little practical wisdom.

Editor & Contributing Writer Russ Chastain is a lifelong hunter and shooter who has spent his life learning about hunting, shooting, guns, ammunition, gunsmithing, reloading, and bullet casting. He started… [Learn More]

via All Outdoor
Watch: Tomahawks as Weapons

How to Clean a Backyard Trampoline

Jolie Kerr is a cleaning expert, advice columnist and author of the New York Times bestselling book, My Boyfriend Barfed In My Handbag … And Other Things You Can’t Ask Martha. Her flagship column, “Ask a Clean Person,” debuted in 2011. Here on Offspring, we’ve launched a new iteration of it, focusing on parenting and all the messes it brings. 


Have you ever covered how to clean your trampoline? What if you are like me and have not touched the trampoline all winter and now it is covered in sap and bird poo and other caked-on disgustingness? What should I do?

Advertisement

I have actually never been asked how to clean a trampoline, making this a unicorn of a question! Well done, it’s actually a feat to find a topic I’ve not only not covered but that I’ve never even been asked about before—but if you have the question, someone else does too, so let’s do this thing.

Cleaning a trampoline is a simple endeavor—soap and water is really all you need!—but there are some important safety considerations to take into account that make them different from how other backyard equipment can be cleaned.

Before you introduce water and detergent to the trampoline, sweep the mat off using a broom or a dustpan and brush. You may be tempted to skip this considering that you’re just going to (spoiler alert!) turn a hose on the thing, but don’t: It will make the rest of the job easier if you take a minute or so to sweep away loose dirt, twigs, leaves, etc. before the wet cleaning begins.

Advertisement

This is also the time to do a preliminary check for damage, and clearing leaves and such away will better allow you to look to see if there are holes, tears or snags in the jumping mat. If the jump pad is damaged, it should be replaced. It’s also important to use the right tools and cleaning agents on the pad, to avoid causing damage during the cleaning process, which is actually very straightforward and definitely a job the kids can get involved in.

Hose down the mat until it’s soaking wet

Start by really soaking the mat; trying to scrub it while it’s dry can lead to tears, but the water will provide a lubrication of sorts that will allow you to scrub it without causing damage.

Soapy water and a soft scrub brush or rags are all you need 

Because the jumping pad can be easily torn or abraded in a way that will make it unsafe to use, it’s important to stick with either a soft nylon brush or rags when cleaning it. Stay away from steel wool or scrubbing sponges, or even heavy duty scrub brushes, unless they’re specifically soft-bristled ones. Make sure to scrub not only the mat, but the springs and pads too.

It’s also important to stay away from cleaning agents that are any stronger than regular old dish soap; the chemicals used in other household cleaners can degrade the mat, making it unsafe to use.

Hose it off until the water runs clear

After scrubbing the mat well, there should be some satisfyingly gross brown suds that show you how much dirt and grime you cleaned off. Now it’s time to rinse the mat, and you’ll want to do that really, really well to ensure no soap residue is left behind. So: Hose the mat down until the runoff is entirely clear.

Dry with towels and sunshine

Do an initial pass of wiping the mat and frame dry with towels, and then let the trampoline dry entirely before using it. A wet mat is unsafe for jumping. This is also the time to do a second pass to check for damage to the mat that may have been revealed during the cleaning process.

Advertisement

This is definitely a job the kids can help with, but it’s important to note that the mat will become quite slick when covered in soapy water; make sure no one climbs or walks on it to avoid slips and injuries. The slickness issue is also why it’s so important to rinse the mat very well, and to not go hog wild with the use of soap—using too much soap will make the rinsing interminable.

Once your trampoline is clean and thoroughly dry, get back on that baby and jump! And also maybe buy a trampoline cover to protect it from twigs and leaves and bird poop when it’s not in use.


via Lifehacker
How to Clean a Backyard Trampoline