RSS
 

Archive for 09月, 2009

在Ubuntu下TOR配置Bridges穿墙

27 Sep

非常时期,传统的穿墙术都不好使了,TOR,Gladder,VPN统统失效,就连我配了一个自家用的glype也歇菜了。

看了GFW还是有点牛逼的,不过过墙梯总是会有的,下面两位达人的帖子提供了新的方法

非常时期,如何用“套”穿墙

在Ubuntu下如何配置Tor网桥

可惜啊,都写在墙外的blogspot上,翻墙的梯子在墙外,这不是干着急吗?

经过一翻折腾,好不容易才看到穿墙秘籍。

下面介绍如何在Ubuntu下配置TOR bridges

Step1: 获取网桥地址

用你的gmail帐号发送主题和内容为”get bridges”的邮件至bridges@torproject.org

Step2: 配置Tor网桥

首先,备份原Tor配置文件torrc至备份目录:

sudo cp -p /etc/tor/torrc your-backup-directory

然后在torrc配置文件末尾添加”UseBridges 1“开关选项(默认是0, 即关闭状态),

UseBridges 1

注意:HOLY JOE’S BLOG 中该字段写的是“UserBridges 1” 经测试应该是笔误,将“Use”写成了“User”

最后,将bridges@torproject.org回复邮件中的bridge列表附加至torrc配置文件末尾,请按回复邮件中的bridge的原有格式添加,即:

bridge ip:port fingerprint

上述两篇博客中谈到的邮件中有fingerprint字段,我收到的邮件中没有,但是测试后发现同样有效

Step3: 重启Tor和Privoxy

sudo /etc/init.d/tor restart
sudo /etc/init.d/privoxy restart
 
6 Comments

Posted in GFW

 

Firefox 3.5.3 中文语言包

27 Sep

http://releases.mozilla.org/pub/mozilla.org/firefox/releases/3.5.3/linux-i686/xpi/zh-CN.xpi

或者下载附件:

sshconnect.csshconnect.c (已下载248次)
 
No Comments

Posted in firefox

 

Ubuntu下将硬盘格式化为ntfs分区

17 Sep
  1. 安装ntfsprogs
    sudo apt-get install ntfsprogs
  2. 使用下面命令中任何一个格式化
    sudo mkfs -t ntfs /dev/sdb1

    sudo mkfs.ntfs /dev/sdb1

    sudo mkntfs /dev/sdb1

    如果需要快速格式化加上-f参数

    sudo mkntfs -f /dev/sdb1
 
No Comments

Posted in linux, ubuntu

 

linux下删除文件后没有释放空间

04 Sep

问题

文件被删除后,空间没有被释放

原因

在Linux或者Unix系统中,通过rm或者文件管理器删除文件将会从文件系统的目录结构上解除链接(unlink).然而如果文件是被打开的(有一个进程正在使用),那么进程将仍然可以读取该文件,磁盘空间也一直被占用。

解决方法

首先我们获得一个已经被删除但是仍然被应用程序占用的文件列表:

$ /usr/sbin/lsof|grep deleted
ora    25575 data   33u      REG              65,65  4294983680   31014933 /oradata/DATAPRE/UNDOTBS009.dbf (deleted)

从lsof的输出中,我们可以发现pid为25575的进程持有着以文件描述号(fd)为33打开的文件/oradata/DATAPRE/UNDOTBS009.dbf。

在我们找到了这个文件之后可以通过结束进程的方式来释放被占用的空间。

通过截断proc文件系统中的文件可以强制要求系统回收分配给正在使用的的文件。这是一项高级技术,仅到管理员确定不会对运行中的进程造成影响时使用。应用程序对这种方式支持的并不好,当一个正在使用的文件被截断可能会引发不可预知的问题

$ echo > /proc/pid/fd/fd_number

例如,根据之前lsof的输出:

$ file /proc/25575/fd/33
/proc/25575/fd/33: broken symbolic link to `/oradata/DATAPRE/UNDOTBS009.dbf (deleted)’
$ echo > /proc/25575/fd/33

From lsof output, we find process with pid 25575 has kept file /oradata/DATAPRE/UNDOTBS009.dbf open with file descriptor (fd) number 33.

After a file has been identified you can free space occupied by this reclaimed by shutting down the process in question.

It is possible to force the system to de-allocate the space consumed by an in-use file by forcing the system to truncate the file via the proc file system. This is an advanced technique and should only be carried out when the administrator is certain that this will cause no adverse effects to running processes. Applications may not be designed to deal elegantly with this situation and may produce inconsistent or undefined behaviour when files that are in use are abrubtly truncated in this manner.

$ echo > /proc/pid/fd/fd_number

For example, from the lsof output above


$ file /proc/25575/fd/33
/proc/25575/fd/33: broken symbolic link to `/oradata/DATAPRE/UNDOTBS009.dbf (deleted)'
$ echo > /proc/25575/fd/33

 
No Comments

Posted in linux

 

linux死机后怎么办

03 Sep

蓝屏是windows的一大特点,但是桌面版的linux也会死机。那死机后怎么办呢?

  1. 键盘和鼠标仍然有响应,但是窗口死了。
    Ctrl+Alt+F1 切换到TTY,然后top命令找到cpu占用最高的PID,再kill -KILL PID。
  2. 鼠标键盘都没有响应了
  • 暴力方法
    使用Reset或者常按Power键,这个和windows的方法没有区别。
  • 使用sys rq键
    一般键盘上都有sys rq键,台式机键盘一般和Prt sc共键,笔记本键盘一般和delete共键。
    Sys Rq 是一种叫做系统请求的东西,用于直接向底层系统传达指令。
    使用Sys Rq可以安全地重启计算机。
    具体方法是:Sys Rq+ R+E+I+S+U+B
    看起来有些繁琐,解释一下。
    台式机键盘按Sys Rq需要使用Alt+Prt Sc而笔记本上使用Fn+Delete
    REISUB各个字母的意义分别是:
  • R: Switch the keyboard from raw mode to XLATE mode
  • E: Send the SIGTERM signal to all processes except init
  • I: Send the SIGKILL signal to all processes except init
  • S: Sync all mounted filesystems
  • U: Remount all mounted filesystems in read-only mode
  • B: Immediately reboot the system, without unmounting partitions or syncing
 
No Comments

Posted in linux