React Tutorial

React Tutorial

https://ift.tt/38q5RGi

The easiest way to learn React

Learn in an interactive environment. Understand how React works not just how to build with React.

programming

via Laravel News Links https://ift.tt/2dvygAJ

February 4, 2020 at 09:54AM

How to Change the Default Storage Path in Laravel

How to Change the Default Storage Path in Laravel

https://ift.tt/38WQNjv

It would be nice if Laravel provided a configuration entry to control which path is used for user uploaded content, or more generally, application data storage such as files, images, and binary data. In Laravel, this directory is known a the storage path

The helper function storage_path calls the container for a path.storage mapping. By default, Laravel populates this entry in Application.php – This is hard coded to directory relative to your applications root directory.

To change this, we can modify the storage path at runtime with a service provider. In this example, we’re modifying the storage path to /webroot/storage, which is the storage directory recommended for PHP apps hosted on Amezmo, but you may change this to any value.

 <?php namespace App\Providers; use Illuminate\Support\ServiceProvider; // Full path: app/Providers/AppServiceProvider.php class AppServiceProvider extends ServiceProvider { /** * Register any application services. * * @return void */ public function register() { $this->app->instance('path.storage', '/webroot/storage'); } /** * Bootstrap any application services. * * @return void */ public function boot() { // } }  

Now, every call to storage_path will return a path to our customized storage directory.

Why would we want to use the $instance property instead of the app helper function? The first reason is that it would be unnecessary to call app because it is identical to the instance property that we already have direct access to. Our service provider extends ServiceProvider, so we have access to the Application instance and we do not need to construct one by hand.

Another reason is that depending on your IDE, you can get nice autocompletion because of the PHP doc block defined on this property.

programming

via Laravel News Links https://ift.tt/2dvygAJ

February 3, 2020 at 10:25AM

VIDEO: Fox Sports Nails It With ‘Ragged Old Flag’ Super Bowl Commercial

VIDEO: Fox Sports Nails It With ‘Ragged Old Flag’ Super Bowl Commercial

https://ift.tt/37YakQM

When it comes to the 2A community, the NFL fails us more often than not. The NFL employs a perpetual anti-gun stance. Then it allowed the fiasco that was the kneeling Colin Kaepernick. So American patriots feel slighted and marginalized repeatedly by the organization running America’s most popular sport. But Fox Sports, and even the NFL, scored a resounding win, for once, with its Ragged Old Flag commercial on Super Bowl Sunday. So since they fail us so often, we’ll give a shout-out when they finally get one right.

marine veteran chris blanco freedom hard streaking

RELATED STORY

WATCH: Marine Veteran Streaks Across Field in US Flag Underwear

Ragged Old Flag Commercial

The spot features the iconic voice of the immortal Johnny Cash. In it he voices his 1974 classic “Ragged Old Flag.” Patriotic to its core, the Ragged Old Flag commercial begins with retired Marine Corps Lance Cpl. Kyle Carpenter, a recipient of the nation’s highest military award, the Medal of Honor. Carpenter received the award for his incredibly heroic actions in Afghanistan in 2010.

From there, the spot honors military and first responders alike. It is at times subtle, at times overt, and patriotic to the core throughout. While the commercial never specifically mentions Kaepernick, his supporters nevertheless took to social media to criticize Fox and the NFL for airing the spot. That alone speaks volume to everything good about the Ragged Old Flag commercial.

However, pro gun patriots immediately recognized just how special the commercial is, and how it spoke to veterans and 2A enthusiasts alike.

The post VIDEO: Fox Sports Nails It With ‘Ragged Old Flag’ Super Bowl Commercial appeared first on Tactical Life Gun Magazine: Gun News and Gun Reviews.

guns

via Tactical Life Gun Magazine: Gun News and Gun Reviews https://ift.tt/2i7bVLS

February 3, 2020 at 11:09AM

Laravel Log Reader

Laravel Log Reader

https://ift.tt/36TOe0o

The Laravel Log Reader gives you a UI to view all your Laravel log files. You can filter logs by date and type, as well as clear them via the UI.

The post Laravel Log Reader appeared first on Laravel News.


Join the Laravel Newsletter to get Laravel articles like this directly in your inbox.

programming

via Laravel News https://ift.tt/14pzU0d

February 3, 2020 at 09:03AM

Brownells Giving Away Barrel of Freedom Sunday During Super Barrel II

Brownells Giving Away Barrel of Freedom Sunday During Super Barrel II

https://ift.tt/2Oecbcj

Press release . . .

Brownells will give away a barrel full of freedom during the biggest pro football Sunday of the year with its Super Barrel II Weekend extravaganza.

One lucky Brownells fan will bring home the championship-worthy trophy of a barrel full of 13,889 rounds of 5.56mm NATO Hornady Frontier 55-grain M193 ammo.

Starting at 12:01 AM Saturday, February 1, and going through 11:59 PM Sunday, February 2, Super Barrel II contestants can sign up for their chance to win at the Brownells Super Barrel II page.

One lucky winner will be drawn by random and will receive the big red barrel full of ‘Merica valued at $4,239.99.

Containing enough ammo to fill almost 70 standard-length belts for an M249, the barrel weighs more than all but the very biggest football linemen. If all 13,889 cartridges contained inside were laid to end-to-end, they would stretch over 870 yards — almost twice as far as the most passing yards ever in a modern pro football championship game.

To sign up to win the Super Barrel II barrel full of ammo, and to see other amazing products, visit www.brownells.com.

About Brownells

Serious About Firearms Since 1939™, Brownells is the world’s leading source for guns, gun parts and accessories, ammunition, gunsmithing tools and survival gear. With a large selection of both common and hard-to-find items, and an extensive collection of videos, articles, and gun schematics, Brownells is the expert for everything shooting-related. Committed to maintaining our great traditions, Brownells has more, does more and knows more – and guarantees it all, Forever. For more information or to place an order, call 800-741-0015 or visit Brownells.com. Stay up-to-date with Brownells on YouTubeFacebookTwitter and Instagram

guns

via The Truth About Guns https://ift.tt/1TozHfp

January 31, 2020 at 05:11PM

CBS makes Star Trek: Picard pilot free on YouTube for a limited time

CBS makes Star Trek: Picard pilot free on YouTube for a limited time

https://ift.tt/36zJ6yA

Episode 1 of Star Trek: Picard on YouTube.

CBS has made the entirety of the first episode of its new series Star Trek: Picard freely and publicly available as a YouTube video. This is an opportunity for viewers curious about the show to see if Picard is worth subscribing to the network’s streaming service, CBS All Access, to watch the rest of the series.

The episode on YouTube is the same as the pilot episode that premiered on CBS All Access last week. The second episode of

Picard

began streaming on CBS All Access yesterday, and the network plans to release episodes at a weekly cadence. CBS has not said whether it plans to make other episodes available for free on YouTube in the future, but it seems likely.

The description for the video says the episode will only be available “for a limited time” and that it’s presented by Geico. It does not, however, clarify how long “a limited time” is or when the video might become unavailable.

Picard

has received generally positive critical reviews to date, but it’s early days for the series. The show takes place 20 years after 2002’s

Star Trek: Nemesis

, which was the last time actor Patrick Stewart appeared on screen as Picard in a live-action

Star Trek

production. It has already included some cameos from actors and characters from

The Next Generation

-era

Star Trek

. Stewart, who is also an executive producer on

Picard

,

recently said

that it’s his goal to see all the principal characters of

The Next Generation

in

Picard

before the series ends its run.

The series has also been renewed for a second season, set to premiere in 2021. CBS plans to bring back Star Trek: Discovery for a third season with a new showrunner, and it has plans for additional series set in the Star Trek universe, including one focused on Michelle Yeoh reprising her role as Philippa Georgiou from Discovery.

We’ve embedded the full episode of Picard above.

Listing image by CBS

geeky

via Ars Technica https://arstechnica.com

January 30, 2020 at 05:14PM

What to Monitor in MySQL 8.0

What to Monitor in MySQL 8.0

https://ift.tt/36H6QB2

Monitoring is a must in all environments, and databases aren’t the exception. Once you have your database infrastructure up-and-running, you’ll need to keep tabs on what’s happening. Monitoring is a must if you want to be sure everything is going fine but also if you make necessary adjustments while your system grows and evolves. That will enable you to identify trends, plan for upgrades or improvements, or react adequately to any problems or errors that may arise with new versions, different purposes, and so on.

For each database technology, there are different things to monitor. Some of these are specific to the database engine, vendor, or even the particular version that you’re using. Database clusters heavily depend on the underlying infrastructure, so network and operating stats are interesting to see by the database administrators too. 

When running multiple database systems, the monitoring of these systems can become quite a chore. 

In this blog, we’ll take a look at what you need to monitor a MySQL 8.0 environment. We will also take a look at cluster control monitoring features, which may help you to track the health of your databases for free.

OS and Database System Monitoring

When observing a database cluster or node, there are two main points to take into account: the operating system and the MySQL instance itself. You will need to define which metrics you are going to monitor from both sides and how you are going to do it. You need to follow the parameter always in the meaning of your system, and you should look for alterations on the behavior model.

Grip in mind that when one of your parameters is affected, it can also affect others, making troubleshooting of the issue more complicated. Having a proper monitoring and alerting system is essential to make this task as simple as possible.

In most cases, you will need to use some tools, as it is difficult to find one to cover all the wanted metrics. 

OS System Monitoring

One major thing (which is common to all database engines and even to all systems) is to monitor the Operating System behavior. Here are some points to check here. Below you can find top system resources to watch on a database server. It’s actually also the list of very first things to check.

CPU Usage

A high CPU usage is not a bad thing as long as you don’t reach the limit. Excessive percentage of CPU usage could be a problem if it’s not usual behavior. In this case, it is essential to identify the process/processes that are generating this issue. If the problem is the database process, you will need to check what is happening inside the database.

RAM Memory or SWAP Usage

Ideally, your entire database should be stored in memory, but this is not always possible. Give MySQL as much as you can afford but leave enough for other processes to function.

If you see a high value for this metric and nothing has changed in your system, you probably need to check your database configuration. Parameters like shared_buffers and work_mem can affect this directly as they define the amount of memory to be able to use for the MySQL database. Swap is for emergencies only, and it should not be used, make sure you also have your operating system set to let MySQL decide about swap usage.

Disk Usage 

Disk usage is one of the key metrics to monitor and alert. Make sure you always have free space for new data, temporary files, snapshots, or backups.

Monitoring hard metric values is not good enough. An abnormal increase in the use of disk space or an excessive disk access consumption is essential things to watch as you could have a high number of errors logged in the MySQL log file or a lousy cache configuration that could generate a vital disk access consumption instead of using memory to process the queries. Make sure you are able to catch abnormal behaviors even if your warning and critical metrics are not reached yet.

Along with monitoring space we also should monitor disk activity.  The top values to monitor are:

  • Read/Write requests
  • IO Queue length
  • Average IO wait
  • Average Read/Write time
  • Read/Write bandwidth

You can use iostat or pt-diskstats from Percona to see all these details. 

Things that can affect your disk performance are often related to data transfer from and towards your disk so monitor abnormal processes than can be started from other users.

Load Average

An all-in-one performance metric. Understanding Linux Load is a key to monitor OS and database dependent systems.

Load average related to the three points mentioned above. A high load average could be generated by an excessive CPU, RAM, or disk usage.

Network

Unless doing backups or transferring vast amounts of data, it shouldn’t be the bottleneck.

A network issue can affect all the systems as the application can’t connect (or connect losing packages) to the database, so this is an important metric to monitor indeed. You can monitor latency or packet loss, and the main issue could be a network saturation, a hardware issue, or just a lousy network configuration.

Database Monitoring

While monitoring is a must, it’s not typically free. There is always a cost on the database performance, depending on how much you are monitoring, so you should avoid monitoring things that you won’t use.

In general, there are two ways to monitor your databases, from the logs or from the database side by querying.

In the case of logs, to be able to use them, you need to have a high logging level, which generates high disk access and it can affect the performance of your database.

For the querying mode, each connection to the database uses resources, so depending on the activity of your database and the assigned resources, it may affect the performance too.

Of course, there are many metrics in MySQL. Here we will focus on the top important.

Monitoring Active Sessions

You should also track the number of active sessions and DB up down status. Often to understand the problem you need to see how long the database is running. so we can use this to detect respawns.

The next thing would be a number of sessions. If you are near the limit, you need to check if something is wrong or if you just need to increment the max_connections value. The difference in the number can be an increase or decrease of connections. Improper usage of connection pooling, locking or network issues are the most common problems related to the number of connections.

The key values here are

  • Uptime
  • Threads_connected
  • Max_used_connections
  • Aborted_connects

Database Locks

If you have a query waiting for another query, you need to check if that another query is a normal process or something new. In some cases, if somebody is making an update on a big table, for example, this action can be affecting the normal behavior of your database, generating a high number of locks.

Monitoring Replication

The key metrics to monitor for replication are the lag and the replication state. Not only the up down status but also the lag because a continuous increase in this value is not a very good sign as it means that the slave is not able to catch up with its master.

The most common issues are networking issues, hardware resource issues, or under dimensioning issues. If you are facing a replication issue you will need to know this asap as you will need to fix it to ensure the high availability environment. 

Replication is best monitored by checking SLAVE STATUS and the following parameters:

  • SLAVE_RUNNING
  • SLAVE_IO_Running
  • SLAVE_SQL_RUNNING
  • LAST_SQL_ERRNO
  • SECONDS_BEHIND_MASTER

Backups

Unfortunately, the vanilla community edition doesn’t come with the backup manager. You should know if the backup was completed, and if it’s usable. Usually, this last point is not taken into account, but it’s probably the most critical check in a backup process. Here we would have to use external tools like percona-xtrabackup or ClusterControl.

Database Logs

You should monitor your database log for errors like FATAL or deadlock, or even for common errors like authentication issues or long-running queries. Most of the errors are written in the log file with detailed useful information to fix it. Common failure points you need to keep an eye on are errors, log file sizes. The location of the error log can be found under the log_error variable.

External Tools

Last but not least you can find a list of useful tools to monitor your database activity. 

Percona Toolkit – is the set of Linux tools from Percona to analyze MySQL and OS activities. You can find it here. It supports the most popular 64 bit Linux distributions like Debian, Ubuntu, and Redhat. 

mysqladmin – mysqladmin is an administration program for the MySQL daemon. It can be used to check server health (ping), list the processes, see the values of the variables, but also do some administrative work like create/drop databases, flush (reset) logs, statistics, and tables, kill running queries, stop the server and control replication.

innotop – offers an extended view of SHOW statements. It’s very powerful and can significantly reduce the investigation time. Among vanilla MySQL support, you can see the Galera view and Master-slave replication details. 

mtop – monitors a MySQL server showing the queries which are taking the most amount of time to complete. Features include ‘zooming’ in on a process to show the complete query, ‘explaining’ the query optimizer information for a query and ‘killing’ queries. In addition, server performance statistics, configuration information, and tuning tips are provided.

Mytop –  runs in a terminal and displays statistics about threads, queries, slow queries, uptime, load, etc. in tabular format, much similar to the Linux

Conclusion

This blog is not intended to be an exhaustive guide to how to enhance database monitoring, but it hopefully gives a clearer picture of what things can become essential and some of the basic parameters that can be watched. Do not hesitate to let us know if we’ve missed any important ones in the comments below.

 

technology

via Planet MySQL https://ift.tt/2iO8Ob8

January 29, 2020 at 05:09AM

The Best White Noise Machine

The Best White Noise Machine

https://ift.tt/2P8TCId

The Best White Noise Machine

After 20 hours of research and testing, including interviews with one sleep researcher, two audiologists, and a sound engineer, we’re confident the LectroFan by ASTI is the white noise machine you’ll want to fall asleep with.

technology

via Wirecutter: Reviews for the Real World https://ift.tt/2gcK1uO

January 29, 2020 at 02:52PM