Posts

Mysql commands

__ __ ____ ___ _ | \/ |_ _/ ___| / _ \| | | |\/| | | | \___ \| | | | | | | | | |_| |___) | |_| | |___ |_| |_|\__, |____/ \__\_\_____| |___/ Handy MySQL Commands Description Command To login (from unix shell) use -h only if needed. [mysql dir]/bin/mysql -h hostname -u root -p Create a database on the sql server. create database [databasename]; List all databases on the sql server. show databases; Switch to a database. use [db name]; To see all the tables in the db. show tables; To see database's field formats. describe [table name]; To delete a db. drop database [database name]; To delete a table. drop table [table name]; Show all data in a table. SELECT * FROM [table name]; Returns the columns and column information pertaining to the designated table. show columns from [table name]; Show certain selected rows with the value "whatever". SELECT * FROM [table name] WHERE [field name] = "whatever"; Show all reco...

Run A Program On Startup

Run A Program On Startup (Console On Ubuntu 18.04) As an alternative to using the GUI startup configuration tool or rc.local, you can use the crontab -e command to add a program to the cron job scheduler, so that it will launch it at startup, even if there is no GUI installed (useful for Ubuntu servers). First, type: crontab -e Afterwards, it may ask you the following. Select the number that corresponds to your preferred text editor: no crontab for username - using an empty one Select an editor. To change later, run 'select-editor'. 1. /bin/nano <---- easiest 2. /usr/bin/vim.basic 3. /usr/bin/vim.tiny 4. /bin/ed Choose 1-4 [1]: 1 I selected Nano, as that is my preferred text editor. You may see something like: # Edit this file to introduce tasks to be run by cron. # # Each task to run has to be defined through a single line # indicating with different fields when the task will be run # and what command to run for the task # # To define the ti...

How to Install a Different Desktop Environment in Ubuntu

To install a different desktop environment in Ubuntu, you would simply open up a Terminal, and install it via the  apt-get install  whatever-desktop-environment  command. Sometimes you may encounter problems, but they  should generally be easy to fix, and there is plenty of help available online. If you wish to try a GNOME session, you can simply logout, and choose the "GNOME Classic" option when logging in. Rather than just installing from the terminal, it may be a good idea to install from a console instead, as it may avoid some problems. You can press or  CTRL + ALT + F2  to exit to a console, then enter the following command to exit your current  x session ). sudo stop lightdm Install the KDE desktop If you wish to install the KDE desktop environment in Ubuntu, you would simply run the below command in a terminal window or console: sudo apt-get install kubuntu-desktop You should pay attention to any problems doing the instal...

Bluetooth Controlled Car

Image
COMPONENTS AND SUPPLIES Arduino UNO & Genuino UNO × 1 L298 Motor Controller × 1 Bluetooth Module × 1 RC Car × 1 ABOUT THIS PROJECT Project: This project was an interesting endeavor, as it was mostly a guess and check routine until I found out what worked for me in the long-run. I used the Adafruit Bluetooth LE tutorial to figure out how to hard-wire this setup, and used Michael's hybrid code to power the motors and steering. First off, here is the video of the working car! The hardware setup for the Bluetooth module is as follows: Fritzing diagram (from the Adafruit tutorial): Not much is being accomplished with this photo. The L298 Motor Controller was connected to a 9V battery, the Arduino ground and 5V, and pins 6, 7 and 8 (to pins enB, in4 and in3, respectively). The microservo used for steering was connected to digital pin 3, and the Arduino ground and 5V connections. ...