Showing posts with label Private. Show all posts
Showing posts with label Private. Show all posts

Wednesday, April 20, 2016

[Log] Issue Installing Caffe on Ubuntu 14.04

Few issues.

1. Might need a reboot after installing the Cuda driver? CPU installation works fine. For GPU installation, make all, make test works fine, make testrun reports error. Might also because tried to install Cuda 6.5 in the process.

remember to add

export CUDA_HOME=/usr/local/cuda-7.5
export LD_LIBRARY_PATH=${CUDA_HOME}/lib64

PATH=${CUDA_HOME}/bin:${PATH}
export PATH

into .bashrc

2. Need the cudnn.h head file in /usr/include for CuDNN acceleration. Needed by cudnn.hpp.
Need the *.so file in lib64 to /lib64 folder

https://developer.nvidia.com/cudnn

3. CuDNN v5 is not working, few interface discrepancies were found. v4 works fine.

4. Test with all configurations works fine.

CPU Only
[----------] Global test environment tear-down
[==========] 1056 tests from 146 test cases ran. (39277 ms total)

[  PASSED  ] 1056 tests.

CuNN
[----------] Global test environment tear-down
[==========] 2003 tests from 269 test cases ran. (266570 ms total)
[  PASSED  ] 2003 tests.

GPU 
[----------] Global test environment tear-down
[==========] 1943 tests from 259 test cases ran. (244820 ms total)
[  PASSED  ] 1943 tests.



Tuesday, April 19, 2016

[Log] Issues Installing Ubuntu 14.04

0. Don't use UEFI for usb boot.

Won't recognize windows system.

1. Network. DHCP not working.

remove

auto eth0
iface eth0 inet dhcp

1.5 SSH auto start

sudo update-rc.d ssh defaults

2.  VNC Server

sudo apt-get update
This updates the package list for apt.

Then you'll need to install the Gnome components using Software Center:
Install via the software center
Or Using Terminal:
sudo apt-get install gnome-core

To install VNC server using Software Center:
Install via the software center
Or Using Terminal:
sudo apt-get install vnc4server


VNC view gray screen

edit ~/.vnc/xstartup

#!/bin/sh
def
export XKL_XMODMAP_DISABLE=1
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
gnome-panel &
gnome-settings-daemon &
metacity &
nautilus &
gnome-terminal &

3. Start VNC


vnc4server -geometry 1280x1024 -geometry 1024x768 -geometry 800x600

switch resolution


xrandr -s 0

4. Mount Windows Partitions.

fdisk -l

sudo mount -t ntfs -o nls=utf8,umask=0222 /dev/hdb1 /media/c

5. Internet Down for strange reason again.

Seems like it is a network manager bug

5.1. Purge network manager

Gnome:

sudo apt-get remove --purge network-manager-gnome network-manager

KDE:

sudo apt-get remove --purge knetworkmanager network-manager

reboot required. ifdown ifup won't initi the network.

5.2 Setup DHCP.  and name server
/etc/network/interfaces

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

5.3 Setup DNS nameserver
/etc/resolv.conf
nameserver 128.223.6.7
nameserver 8.8.8.8
nameserver 8.8.8.4

OR static

auto eth0
iface eth0 inet static
address 10.0.0.100
netmask 255.255.255.0
gateway 10.0.0.1

6. Command Not Working in 14.04

/etc/init.d/networking restart
sudo ifconfig eth0 down(up)

Use

sudo ifdown (ifup) eth0


7. Skip Login Screen.

source.
http://askubuntu.com/questions/148717/how-do-i-boot-into-the-console-and-then-launch-the-ubuntu-desktop-from-it

down voteaccepted

To return to the login screen

Press Ctrl+Alt+F7 to return to the login screen. You can exit your terminal session on tty1 by typing exit before you do that.
Doing startx -- :1 will start another X session under terminal tty1, logging you in directly (use :2, etc. for even more displays). Note that logging into multiple sessions as the same user is not recommended and could lead to system instability.

To skip the login screen completely, boot into the console and then start the GUI, you must modify GRUB:
  • sudo nano /etc/default/grub
  • Change line GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" to GRUB_CMDLINE_LINUX_DEFAULT="text"
  • Ctrl-X, press Y and then Enter to save and exit.
  • sudo update-grub
  • Reboot and you should come up directly in tty1 -- no need to press Ctrl-Alt-F1.
  • Login, and then startx to boot into the default desktop, or
    • unity for Unity
    • unity-2d-shell for Unity 2D
    • gnome-shell for Gnome
    • sudo service lightdm start to get the login screen (if you fix it :)



7. Ethernet problem

Might because of the intel network driver.
Last working setup
auto lo eth0
iface lo inet loopback
iface eth0 inet dhcp

Reboot doesn't work?
Must be shutdown at start?

OK. The answer is the intel ethernet driver. (It is strange sometimes it can work even without driver...)

From the logs it seems to me you have managed to update the driver from version 2.3.2-k to 3.2.4.2-NAPI.
I fixed my Intel NUC non working ethernet by:
  • download the driver from https://downloadcenter.intel.com/download/15817, currently 3.2.4.2 (as shown in lshw -C above)
  • make install in the src folder
  • rmmod e1000e
  • modprobe e1000e
  • and to make the new driver survive a reboot update-initramfs -u
This I have to repeat at every kernel update, since kernel updates still (3.13.0-63) contain the old driver version 2.3.2-k, which does not work with my Intel NUC.
http://www.intel.com/content/www/us/en/support/network-and-i-o/ethernet-products/000005480.html?wapkw=(itanium)

8. How to prevent “Write Failed: broken pipe” on SSH connection?

needed to have rw for user only permissions on config. This fixed it.

chmod 600 ~/.ssh/config

Wednesday, January 27, 2016

花20分钟写的-大白话讲解如何给github上项目贡献代码



花20分钟写的-大白话讲解如何给github上项目贡献代码
2013-03-30 22:53:55
本文献给对git很迷茫的新手,注意是新手,但至少会点基本操作,有点基本概念的新手,我不会从怎么用github和git是什么开始讲的。如果作为新手你看书又看不进去,原理又太复杂,有没有直接了当告诉我们怎么给项目贡献代码,并和项目同步代码的大体流程。于是我快速写了这么个东西。一来整理下自己混乱的思路,二来想号召大家一起用git开发点东西,可是好几个同鞋只会寂寞的给自己push。

我先说下 我之前对github操作的一些迷茫历程,然后之后是怎么解惑的。

1. 最最开始,我以为git clone [项目地址],也就是把代码clone下来 然后修改,然后push到项目里就可以了。
后来发现,这种情况只适合该项目属于你自己的情况,如果你git clone别人的项目代码,你想push都push不上去,因为 git push 不是需要你输入github帐号密码么。

2. 然后 我就知道了 github上 不是有个fork么, 好,那么给别人的项目提交代码的方式就有了,先fork下别人的代码,于是你的github上就出现了同名的项目,这个项目就属于你自己了,你把这个自己的项目git clone到本地,修修改改,然后push到你自己的项目里,那么你如何把你对自己项目的改动,给发到之前fork的那个原项目呢,看见了没,在github上你的项目页面有个按钮,叫Pull request,对 你点它就会把你的修改发到对方的项目里,人还会收到邮件呢,由原项目主人决定是否接受你的修改。
但是,这样问题就出来了,在你fork他的项目之后,如果他又更新了代码,你自己fork的项目怎么做到和原项目同步呢? 
我就想啊,是不是 我还得重新git clone原项目的代码,然后手动合并到我fork的项目里呢。。。
梁老师说,你丫这太蛋疼了,肯定不是这么麻烦,我细想,也是啊,这不2么。。。

3,然后,从《Pro git》上看到一个知识点,我擦,github居然可以给项目添加合作者,也就是说,假如你,对,说你呢,戴眼镜那个,你想参与我的项目,你跟我说一声,我就把你添加到我的项目里作为合作者,这个选项在项目的设置里面有,只要我添加你了,你就可以git clone我的代码然后修修改改,然后直接push上来就行了,就不用fork那么麻烦了,如果你要更新服务器代码,只要git pull就行了,看 合作者这东西多方便,就像我们在公司用svn似的。

4.然后我就想啊,有了合作者还需要你丫fork这个功能干啥?仔细一想,你写个好项目,不能随便加合作者啊,加了个熊孩子把你代码改废了可咋整,这年头熊孩子很多,我自己不就是一个么。所以fork肯定还是需要,fork就是专门预防熊孩子的,这就是真相!那么前面说道到fork之后如何与原项目同步的问题还在啊,没有得到解决。

5.于是《Pro git》再次给了我一个解答,具体流程是你啊想给我的项目做贡献,你先git clone我的代码到本地,然后修修改改,然后你不是不能push到我的项目里么,你可以先在github页面上fork我的项目,有了你自己的项目地址(url)之后呢,你在本地操作git remote add [sort name] [your url],意思就是添加第二个远程仓库地址,这个仓库的“昵称”就是你刚指定的[sort name],然后,你之后push文件呢 就通过指定这个[sort name]来push到这个你自己的仓库里。等你觉得想要把你改的发给原项目同步,就在你的项目上点Pull request按钮.说下另一种情况,如果是,原项目发生了改动,你要想同步到本地,就直接从git fetch origin 从原项目的地址同步代码,然后再merge就好了。当然,如《Pro git》上所写,你可以通过新建分支的方式往自己的项目上push,这样同步的时候直接fetch就行了。这块如果我没写明白或者你想知道怎么新建分支的方式push到自己的项目里,可以直接参考《Pro git》的“公开的小型项目”一节,那我的贡献就是指点你如何从这本书里快速的找到你想要的。= =。

好了,时间有限,我写的快不一定讲明白,欢迎跟我讨论。
感谢linus,感谢git,感谢github,感谢kindle,感谢《Pro git》,感谢梁老师,感谢我自己,感谢所有的熊孩子们。

Monday, January 4, 2016

Leetcode分类总结

LeetCode 题目总结/分类

马孔多 马孔多 2014-02-14 10:19:33

秋风狂扫
2014-08-21 07:26:03 秋风狂扫
牛逼,很实用!
tianzhaixing
2014-09-02 20:20:53 tianzhaixing
( ^_^ )不错嘛
那个骑士肉肉
2014-11-19 19:43:50 那个骑士肉肉 (一路遇见 一路失散)
:)以后可以发给别人参考一下了
阿恺
2014-11-19 22:18:49 阿恺 (努力的方向:可以依靠,值得信赖)
mark
橙子爱吃小葡萄
2014-12-08 09:43:12 橙子爱吃小葡萄 (Be Professional)
subsets类不应该是属于dfs吗?
马孔多
2014-12-08 10:57:41 马孔多 (Cedar 直待凌云始道高)
subsets类不应该是属于dfs吗? 橙子爱吃小葡萄
训训
2015-01-06 22:21:40 训训
mark
范范宽宽
2015-01-28 19:56:41 范范宽宽
mark
Universe
2015-03-24 08:58:25 Universe
mark
reking
2015-04-04 06:07:08 reking
mark 
cici920
2015-04-27 17:47:25 cici920 (different)
mark
2php
2015-10-20 20:16:55 2php
干货啊~~~~~
Seven
2015-10-29 10:48:26 Seven
对我这种英文水平捉急的人来说, 还是看中文的好点
http://tianmaying.com/tutorials/tag/Leetcode
milanlx17
2016-01-08 16:04:56 milanlx17 (take it easy)
mark

马孔多
马孔多 (北京)
Data Mining