backup:
cd /mnt/linux && tar -jcvf /mnt/bak/linux.tar.bz2 *
restore:
tar -jxvpf /mnt/bak/linux.tar.bz2 -C /mnt/linux
上面的操作假定需要备份的分区已经挂载在 /mnt/linux上。
如果备份失败,可以考虑使用live-CD,或启动到另外一个linux系统下进行备份。
另外,这种方式备份的压缩率是非常高的。有多高,试试吧
8/15/2006
实现按下Ctrl+Alt+Del打开任务管理器-ubuntu技巧
gconftool-2 -t str --set /apps/metacity/global_keybindings/run_command_9 "Delete"
gconftool-2 -t str --set /apps/metacity/keybinding_commands/command_9 "gnome-system-monitor"
试试吧,如果不行Ctrl+Alt+Backspace后再试,其实用这个可以实现运行任意程序的快捷键,作相应的替换即可。只在ubuntu 6.06即dapper上测试通过,不过应该只要是用gnome的都是可以的,比如Fedora Core Linux系列。
参考资料:
http://ubuntuguide.org
8/14/2006
flash播放器-create a simple flash playing html file
对于一般的swf文件,将其拖放到游览器上就可以播放的。
但这样播放我们无法实现前进后退等,而且对于一些有加密的swf文件(比如著名的新东方口语教程),根本无法播放。
在win下,情况还好,只要安装一个flash播放器就好了。但是对于linux来说,目前还没有一个很好的独立(stand-lone)的播放器。
因此我做了一个可以生成播放各种swf的html网页,适用于各个平台(希望大家帮忙测试)。
只要访问这个页面即可以生成好用的html文件:
http://www.herofit.com/flashplayer/index.php
使用比较简单,但我还是做了一个帮助文件:
http://www.herofit.com/flashplayer/download.php?file=sample.swf
这里提醒一下:
参考资料:
网页播放器:http://www.unixuser.org/~euske/vnc2swf/
php强制下载脚本:http://elouai.com/force-download.php
……
但这样播放我们无法实现前进后退等,而且对于一些有加密的swf文件(比如著名的新东方口语教程),根本无法播放。
在win下,情况还好,只要安装一个flash播放器就好了。但是对于linux来说,目前还没有一个很好的独立(stand-lone)的播放器。
因此我做了一个可以生成播放各种swf的html网页,适用于各个平台(希望大家帮忙测试)。
只要访问这个页面即可以生成好用的html文件:
http://www.herofit.com/flashplayer/index.php
使用比较简单,但我还是做了一个帮助文件:
http://www.herofit.com/flashplayer/download.php?file=sample.swf
这里提醒一下:
- 如果选的是Relative Path(默认),需要将所得的html和swf放在同一个文件夹中
- 如果选的是Absolute Path,需要保证swf在原来的位置不变,html可以放在任意文件夹
参考资料:
网页播放器:http://www.unixuser.org/~euske/vnc2swf/
php强制下载脚本:http://elouai.com/force-download.php
……
8/13/2006
linux下教育网直通车的安装配置-Virtual Private Network (VPN)
安装过程不再重复,请参看http://pptpclient.sourceforge.net/
配置过程
先看一下路由表的差别
Destination Gateway Genmask Flags Metric Ref Use Iface
58.207.255.17 219.216.126.254 255.255.255.255 UGH 0 0 0 eth0
58.207.255.18 * 255.255.255.255 UH 0 0 0 ppp0
219.216.126.0 * 255.255.255.0 U 0 0 0 eth0
default * 0.0.0.0 U 0 0 0 ppp0
58.207.255.18 * 255.255.255.255 UH 0 0 0 ppp0
219.216.126.0 * 255.255.255.0 U 0 0 0 eth0
default 219.216.126.254 0.0.0.0 UG 0 0 0 eth0知道问题就简单了,随便来几个route add,route del就OK了,方便点就是写成脚本咯
我想同时使用原来的IP访问学校的论坛,FTP……因为它们限制了访问IP范围
http://pptpclient.sourceforge.net/
http://bbs.vip.edu.cn/phpbb3/viewtopic.php?t=85
……
配置过程
- 1。在root下启动pptpconfig
- 2。点Sever页。Name随便填;Server填上58.207.255.17;剩下两项就填自己申请的用户名和密码
- 3。Routing页,选中All To Tunnel,所有连接都走VPN的意思
- 4。DNS页,去掉所有选择
- 5。Encryption页,同样不要选择任何选项,然后点ADD
- 6。注释掉/etc/ppp/options.pptp文件中 require-mppe-128
- 7。将58.207.255.35添加(注意是添加,不是替换)到DNS列表。
- 之后在pptpconfig里面点start就可以了。
- 安装配置必须有root权限
- 填写Server时如填成lns_bj.vip.edu.cn,则会出现狂发数据据包或ping不通的问题
- 能用,pon
,poff .同样需要root权限
先看一下路由表的差别
- 用pptpconfig连接正常后的路由表:
Destination Gateway Genmask Flags Metric Ref Use Iface
58.207.255.17 219.216.126.254 255.255.255.255 UGH 0 0 0 eth0
58.207.255.18 * 255.255.255.255 UH 0 0 0 ppp0
219.216.126.0 * 255.255.255.0 U 0 0 0 eth0
default * 0.0.0.0 U 0 0 0 ppp0
- 运行pon后的路由表:
58.207.255.18 * 255.255.255.255 UH 0 0 0 ppp0
219.216.126.0 * 255.255.255.0 U 0 0 0 eth0
default 219.216.126.254 0.0.0.0 UG 0 0 0 eth0知道问题就简单了,随便来几个route add,route del就OK了,方便点就是写成脚本咯
我想同时使用原来的IP访问学校的论坛,FTP……因为它们限制了访问IP范围
- 可以的,只要改一下路由表走向就可以了
- 首先获得你要访问的服务器的相关信息,主要是网络号,掩码等
- 接着添加路由信息到路由表
- 比如route add -net 202.118.0.0 netmask 255.255.0.0 dev eth0,其中dev可省略
- 如果需要添加多条,可以写到脚本中
http://pptpclient.sourceforge.net/
http://bbs.vip.edu.cn/phpbb3/viewtopic.php?t=85
……
8/12/2006
what is "sticky bit mode" , "SUID" , "SGID"
Hi,
I was not able to understand the concept
sticky bit mode , SUID & SGID.
can any one help me in this??
The sticky bit is represented by a t when you do ls -l. Its use is defined at http://www.unixguide.net/hp/faq/5.1.9.shtml. In general, it will stop the kernel from unloading the program from memory right after it's finished running (so subsequent runs of the program will be faster).
The setuid bit (s in the user column) allows an executable file, when run, to take on root privileges. You should only use this for programs designed to give up the privileges that they don't need right after they start.
The setgid bit (s in the group column) is the same as setuid, except that it takes on the root group permissions rather than the user. (In general, if you set setuid then you should also set setgid).
Hello augustus123,
There are some differences in the concepts stated by 'rjlee'.
1) Sticky bit was used on executables in linux (which was used more often)so that they would remain in the memory more time after the initial execution, hoping they would be needed in the near future. But since today we have more sophisticated memory accessing techniques and the bottleneck related to primary memory is diminishing, the sticky bit is not used today for this. Instead, it is used on folders, to imply that a file or folder created inside a stickybit-enabled folder could only be deleted by the creator itself. A nice implementation of sticky bit is the /tmp folder,where every user has write permission but only users who own a file can delete them. Remember files inside a folder which has write permission can be deleted even if the file doesn't have write permission. The sticky bit comes useful here.
2) As of SUID or SetUID bit, the executable which has the SUID set runs with the ownership of the program owner. That is, if you own an executable, and another person issues the executable, then it runs with your permission and not his. The default is that a program runs with the ownership of the person executing the binary.
3) The SGID bit is the same as of SUID, only the case is that it runs with the permission of the group. Another use is it can be set on folders,making nay files or folders created inside the SGID set folder to have a common group ownership.
Hope this was useful and you got the point.
quoted form: http://www.linuxquestions.org/questions/showthread.php?t=258719
订阅:
博文 (Atom)