Chinaunix首页 | 论坛 | 博客
  • 博客访问: 302204
  • 博文数量: 47
  • 博客积分: 2455
  • 博客等级: 大尉
  • 技术积分: 558
  • 用 户 组: 普通用户
  • 注册时间: 2008-12-25 15:43
文章分类

全部博文(47)

文章存档

2016年(2)

2012年(10)

2011年(13)

2010年(1)

2009年(19)

2008年(2)

分类: LINUX

2009-02-21 21:29:10

1 CVS 使用代理(proxy)

cvs -d
:pserver;proxy=host;proxyport=number:user@cvshost:/somerepository

2 subversion 使用代理

编辑~/.subversion/servers , 设置global的项.

[global]
http-proxy-host=proxy-host
http-proxy-port=proxy-port

3 让软件可以通过http代理服务器访问网络, ftp软件通过ftp代理服务器访问网络
设置http_proxy,和ftp_proxy
export http_proxy="http_proxy_address"
export ftp_proxy="ftp_proxy_address"

4 Ubuntu Linux可以通过apt-get来进行软件的下载,更新, 具体的命令为:

winter@Ubuntu8:~$ apt-get --help
apt 0.7.14ubuntu6 for i386 compiled on Aug 14 2008 16:54:20
Usage: apt-get [options] command
apt-get [options] install|remove pkg1 [pkg2 ...]
apt-get [options] source pkg1 [pkg2 ...]

apt-get is a simple command line interface for downloading and
installing packages. The most frequently used commands are update
and install.

Commands:
update - Retrieve new lists of packages
upgrade - Perform an upgrade
install - Install new packages (pkg is libc6 not libc6.deb)
remove - Remove packages
autoremove - Remove automatically all unused packages
purge - Remove and purge packages
source - Download source archives
build-dep - Configure build-dependencies for source packages
dist-upgrade - Distribution upgrade, see apt-get(8)
dselect-upgrade - Follow dselect selections
clean - Erase downloaded archive files
autoclean - Erase old downloaded archive files
check - Verify that there are no broken dependencies

Options:
-h This help text.
-q Loggable output - no progress indicator
-qq No output except for errors
-d Download only - do NOT install or unpack archives
-s No-act. Perform ordering simulation
-y Assume Yes to all queries and do not prompt
-f Attempt to correct a system with broken dependencies in place
-m Attempt to continue if archives are unlocatable
-u Show a list of upgraded packages as well
-b Build the source package after fetching it
-V Show verbose version numbers
-c=? Read this configuration file
-o=? Set an arbitrary configuration option, eg -o dir::cache=/tmp
See the apt-get(8), sources.list(5) and apt.conf(5) manual
pages for more information and options.
This APT has Super Cow Powers.


可以使用的软件列表可以通过: 查询获得.

5. Ubuntu Linux直接使用deb/rpm包安装

对于deb包有:
dpkg -i PATH_OF_DEB
要求有superuser的权限

对于RPM,首先要转化为deb:
sudo alien xxxx.rpm
而后安装deb包

6 Ubuntu11.04上配置apache2+php+mysql
-1 安装apache2: apt-get install apache2
在浏览器中打开 来验证安装
-2 安装php5: apt-get install php5
安装php5-mod: apt-get install libapache2-mod-php5
-3 安装mysql: apt-get install mysql-server
安装mysql的apache2和php5的对应模块:
apt-get install libapache2-mod-auth-mysql
apt-get install php5-mysql
详细参见:


7 Linux下DHCP网络设置:
* Redhat / Fedora / Oracle:
编辑 /etc/sysconfig/network-scripts/ifcfg-eth0 , 使之包含以下内容:
DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes
* Debian / Ubuntu:
编辑 /etc/network/interfaces , 使之包含以下内容:
auto eth0
iface eth0 inet dhcp
修改完毕, 重启网络设置即可:
/etc/init.d/network restart


8 Ubuntu Linux 切换到控制台和桌面环境
在默认是桌面环境的情况下, 可以使用Ctrl+Alt+F1切换到第一个控制台, 还有第二个,第三个等等
可以在使用Ctrl+Alt+F7切换回默认的桌面环境

9 Ubuntu 10.10 desktop中, 在vnc窗口中打开的terminal在按下d键时会全部最小化.
  stackoverflow处得来的解答:
  1. Go to System -> Preferences -> Keyboard Shortcuts;
  2. Select the row Hide all normal windows and set focus to the desktop;
  3. Press Alt+D or any other combination;
  4. Kill your current vncserver connection by vncserver -kill :1;
  5. Restart it by vncserver :1;
  6. Re-connect it from your VNC client


10 解决error: .repo/manifests/: contains uncommitted changes

winter@localhost:~/android$ repo sync
Fetching projects: 100% (228/228), done.
info: A new version of repo is available

error: .repo/repo/: contains uncommitted changes

网友解决:
richi 大虾:
to recover any uncommitted change, you should use 'git stash' and 'git clean -f -d'
for example: if you find it say there are uncommitted changes in .repo/manifests, you shoud 'cd .repo/manifests' and then 'git stash', 'git clean -f -d'



11 设置VI查询时case-sensitive的设置

To ignore case in the searches, enter the following command:

:set ignorecase

This command can be abbreviated :set ic. To turn off this feature, use the following:

:set noignorecase



12 ANT使用代理

根据文档 , 在bash中设置ant全局代理的方式为:

export ANT_OPTS="-Dhttp.proxyHost=proxy -Dhttp.proxyPort=8080"



13 MAVEN使用代理

按某些文章所言, 其实MAVEN_OPTS也可以设置代理, 但我没有成功. 在试过的一些方法中, 只有下面的成功了:
根据
创建并修改了 $HOME/.m2/settings:

点击(此处)折叠或打开

  1. <settings>
  2.   <proxies>
  3.    <proxy>
  4.       <active>true</active>
  5.       <protocol>http</protocol>
  6.       <host>proxy.somewhere.com</host>
  7.       <port>8080</port>
  8.       <username>proxyuser</username>
  9.       <password>somepassword</password>
  10.       <nonProxyHosts>www.google.com|*.somewhere.com</nonProxyHosts>
  11.     </proxy>
  12.   </proxies>
  13. </settings>
由于我的代理并没有用户名密码, 我就没有这两项, 而且nonProxyHosts也没设置.  不过估计这个只对maven2有效, maven3是不是有效不得而知. 有时真是烦死这些不采用http_proxy的乱七八糟的代理设置方式来.

14 Linux下释放内存命令:


主要在在于更改proc文件系统的一个文件:
echo 3 > /proc/sys/vm/drop_caches
可以用cat /proc/sys/vm/drop_caches来确认是否被更改
在此操作前后, 可以用"free -m"检查内存是否被释放.

15 javadoc使用代理
运行javadoc经常需要访问oracle/sun的Java官方网站, 于是在内网时通常就需要设置代理.
可以传递以下选项给javadoc, 使得javadoc可以使用代理访问外部网站:
-J-Dhttp.proxyHost=hostname -J-Dhttp.proxyPort=##

阅读(2323) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~