Ubuntu开发环境配置

主要是:

源的更新

安装vim编辑器

远程登录xrdp相关配置

synergy symless键鼠共享配置

对新买的硬盘进行格式化和分区

vsftp环境搭建

gcc开发环境配置

qt5开发环境配置

matlab环境配置

安装PC传感器监控软件(温度、风扇转速等)

安装python环境

安装java环境

 

ubuntu配置全局代理

终端配置代理

 1.通过export http代理使用apt-get(临时有效)

    在使用apt-get之前,在终端中输入以下命令

    export http_proxy=http://proxy_addr:proxy_port

    取消代理使用

    export http_proxy=""

 更详细的教程参见:

http://jileniao.net/set-global-proxy-for-ubuntu.html

 

win7远程登录Ubuntu

在Ubuntu中打开桌面共享软件配置允许远程访问相关选项,不想每次在ubuntu中点击确认,就将相关选项去掉,安装vncserver

然后在win7中安装vnc-viewer来远程连接ubuntu

详细教程见:http://blog.csdn.net/sunnylgz/article/details/40779973

 

 

安装ssh,远程登陆 (openssh-server openssh-client)(相关的还有利用这个ssh-keygen工具生成公钥和私钥从而省去输入密码)

主要是修改ect/ssh/下的配置文件,开启允许root登陆,也可以修改端口

配置git服务器 http://jingyan.baidu.com/article/9c69d48fb9fd7b13c8024e6b.html

 

系统/etc/profile 相关的配置

opencv的编译和cmake的使用

 http://www.cnblogs.com/lyq105/archive/2010/12/03/1895067.html

主要就是 工程名、头文件、源文件、链接的库文件、生成文件。 以及一些辅助或者方面书写的环境变量。

 

安装texlive:

http://jingyan.baidu.com/article/7c6fb4280b024180642c90e4.html

 

 创建快捷方式:

http://ianysoft.iteye.com/blog/1744065

默认情况下,ubuntu会将自动安装的软件快捷方式保存在/usr/share/applications目录下,dash home中每个图标对应当中的一个配置文件,如果我们要创建桌面快捷方式,只需要右键-复制-桌面 就Ok

软件手动安装则需要手动创建软件的桌面快捷方式

1、创建一个eclipse.desktop文件,将下面的代码拷贝进去
这里我们只需要关注3个地方,分别为Exec=软件执行文件的路径,Icon=快捷方式图标(如果有的话),Name=快捷方式名称。根据自己软件按转的位置修改代码,保存之后关闭文件。

[Desktop Entry]
Categories=Development;
Comment[zh_CN]=
Comment=
Exec=/home/owen/Software/eclipse/eclipse
GenericName[zh_CN]=IDE
GenericName=IDE
Icon=/home/owen/Software/eclipse/icon.xpm
MimeType=
Name[zh_CN]=eclipse
Name=eclipse
Path=
StartupNotify=true
Terminal=false
Type=Application
X-DBUS-ServiceName=
X-DBUS-StartupType=
X-KDE-SubstituteUID=false
X-KDE-Username=owen

2、给文件添加可执行权限
可以通过chmod +x desktop文件 或者 直接右键权限里面修改。

3、将该文件复制到桌面

 

 

 

 

 

 

 

sudo apt-get update

sudo apt-get install vim

sudo apt-get install build-essential

 

 

对新买的硬盘进行格式化和分区:

(狠心买了个3T的大硬盘,想不到还有太大的问题,需要mbr->gpt什么的。在windos下可以cmd->diskpart工具,ubuntu下fdisk相关工具。但是最起码要在/dev目录下有相应的硬盘的sd*的设备才行,主板BISO系统中sata接口处要能够识别硬盘~.~!)

参考:http://blog.chinaunix.net/uid-23354495-id-1740679.html

先用fdisk分区,分区完成后再用mkfs格式化并创建文件系统,挂载,磁盘就能使用啦。

 MBR:主引导扇区
主分区表:64bytes,最多只能分四个主分区,每个主分区的记录(相关信息,比如分区大小,位置)在主分区表里占14bytes。
 
如 果要建多于四个的分区,就要拿出一个主分区做为扩展分区,再在扩展分区里面进行其它的分区操作。在 建扩展分区的时候会建立一张对应的扩展分区表,它记录了在这个扩展分区里的分区的相关信息;理论上它没有分区数量的限制,在扩展分区内部的分区叫做逻辑分 区,如上图中的 /dev/hda5,/dev/hda6/,/dev/hda7
 
 

安装vsftp:

  1. sudo apt-get install vsftpd
  2. 修改配置文件:sudo gedit /etc/vsftpd.conf(将write_enable=YES的注释打开,这样就能在win7中想ubuntu中上传文件)
  3. 重启服务sudo service vsftpd restart
  4. 在win7中下载FlashFXp软件,新建连接输入ubuntu的ip、用户名和密码,就可以进行ftp连接,默认是到用户的家目录下。

 

 

调节显示dpi:

 

ubuntu xfce桌面环境 设置天terminalemulator快捷键,并且打开时最大化:

http://www.linuxidc.com/Linux/2015-01/111970.htm

我给我的小笔记本装了轻便的xubuntu,方便我随时编写小型代码。

但,每次用快捷键打开terminal都是窗口大小,总要我点击最大化。

于是研究+度娘解决:

1. 快捷键设定在 设置管理器 中的 键盘 里。

2. 原来的快捷键命令是 exo-open --launch TerminalEmulator,该是打开默认终端。

3. 其实xubuntu的默认终端是xfce4-terminal,把命令改为 xfce4-terminal --maximize

4. 解决。 修改的方法是双击原来的命令,会出现弹框修改。

 

 

 

 

Matlab2015b的安装:

盗来的:

安装过程和以前版本大体相同。
安装过程无网
需要输入序列号时从FIK里拷贝
安装完后,将libcufft.so.7.0.28和libmwservices.so拷贝到bin/glnxa64目录下
激活时选择Matlab_R2015b_glnxa64.lic文件。

这里还有个2015a的教程:

http://www.linuxdiyf.com/linux/19617.html

crack文件夹下:

实际操作:

cat yourpath/crack/FIK(复制KEY)
./install

(use a file installation Key->yes->key->installation floder->select products to install 开始安装。)

(不联网,填写key,默认安装到/usr/local/MATLAB/R2015b)

 

将上述so文件sudo cp复制到

/usr/local/MATLAB/R2015b/bin/glnxa64目录下

 

然后就是启动matlab,添加破解文件了:

还是到上面安装的那个bin目录下sudo ./matlab

 

enter the full path of your license file

选中Matlab_R2015b_glnxa64.lic文件就行了

装了半天竟然有个已知的版本问题Ubuntu15之后的都有segmentation问题,-.-!!

在ubuntu论坛上有些解决办法:

http://askubuntu.com/questions/615644/after-upgrading-ubuntu-14-10-to-15-04-i-am-no-longer-able-to-open-matlab-2013a

 

 

 

tricks:

1.创建matlab启动栏快捷方式:打开软件中心,搜索matlab,点击install;安装路径填入:

/usr/local/MATLAB/R2015a(根据实际情况填写)

用户权限不填,表示全部用户可用;gcc不填

2.改变初始目录:

$ cd /usr/local/MATLAB/R2015a/toolbox/local$ sudo touch startup.m$ sudo gedit startup.mstartup.m 中输入:cd '~/workplace/matlab/'

硬件环境是 固态硬盘做系统盘,一块机械硬盘做存储盘,但是在执行有些matlab中mex相关 的程序时会遇到权限问题

http://cn.mathworks.com/matlabcentral/answers/103108-why-do-i-get-an-error-when-running-the-mex-file-from-a-non-standard-location-on-selinux

类似于这样:

/media/sda3/.../timestwo.mexglx: failed to map segment from shared
object: Operation not permitted.

For me removing 'users' option in `/etc/fstab` worked:
sudo umount [your disk location]
sudo gedit /etc/fstab
In order to have read, write, and exec rights, I put following line:
UUID="..." [your disk location] ntfs-3g nls=iso8859-1,uid=1001,umask=0000,defaults,auto,permissions 0 0
It is crucial to remove `users` from this line. Then run:

sudo mount [your disk location]

 

Method 1: Mount Automatically NTFS Drive in Ubuntu 12.04

 

Open terminal by pressing Ctrl+Alt+T or via untiy by typing “terminal” run the commands below to view all partitions on your system. At this point, the drive should already be attached to your Ubuntu Computer

 

sudo blkid

 

you’ll be able to see the device id (UUID) and the file system types. Record the device ID as we’re going to be using it.

 

make directory to mount windows partition at directory /mnt with command below, in this case I’ll be make directory with name ntfs1

 

sudo mkdir /mnt/ntfs1

 

Output:

 

/dev/sda1: UUID="1ED2BF7ED2BF58AB" TYPE="ntfs"
/dev/sda3: UUID="389c1b4e-1337-4e28-8284-d3dc0d974e2c" TYPE="ext4"
/dev/sda6: LABEL="data" UUID="01CB374CDA516280" TYPE="ntfs"
/dev/sda7: UUID="f5a2bd44-18b4-44f0-9f3c-7adc07fe9f6d" TYPE="ext4"
/dev/mapper/cryptswap1: UUID="5dd3b356-d232-48cc-bee1-2f8361382be4" TYPE="swap"

 

Make yourself owner of the mount point with commands below

 

sudo chown <username> /mnt/ntfs

 

Open the fstab file, it require root permision

 

sudo -i
nano /etc/fstab

 

add the line below at the bottom

 

UUID=xxxxxxxxxxx /mnt/ntfs1 ntfs users,defaults 0 0

 

Example file /etc/fstab:

 

UUID=389c1b4e-1337-4e28-8284-d3dc0d974e2c / ext4 defaults 01
UUID=f5a2bd44-18b4-44f0-9f3c-7adc07fe9f6d /home ext4 defaults 02
UUID=d5842ffd-7113-47d9-8135-44b5fe23b792 none swap sw 0 0
UUID=01CB374CDA516280 /mnt/ntfs1 ntfs users,defaults 0 0

 

Save then Restart your Ubuntu computer and now your windows partition will be Mount Automatically when startup.

 

 

 

安装PC传感器监控软件(温度、风扇转速等)

sudo apt-get install lm-sensors hddtemp

sudo sensors-detect

yes....

//sudo /etc/init.d/kmod start

sudo service module-init-tools start

 

http://zhidao.baidu.com/link?url=eSobeZOWmqzyVIxvIJtNK2kgS0aYoSMX790ydEDq5EbLsQldCHkEfOZq6ZdaWfFlafLtnLLAeLPBcRpS_p_cxq

 

 

ubuntu下清理垃圾:

http://jingyan.baidu.com/article/e6c8503c1e05d6e54f1a1808.html

 

clean之后

 

Linux文件系统的基本操作:

mount挂载,umount卸载

http://www.linuxidc.com/Linux/2013-06/85718.htm

 

ubuntu下安装和使用gcc:

http://www.cnblogs.com/zero1665/archive/2009/11/03/1595510.html

sudo apt-get install build-essential

gcc --version

直接编译成a.out:

gcc test.c

使用-o来通过参数的文件名来控制编译行为:

gcc test.c

。。。。待续

 

安装python环境:
http://blog.csdn.net/kingppy/article/details/13080919

 

 

去除广告,保护隐私:

gsettings set com.canonical.Unity.Lenses disabled-scopes "['more_suggestions-amazon.scope', 'more_suggestions-u1ms.scope', 'more_suggestions-populartracks.scope', 'music-musicstore.scope', 'more_suggestions-ebay.scope', 'more_suggestions-ubuntushop.scope', 'more_suggestions-skimlinks.scope']"

 

 搭建git服务器环境:

http://blog.163.com/zheng_he_xiang/blog/static/18650532620154493528569/

创建git用户,admin用户,客户端用户,分别安装openssh,创建公钥和私钥,在各个用户之间传递公钥,(这样连接发起端的用户身份认证虽然可以免去,但是在目标端中写文件还是需要目标用户的密码来获得权限)

安装git-core

git用户下载安装gitolite,并使用admin的公钥设置setup,这样server的配置就算完成了:

 

git clone git://github.com/sitaramc/gitolite
$ mkdir -p /home/git/bin
$ gitolite/install -to /home/git/bin  //这里会在bin目录下安装一下文件
$cd /home/git/bin

./gitolite setup -pk  /home/git/id_rsa.pub

 

到这里,gitolite就安装完成了,它的结果就是生成了两个最基本的仓库(一个admin的一个测试):在 /home/git/repositories 目录中创建了
gitolite-admin.gittestting.git 两个目录
 
admin用户也可以使用git进行admin‘配置仓库’的更新,而admin的主要任务就是对客户端用户进行配置和管理(主要是保存客户端的公钥,为其配置仓库)
admin在家目录中,git clone直接将刚才server生成的gitolite-admin仓库取来
然后为终端用户配置仓库到conf文件,并保存其公钥到key文件夹(其中conf决定了一个新的项目,key决定了用户身份,那些用户能够读写这个项目,所有的项目都托管在git用户的repositories目录下)
 
然后就是重新上传这个master版本:
git add .
git commit -am "comment"
 
git push origin master
 
这样就在server的repositories仓库中生成了该终端的一个仓库xxx.git
 

 

在客户端中使用git

在任何终端或者admin中使用git进行版本控制都需要首先确定用户名和邮箱,作为用户的一个标示,通过git config来实现。 --global参数决定了这个user是写到~/.gitconfig文件中还是写到当前工程的.git目录下。

然后在客户端中就可以在项目中

git add .

git commit -am "xxx"

git remote add origin git@192.xxxx:tomtest //设置对应的git上的项目仓库

git push origin master

 

git clone git@192.168.0.196:tomtest   //下载服务器中的tomtest项目

 

 

 

界面美化

http://www.jianshu.com/p/5b80711f304f

 

从字符界面启动:、

https://www.zhihu.com/question/20509148 

 

mstsc VS vnc : 远程桌面最快的原因在于RDP协议

 

zhihu:

https://www.zhihu.com/question/20509148

posted @ 2016-06-11 13:42  sunnycs  阅读(516)  评论(0编辑  收藏  举报