Posts

Showing posts from January, 2017

SQL Database Basic Commands

1. Create a SQLite Database (and a Table) First, let us understand how create a SQLite database with couple of tables, populate some data, and view those records. The following example creates a database called company.db. This also creates an employee table with 3 columns (id, name and title), and a department table in the company.db database. We’ve purposefully missed the deptid column in the employee table. We’ll see how to add that later. # sqlite3 company.db sqlite> create table employee(empid integer,name varchar(20),title varchar(10)); sqlite> create table department(deptid integer,name varchar(20),location varchar(10)); sqlite> .quit Note: To exit from the SQLite commandline “sqlite>” prompt, type “.quit” as shown above. A SQLite database is nothing but a file that gets created under your current directory as shown below. # ls -l company.db -rw-r--r--. 1 root root 3072 Sep 19 11:21 company.db 2. Insert Records The following example populates both

Install NVIDIA and CUDA in Linux version without any problems.

Hi all, If you are reading this post means you wish to run CUDA environment and has  tried installing CUDA with less success or running cuda for the first time. Dont worry I have got all covered in this blog post. To Install CUDA and run NVIDIA drivers follow the below steps: - Find the version of Linux installed using uname -r command or cat /etc/*-release command Find already existing default drivers from NVIDIA - sudo apt-cache search nvidia Install the building dependencies first using sudo apt-get install linux-headers-$(uname -r) Install the nvidia driver For example use always one driver version before latest to be on the safe side. So if you plan to install nvidia-352 driver use the command : - sudo apt-get install nvidia-352 Ensure that novaeu driver is black listed. Reboot the pc using command sudo reboot Now, launch the terminal and type nvidia-smi => this should display an output something like nvidia driver version and the jobs/process running as no proc

Kaggle download data

There might be instances where you might need to download a Kaggle dataset to another machine, possibly in an amazons ec2 instance. In order to download the data, you need to be logged in. One solution is to export your cookies and tell wget to use your cookies when downloading the data This is a chrome extension you can use to export your cookies. And here is the command in wget to download the data wget -x -c --load-cookies cookies.txt -P data -nH --cut-dirs=5 https://www.kaggle.com/c/diabetic-retinopathy-detection/download/trainLabels.csv.zip So, the above command will use your exported cookies to download the file to a folder called data