Thursday, November 10, 2016

How to kill all python processes in linux

pkill -9 python

Monday, August 15, 2016

Sum of Consecutive, Even, Odd and other numbers

Consecutive numbers:
S=N(N+1)/2

*N includes the first element that is why we add 1 at the end

Even numbers:
N= ((Last - First)/2) +1
S= N(N+1)

Odd numbers:
N=((Last-First)/2)+1
S= N^2

Other numbers:
S=Avg * N
N=((Last-First)/Spacing)+1

Friday, June 17, 2016

Torch GenerateFingerprintTables.cpp:122: undefined reference to `gflags::

I had to reinstall this library since the version I had was an old one, even though linux said it had the latest version.

I cloned the repository and followed the instructions

https://github.com/gflags/gflags/blob/master/INSTALL.md


On thing that I needed as an option was to add the

CMAKE_CXX_FLAGS=-fPIC

Because I needed the library to work with torch, so I just went to the advance options of ccmake and looked for that variable and changed it. 
gflags didn't give me a problem after that. I am still trying to install the other dependencies for fblualib but we will see how that goes. 

Good luck


Tuesday, May 10, 2016

(ERROR)icvOpenAVI_XINE(): Unable to initialize video driver on OpenCV 2.4 and Linux 14.04

I was getting this annoying error so I looked up some solutions and found this installation helped. Good luck

 sudo apt-get install libxine1



Tuesday, May 3, 2016

Brother HL-L2380DW refurbished not working on windows 7

I installed the driver as indicated by downloading it from the website and used it from the cd that came with it but none of it worked. I tried to get the wireless connection working and followed all the steps. I even troubled shooted the printed but that didn't help. One reason why it didn't work for me is because there was a port issue, the default setting under Properties->Ports was selected as LPR, once I switched to Raw the connection happened and it worked!

I hope this helps someone out there.

Wednesday, April 6, 2016

Getting eclilpse debugger working on torch

I have learned today that installing torch on eclilpse could be a little daunting, however, could also be very powerful.

I wanted to install this library
https://github.com/karpathy/neuraltalk2

with a debugger on eclipse since I have heard it has the best debugger.

I followed this instructions to do that:

http://www.lighting-torch.com/2015/07/27/configuring-eclipse-with-torch/

This are very detailed instructions and if you are lucky it should just work right off the butt.
However, I wasn't that lucky and I did end up doing some trial and error things.

I had an issue with getting qlua running on eclipse as an interpreter. I had some weird errors such as
qlua: ./misc/DataLoaderRaw.lua:45: attempt to index global 'path' (a nil value)
Which I wasn't sure what they were.

I googled around and first I made sure the environement was installed

sudo luarocks install env

to call it with qlua -lenv as I was doing previously.
what it really helped is to install
sudo luarocks install penlight

and add

local path = require 'pl.path'

to all the scripts that needed it. For some reason that was the main cause of my problems. I am a newbie at torch but for now I am happy with torch and my debugger.

Also for this particular library, it uses cunn and gpu which requires having cudnn installed and on the ld library path.
Hence in order to have this working I needed to go to Run->Run Configureations->Environement
I create a new variable called LD_LIBRARY_PATH
and give it a path something like this:
 /usr/include/python2.7/:/usr/local/cuda-7.5/lib64:/lib:/usr/local/lib/:/home/onina/cuda/cudann/lib64:

Wednesday, February 24, 2016

Format NTFS but can't write on Ubuntu 14.04

I had the same problem and I just changed the permissions to the mount

sudo chmod -R 777 /media/user/drive/

Thursday, January 7, 2016

bad cost detected: nan DeepLearningTutorials

I got this error recently even after cloning the code from the actual repository https://github.com/lisa-lab/DeepLearningTutorials

I noticed that when I switched to another system where I had ubuntu 14.04 with a similar Anaconda version installed however with a different an newer GPU card a Titan X the problem went away. The original problem occurred with a Titan Black.

Hence, the problem might lie in any of the variables. It might be a GPU issue. However, I couldn't confirm this since the card worked fine for other code. Let me know if you find the solution.


Permission on hard drive ubuntu

I had a hard drive I moved from one computer to another. It turned out that by switching computers I couldn't access the files on my hard drive since I didn't have the right permissions on the new computer. So what I ended up doing was to create a new group and change the group on the files on the hard drive recursively and then add my user name to the group just created. Anyhow, it seemed to work pretty good. This was taken from this post http://superuser.com/questions/280994/give-write-permissions-to-multiple-users-on-a-folder-in-ubuntu

sudo groupadd tomandruser
Now that the group exists, add the two users to it:
sudo usermod -a -G tomandruser tomcat6
sudo usermod -a -G tomandruser ruser
Now all that's left is to set the permissions on the directory:
sudo chgrp -R tomandruser /path/to/the/directory
sudo chmod -R 770 /path/to/the/directory

Tuesday, January 5, 2016