存档

‘Linux’ 分类的存档

[整理]发现个比RoboForm方便的密码管理软件LastPass

2010年2月13日 Galaxy 没有评论

以前一直用Roboform来管理密码,有Keygen也就不在乎是否需要交米。后来,打算用Linux,却被这个问题困扰了——Roboform没有Linux版。
KeePass是Open Source的,但在浏览器整合上没Roboform方便。KeeForm和KeePass Toolbar也不支持Linux。
刚刚上wiki看到KeePassX(其实Gentoo装的就是这个…),但还是没自动填表,非要drag’n’drop fields。(确实有Auto-Type,不过,是SendKey之类的东东。)
偶然间,看到LastPass,虽然是在线的,但国外的在线服务总比国内的可信,比如Gmail。看完privacy,感觉还行。至于是否保存三次元的密码(就素那些银行帐号啥的),Galaxy还没想好。
阅读全文…

分类: Linux 标签: , ,

Linux下比较两个目录下的文件

2009年11月19日 Galaxy 没有评论

Win下,Beyond Compare。
Linux下,diff -qrs path1 path2

man diff节选:

diff [OPTION]... FILES

-q  --brief
              Output only whether files differ.

-r  --recursive
              Recursively compare any subdirectories found.

-s  --report-identical-files
              Report when two files are the same.

当然,不想看进度就不要-s
阅读全文…

分类: Linux 标签: , ,

平铺式窗口管理器

2009年9月7日 Galaxy 没有评论

http://linuxtoy.org/archives/awesome.html
平铺式窗口管理器——Awesome
2008-08-05 Kardinal Posted in Apps, Window Manager
[撰文/Kardinal]

首先科普一下 Tiling window manager,直译就是“瓦片式窗口管理器”;意译为“平铺式窗口管理器”。

假设你需要同时监视多个程序的状态并进行操作(这种情况非常之普遍),你就需要不停的按Alt+Tab切换,但是这会加速Alt尤其是Tab的磨损(手的磨损忽略了,因为它是可再生的)。

聪明的人就会想出这一招,见图1:

http://ubuntucookbook.com/i/2008/08/awesome1-thumb.jpg

但是要先调整窗口布局,而且总是不太合适,有点缝隙啥的,分散注意力。

而在Tiling window manager 中,无论有多少个窗口,都会把屏幕占满,见图2:

http://ubuntucookbook.com/i/2008/08/awesome2-thumb.jpg

它的窗口没有标题栏(标题在状态栏上),边框尽可能的窄(可再设置为0),以最大程度的节约桌面空间。

awesome还有超低的资源占用率。
阅读全文…

分类: Linux 标签: , ,

解决rdesktop不登录关闭后无法再次连接的问题

2009年7月9日 Galaxy 2 条评论

今天连单位那台6.0.6002的WinServer SP2 Std,结果发现欢迎页被设成一段说明,说密码被初始化了,随便试了2下没蒙对,就直接关了rdesktop,然后,就再也无法登录,直接报“disconnect: Internal licensing error.”

写信问管理员,说rd要1.60的,可还是不行,只好g之,然后,得矣。
阅读全文…

分类: Linux 标签: , ,

[ZT]Linux兼容核项目

2009年5月23日 Galaxy 2 条评论

http://linux.insigma.com.cn/index.php
2009.5.22 Linux兼容内核(Longene)0.2.4发布
2009年5月22日,Linux兼容内核(Longene)0.2.4版正式发布。新版本的Linux兼容内核在0.2.3版的基础上,整体移植了Wine的文件系统管理机制,使得应用程序在Linux兼容内核上的运行效率有了明显的提高。同时,该版本还修正了上一版本中注册表管理、进程/线程管理中的一些bug。
阅读全文…

分类: Linux 标签: , ,

[ZT]Grub4dos ISO booting

2009年5月10日 Galaxy 没有评论

http://partedmagic.com/documentation/124-grub4dos-iso-booting.html

Parted Magic can be booted with grub4dos iso emulation.

You can use the pmagic-4.0.iso from the pmagic-4.0.iso.zip or pmagic-grub4dos-4.0.iso.zip archive. The pmagic-4.0.iso from the pmagic-4.0.iso.zip archive uses isolinux as bootloader, the pmagic-4.0.iso from the pmagic-grub4dos-4.0.iso.zip archive uses grub4dos as bootloader.

When you want to use grub4dos iso emulation without adding extra parameters to the Parted Magic kernel, you can only put the iso only in a few locations, namely /, /images/ and /pmagic/ else Parted Magic won’t find the iso which is needed to access the rest of the files.

The name of the iso can NEVER be changed.

Grub4dos can use 2 distinct types of mapping: direct and memory mapping:


Direct mapping:


When the booted operating system makes a read or write call to the direct mapped image (iso, floppy or hard disk image), then the read or write calls will access and modify the data inside the image directly. Those changes are permanent. With direct access, only the parts of the image, accessed by the booted operating system are read, unlike with memory mapping.

For direct mapping the image needs to be contiguous (not fragmented). If you attempt to directly map an non-continuous file, grub4dos will reply:

Error 60: File for drive emulation must be in one contiguous disk area

Use one of the following programs to defragment the file and try again afterwards:

  • contig: a command line tool for defragmenting single files
  • wincontig: a GUI tool for defragmenting single files

title Parted Magic 4.0 (iso in / and direct mapping)
find –set-root /pmagic-4.0.iso
map /pmagic-4.0.iso (hd32)
map –hook
root (hd32)
chainloader (hd32)

title Parted Magic 4.0 (iso in /images/ and direct mapping)
find –set-root /images/pmagic-4.0.iso
map /images/pmagic-4.0.iso (hd32)
map –hook
root (hd32)
chainloader (hd32)

title Parted Magic 4.0 (iso in /pmagic/ and direct mapping)
find –set-root /pmagic/pmagic-4.0.iso
map /pmagic/pmagic-4.0.iso (hd32)
map –hook
root (hd32)
chainloader (hd32)

The chainloader (hd32) command will boot the bootsector of the iso, which will in turn boot the actual iso.

  • When you use the pmagic-4.0.iso from the pmagic-4.0.iso.zip, the chainloader (hd32) command will start isolinux from the iso.
  • When you use the pmagic-4.0.iso from the pmagic-grub4dos-4.0.iso.zip, the chainloader (hd32) command will start the grub4dos on the iso.

For both pmagic-4.0.iso variants, you also start the grub4dos menu with:

title Parted Magic 4.0 (iso in / and direct mapping and loading new grub4dos configfile)
find –set-root /pmagic-4.0.iso
map /pmagic-4.0.iso (hd32)
map –hook
root (hd32)
configfile /boot/grub/grub4dos.lst

In this case, no other bootloader takes over the command. So in this case, the /boot/grub/grub4dos.lst config file, will be loaded by the grub4dos version with which you mapped the iso.

This will also work when you have memory mapped the iso.


Memory mapping:

The whole image (iso, floppy or hard disk image) will be first copied to RAM (slow for large images, when your BIOS only supports USB1.1). Any changes made, to this memory mapped image, by the booted operating system, will be lost after a reboot. For memory mapping, the image doesn’t need to be contiguous.

title Parted Magic 4.0 (iso in / and memory mapping)
find –set-root /pmagic-4.0.iso
map –mem /pmagic-4.0.iso (hd32)
map –hook
root (hd32)
chainloader (hd32)

title Parted Magic 4.0 (iso in /images/ and memory mapping)
find –set-root /images/pmagic-4.0.iso
map –mem /images/pmagic-4.0.iso (hd32)
map –hook
root (hd32)
chainloader (hd32)

title Parted Magic 4.0 (iso in /pmagic/ and memory mapping)
find –set-root /pmagic/pmagic-4.0.iso
map –mem /pmagic/pmagic-4.0.iso (hd32)
map –hook
root (hd32)
chainloader (hd32)

Moving the pmagic-4.0.iso file:

If you want to put the iso in another directory than /, /images or /pmagic, then you have to pass the directory location of the iso to the Parted Magic kernel (iso_location= parameter).

The name of the iso can NEVER be changed.

title Parted Magic 4.0 (iso is located at /custom, direct mapping and booting the kernel)
find –set-root /custom/pmagic-4.0.iso
map /custom/pmagic-4.0.iso (hd32)
map –hook
root (hd32)
kernel /pmagic/bzImage noapic load_ramdisk=1 prompt_ramdisk=0 rw vga=791 sleep=10 loglevel=0 keymap=us iso_location=/custom
initrd /pmagic/initramfs
map –unmap=0:0xff

Everything in red needs to be on one line.

Links:

Download grub4dos: Use the last release 0.4.4 (older releases don’t support all commands).
Also take a look at a grub4dos guide.

分类: Linux 标签:

[ZT]How To: Load Balancing & Failover With Dual/ Multi WAN / ADSL / Cable Connections on Linux

2009年4月27日 Galaxy 没有评论

How To: Load Balancing & Failover With Dual/ Multi WAN / ADSL / Cable Connections on Linux
http://blog.taragana.com/index.php/archive/how-to-load-balancing-failover-with-dual-multi-wan-adsl-cable-connections-on-linux/
阅读全文…

分类: Linux 标签: , ,

[ZT]老机器上装gentoo的一点手记

2009年2月19日 Galaxy 没有评论

http://www.linuxsir.org/bbs/showthread.php?p=1949672
[QUOTE=cliffordli;1949191]老机器上装gentoo的一点手记

老机装机不容易,因为配置低,很多在好配置机上很容易做的事情在老机上不好做. 本菜经过几天奋战终于将Gentoo装上。 其中经验和大家分享。有更好的方法也请不吝赐教,这才是开源的精神。

没有写完全步骤是因为手册够详细了。一百个人装Gentoo可能有一百种装法,但我想可能90%的都离不开手册, 所以没有装过Gentoo的人务必认真读一遍手册再装。

本菜四个月用Linux经验, 两个月Ubuntu,两个月Gentoo. 当然,作为进入Linux世界最基本的要求英语本菜还是会的, 至少26个字母的各种大小变型组合能在键盘上准确熟练敲出。:)

老机器基本配置:
CPU K6 400
硬盘 4G
内存 128M
光驱不好使
软驱一个 这个对装Gentoo没什么帮助, 呵呵
USB接口一个使用良好
网线接口有点松但能用有时断线
键盘上面写着日语,至今本菜还不明白怎么在上面敲出~ 和 | 这两个在linux世界里很重要的符号。

装机条件:
办公室内,能上网,但有一定限制,因为没有多余的网线给它。已有一台装好Gentoo的机。

(一) 通过SSH给老机装Gentoo

设置好两边的/etc/conf.d/net, 本机192.168.1.3, 老机器是192.168.1.2, 这样两台机就可以找得到了.

老机设好密码: # passwd
开启SSH服务: # /etc/init.d/sshd start
然后从本机登陆: $ ssh root@192.168.1.2

其它就和手册一样的. stage3和portage-latest文件我是从本机scp拷过去的. 省掉了界面和操作不太方便的links.

<br />
$ scp /home/cliffordli/Desktop/stage3-*.tar.bz2 root@192.168.1.2:/mnt/gentoo/<br />
$ scp /home/cliffordli/Desktop/portage-*.tar.bz2 root@192.168.1.2:/mnt/gentoo/<br />

(二) 分享本机的distfiles和空间给老机器

为了节省下载时间和硬盘空间, 可以利用本机的distfiles给老机器, 因为两台都是用稳定分支的x86, 老机器的USE和软件也不会超过本机,所以本机上的distfiles里面的包够用了! 当然,两边的portage都要更新到同一个, 本机还要emerge -uDN world一下, 至少要emerge -f world一下吧.

要开启NFS. 本机上要装nfs

<br />
$ sudo emerge nfs-utils<br />

配置好/etc/exports, 里面加上:
<br />
/home/clfs 192.168.1.2(rw,async,no_root_squash,no_subtree_check)

(注: 装了老机器后,当然要把这上面的去掉了,不然以后这两个文件夹都还是开放的.)

启动NFS服务.

<br />
$ sudo /etc/init.d/portmap start<br />
$ sudo /etc/init.d/nfs start<br />

这样就可以加载了.
<br />
# mount -t nfs 192.168.1.3:/home/clfs /mnt/gentoo/var/tmp/portage

还有更为简单的方法是sshfs, 就是开启本机的SSH服务, 老机要装sshfs-fuse.
这下我们就可以方便的用

# sshfs cliffordli@192.168.1.3:/usr/portage/distfiles /usr/portage/distfiles

(从安全角度出发,本机是不会开放root到ssh.)

(三) 配置distcc

白天上班不方便,晚上还是可以用本机给老机器帮忙编译的.不然即使老机器受得了我可受不了。

都说Gentoo安装难,但我认为Gentoo是最省事的。除了每台机第一次编译和测试内核外, 其它打几个emerge就完事, 但编译内核也不是Gentoo独有的. 特别是新装机,只要一开始运行一下emerge -e system, 包其本上没有装不上的。遇到多一点包要安装通不过去也只要打一下emerge –resume –skip-first又可以去干别的了。对于老机器,我们还可以分布式编译,distcc闪亮登场, 想像一下用现在的双核跑以前i586的内容是什么概念。

两台机都要emerge distcc

因老机器是AMD k6, CHOST定义为i586-pc-gnu-linux, 而本机是Intel, CHOST定义为i686–pc-gnu-linux,所以两台机要共舞不是那么容易。我是这样做的。

老机器上:

装好distcc后. 设置/etc/make.conf, 加上下面几句:

<br />
FEATURES="distcc"<br />
MAKEOPT="-j4"<br />
DISTCC_DIR=/var/tmp/portage/.distcc<br />
DISTCC_HOSTS="192.168.1.3"<br />

然后是改动/usr/lib/distcc/bin下面的几个文件.
<br />
# cd /usr/lib/distcc/bin<br />
# rm c++ g++ gcc cc<br />
# nano -w i586-pc-linux-gnu-wrapper<br />

i586-pc-linux-gnu-wrapper文件内容如下:
<br />
#!/bin/bash<br />
exec /usr/lib/distcc/bin/i586-pc-linux-gnu-g${0:[-2]} "$@"<br />

然后再运行
<br />
# chmod a+x i586-pc-linux-gnu-wrapper<br />
# ln -s i586-pc-linux-gnu-wrapper cc<br />
# ln -s i586-pc-linux-gnu-wrapper gcc<br />
# ln -s i586-pc-linux-gnu-wrapper g++<br />
# ln -s i586-pc-linux-gnu-wrapper c++<br />

本机上

配置好/etc/conf.d/distccd文件.

<br />
DISTCCD_OPTS="${DISTCCD_OPTS} --allow 192.168.1.2"<br />

开启distcc服务

$ sudo /etc/init.d/distccd start

本来想用crossdev省点事的,谁知用crossdev -t i586后装的是gcc-4.3.3的版本,自然不能和稳定分支的gcc-4.1.2共舞了. 还得自己动手.

<br />
$ cd /usr/local/bin<br />
$ sudo nano -w i586-pc-linux-gnu-wrapper<br />

i586-pc-linux-gnu-wrapper文件内容如下:

<br />
#!/bin/bash<br />
`echo $(basename $0) |sed -e "s/i586-pc-linux-gnu-//"` -m32 "$@"<br />

然后运行
<br />
$ sudo chmod a+x i586-pc-linux-gnu-wrapper<br />
$ sudo ln -s i586-pc-linux-gnu-wrapper i586-pc-linux-gnu-gcc<br />
$ sudo ln -s i586-pc-linux-gnu-wrapper i586-pc-linux-gnu-g++<br />
$ sudo ln -s i586-pc-linux-gnu-wrapper i586-pc-linux-gnu-c++<br />

经试验,除了emerge -e system有个别包不能用distcc外,大部分包都能用distcc, 对于不能通过的包,只要打下emerge –resume –skip-first编译完后只要在/etc/make.conf把distcc注释掉运行一下emerge -uDN world(对于emerge -e system不能通过的) 或是重新emerge一下就行了。很欣赏Gentoo的哲学, 这点太人性化了。

以上是本菜装Gentoo的几点手记,方便以后要象我一样装机的,这几天装机累坏了。还请兄弟们多多赐教。

修改:
2009. 2.19 加上sshfs的内容.[/QUOTE]

分类: Linux 标签: , , ,
Locations of visitors to this page