How To Backup and Restore your Inventory Management System

There are two important sections of The Inventory Management System that need to be backup and/or restore. The system stores images that are uploaded in a directory within the source-code. Backup this directory or the entire application to a folder on your file system.

Example:

sudo cp -R /var/www/html/warehouse-inventory-system /home/pi/Downloads/

Backup and Restore Your Database

Export A Database

To Export a database, open up terminal, making sure that you are not logged into MySQL and type,

mysqldump -u [username] -p [database name] > [database name].sql

Backup your Inventory Management System

mysqldump -u'root' -p'password' oswa_inv > /path/to/oswa_inv.sql

The database that selected in the command will now be exported to a file.

Import

Log into mysql command-line interface:

mysql -u'username' -p'password'

If you are having difficulty logging into mysql please see the section below, How to Reset Your Password

WARNING! You are about to permanently delete ALL of your data.

DROP DATABASE oswa_inv;
CREATE DATABASE oswa_inv;
source oswa_inv < /path/to/oswa_inv.sql

Exit mysql.

How to Reset Your Password

When you first install MySQL, you have to set up your root password. However, should you forget it at any point, you can still recover it.

Step One—Shut Down MySQL

In terminal, stop the MySQL process

 /etc/init.d/mysql stop

Step Two—Access MySQL Safe Mode

In safe mode, you will be able to make changes within the MySQL system with a root password alone, without the need for MySQL root password.

sudo mysqld_safe --skip-grant-tables &

Once safe mode has started up, log into MySQL and when prompted, use your standard root password.

mysql -u root mysql

Step Three—Set Up a New Password

Finally, set up the new MySQL root password by typing the command below. Replace “newpassword” with the password of your choice.

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

Be sure to reload everything:

 FLUSH PRIVILEGES;

and you now have a new root password.

More About Electronics:

More About hydroMazing:

More About Indoor Gardening:

Arduino FastLED Library

RGB Strip

The FastLED library is an impressive piece of work:

https://github.com/FastLED/FastLED/wiki/Basic-usage

After you download and install the library give it a try:

Using an Arduino Uno to calibrate an RGB LED strip.

The purpose of running this example is to determine what settings are needed to use the FastLED library.  For this example I’m using an Arduino Uno. The Uno has a ground pin next to pin 13, so for convenience, I’m using pin 13 as a low-current Vcc for the RGB LED lights strip:

pinMode(13, OUTPUT);
digitalWrite(13, HIGH);

// The data pin is the pin we are using to connect to the Arduino.
// Data pin that led data will be written out over
#define DATA_PIN 12

// How many individual LED modules are on the strip?
#define NUM_LEDS 10

// When using an SPI based chipset, the there should be four wires
// Clock pin only needed for SPI based chipsets when not using hardware SPI
//#define CLOCK_PIN 8

Important configuration setting is to specify the model of LED strips being used.  May require some try-and-error.

      // Uncomment one of the following lines for your leds arrangement.

     // FastLED.addLeds<WS2811, DATA_PIN, RGB>(leds, NUM_LEDS);
      FastLED.addLeds<WS2812, DATA_PIN, RGB>(leds, NUM_LEDS);
      // FastLED.addLeds<WS2812B, DATA_PIN, GRB>(leds, NUM_LEDS);
      // FastLED.setBrightness(CRGB(255,255,255));
      // FastLED.addLeds<GW6205, DATA_PIN, RGB>(leds, NUM_LEDS);

A nice variety of color effects is included with the library.  After trying out the RGBCalibration source code example, make the changes need to Demo Reel and give it a go:  https://github.com/FastLED/FastLED/blob/master/examples/DemoReel100/DemoReel100.ino

Copy the settings for the LED strip to the DemoReel example

Upload and if all goes well, you should see a basic visual effects show.

Lightshow

More

Please share with friends and follow to receive a notification when I publish a new article.

 

IMG_20190605_094809140
Existential Crisis

Solar-Rechargeable Decorations

Phoenix Fire Lily:  Solar rechargeable battery connected to a flickering LED inside an artificial lily flower residing in a hand-crafted wooden vase.

IMG_20180731_145416444IMG_20180825_170808853lily

I don’t know about you, but I rarely have money to spend on projects and whenever possible reusing and re-purposing junk is ideal.  Many of my projects contain parts I’ve purchased at local dollar stores and items found through eBay.

IMG_20180808_174135637
Discount hackables!!

 

Parts:

  • Artificial Lily Flower
  • Flickering LED
  • Thermostat Wire
  • 100-330ohm Resistor
  • Mini switch
  • Solar-panel ~ 5vDC
  • Rechargeable Li-ion Coin-cell Battery
  • Rechargeable Li-ion Coin-cell Battery charger = TP4056 Mini USB 1A Lithium Battery Charger Module
  • USB to mini USB ~ 5ft. cord
  • Optional ~ hand-crafted vase station

Steps:

IMG_20180826_135523525

  • Cut the end of the stem and remove the wire.

IMG_20180826_135554418

  • Gut the Artificial Lily Flower by removing its pistil.

IMG_20180826_135814012IMG_20180826_134320215

  • Using a 8-10″ length of Thermostat Wire that extends just beyond the end of the lily’s stem, solder a 100-330ohm resistor to flickering LED and/or later near the mini switch inside the recycled case.

Do I really need a resistor?

  • Clear LED without resistor = 30mA @ 3vDC
  • Flickering Yellow LED ~ 6mA @ 3vDC
  • salvaged 10 LED string of lights = 6mA @ 3vDC

 

  • Carefully thread the wired LED through the lily and down her stem.

IMG_20180826_135619996

  • Add a piece of heat-shrink tubing, solder jumper wires, and attach connector header.

IMG_20180826_134646442

  • Solder a set of short jumper wires to the Rechargeable Li-ion Coin-cell Battery charger output.
  • Solder the Rechargeable Li-ion Coin-cell Battery charger output short jumper wires, resistor, to the mini switch and recycled case ( two “AA” batteries ).

IMG_20180826_134721596

IMG_20180826_134731388

  • Solder the coin-cell battery holder to the Rechargeable Li-ion Coin-cell Battery charger
  • Insert the Rechargeable Li-ion Coin-cell Battery into the Rechargeable Li-ion Coin-cell Battery charger.

IMG_20180826_134228643

A look inside the inexpensive battery case.

IMG_20180826_134310725

  • Gut everything from the case!

IMG_20180826_134428371

  • Drill a few holes.  One for the solar panel wires, and the other for USB connector.

IMG_20180826_134806554

  • Solder a simple switching diode, such as 1N4148, to the positive side.
  • Using short jumper wires, solder the Rechargeable Li-ion Coin-cell Battery charger input to the solar panel ~ 5vDC.

IMG_20180826_140031232

  • Insert the switch and wrap wires so they lay flat inside the case.

IMG_20180826_140138221

  • Test the output.
  • Optionally, attach USB to mini USB cord to the charger
  • Store inside a hand-crafted vase station.

IMG_20180731_145416444IMG_20180825_170808853lily

 

You can purchase a completed Phoenix Fire Lily directly from me as a functioning example.

lily base partslily base v2

 

More: