Install Windows drivers from a .cab files

-Create a directory to expand the cab into
(ie)C:\Drivers
mkdir C:\Drivers
-Expand the cab
expand C:\location\of\your\cab C:\Drivers -F:*
-Install the drivers
for /f "tokens=*" %a in ('dir *.inf /b /s') do (pnputil –i -a "%a\..\*.inf")

 

Advertisements

Insert Data to Mysql Table Using Bash Command Line

To insert data from bash command line you will need username and password to your MySQL database. Consider a following table called “fruits” with auto increment “id”:

Next, we have a file with some data:
$ cat /tmp/fruits
apple
banana
lemon

for i in $( cat /tmp/fruits ); do echo “INSERT INTO fruits (fruit) values ($i);” | mysql -u root -p password mydatabase; done

Allow remote connections to mysql

Run a command like below to access from all machines.

mysql> GRANT ALL PRIVILEGES ON *.* TO ‘USERNAME’@’%’ IDENTIFIED BY ‘PASSWORD’ WITH GRANT OPTION;
Run a command like below to give access from specific IP.

mysql> GRANT ALL PRIVILEGES ON *.* TO ‘USERNAME’@’1.2.3.4’ IDENTIFIED BY ‘PASSWORD’ WITH GRANT OPTION
run the command vim /etc/mysql/my.cnf
comment bind-address = 127.0.0.1 using the # symbol
restart your mysql server once.

In Step 1, if you cannot find bind-address in the my.cnf file, look for it in /etc/mysql/mysql.conf.d/mysqld.cnf file