分類
其它

Ubuntu添加Win共享的打印机

system-config-printer

有时直接添加win共享的打印机无法搜索,执行上面命令就可以在打开窗口中输入IP搜索打印机了,然后下一步下一步就搞定了。什么没驱动,做好心理准备谷歌吧!

分類
Linux 网站

Apache限制IP访问

只需在配置文件中添加如下代码即可:

<Location />
Order Allow,Deny
Allow from localhost
Deny from 192.168.1.*
</Location>

我的配置文件位于/etc/apache2/sites-enabled/000-default。将上面Location节点放在VirtualHost节点内即可。其实现的效果是除本机外其他局域网主机都无法访问站点。

重启Apache时提示Could not reliably determine the server's fully qualifieddomain name可以通过在/etc/apache2/httpd.conf中添加一行ServerName localhost来解决。

最后在记一下修改Ubuntu hosts文件方法:

  1. 打开hosts文件:sudo gedit /etc/hosts
  2. 添加一行:127.0.0.1 localhost
  3. 重启网络:sudo /etc/init.d/networking restart

比较遗憾的是host文件并不支持通配符。

分類
Linux

Ubuntu安装fcitx中文输入法

听说fcitx中文输入法是较为先进的中文输入法,而且拥有相对漂亮的皮肤,当然亮点还是能支持云输入法,众多优点当然要试一下啦。要安装fcitx中文输入法,依此在终端执行如下命令:

<code>sudo add-apt-repository ppa:wengxt/fcitx-nightly</code>
<code>sudo apt-get update</code>
<code>sudo apt-get install fcitx fcitx-config-gtk fcitx-sunpinyin</code>
<code>sudo apt-get install fcitx-table-all</code>

下面两条命令是可选的,第一个是设置fcitx为默认输入法,第二个是为防止乱码所安装的uming字体。

<code>im-switch -s fcitx -z default</code>
<code>sudo apt-get install ttf-arphic-uming</code>

最后需要重启生效。如果没有中文输入法出现,可以在Configuation里点“+”,然后反选Only Show Current Language,在下面输入框里输pinyin就可以添加中文输入法了。默认Ctrl+Space切换输入法,Shift切换语言,中文下按Enter输入英文。

分類
Linux

VirtualBox更新扩展错误

在window xp下更新了Virtual Box,但是在更新扩展包是遇到了如下错误:

Failed to install the extension. The installer failed with exit code 1: VBoxExtPackHelperApp.exe: error: Failed to rename the extension pack directory: VERR_ALREADY_EXISTS.

解决办法如下:首先关闭Virtual Box,然后进入命令行,切换到Virtual Box的安装目录,如D:Program FilesOracleVirtualBox,然后运行下

vboxmanage extpack cleanup

这样问题就解决了。另外的我的扩展包默认是下载在C:Documents and SettingsAdministrator.VirtualBox里面的,直接双击就能安装了。

分類
Linux

Ubuntu更新软件源

首先备份下旧源:

sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

然后替换源:

sudo nano /etc/apt/sources.list

一个源:

deb http://archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ precise-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ precise-proposed main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ precise-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ precise-proposed main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse
分類
Linux

PuTTY

PuTTY is an SSH and telnet client, developed originally by Simon Tatham for the Windows platform. PuTTY is open source software that is available with source code and is developed and supported by a group of volunteers.

直接下载putty.exe就可以在Windows上方便的ssh连接远程的Linux主机了。但是要从Windows传文件给Linux的话,就还需要下载pscp.exe。最好把它放在C:WINDOWSsystem32中,这样就能直接在终端使用pscp命令了。来个示例:

C:Documents and SettingsAdministrator>pscp F:/eula.1028.txt [email protected]:/tmp
分類
Linux 软件

Ubuntu下Chromium与Opera

对比来对比去还是Opera好用!

Chromium Opera
不同设备同步书签和密码 [1]
HTML5支持
页面分析工具
开源软件
右键查看图片详情
插件支持 [2]
页面定时自动刷新 通过插件实现
页面内容拦截 通过插件实现[3]
方便的从缓存中提取资源 [4]
1G内存下崩溃率 经常[5] 极少