- First you have to create the file. The size of a swap should be equal to a memory size (of course if you have a lot of memory you don't need swap). In example, we are creating 256Mb swapfile:
dd if=/dev/zero of=/swapfile bs=1M count=256
- Now, we are creating swap on our file:
mkswap /swapfile
- Next we have to edit the /etc/fstab file, by adding:
/swapfile none swap defaults 0 0
- After that, we can easily turn on our swapfile:
swapon -a
- It will be nice to have swap turning on it the time of system start. To get this we have to edit the /etc/rc. In the standard Crux configuration a swap is turn on before mounting filesystems. To change it we move
# Activate swap /sbin/swapon -a
after lines which mounting partition where our swapfile is:# Mount local filesystems /bin/mount -n -o remount,rw / /bin/rm -f /etc/mtab* /bin/mount -a -O no_netdev
Kind of my extended memory with thoughts mostly on Linux and related technologies. You might also find some other stuff, a bit of SF, astronomy as well as old (quantum) chemistry posts.
Search This Blog
Monday, November 28, 2005
[Not only] Crux and swapfile
I prefer swapfile to swap partition in Linux. The file is much more flexible and have the same performance (in 2.6 kernel). The way to create swapfile in Crux is standard, but you have to hack /etc/rc file to make in turning on in the system start sequence (see point 5).
Thursday, November 24, 2005
EasyChem - to drawing chemical structures
I found very nice soft to drawing chemical structures. It's name is EasyChem and is made by Francois-Xavier Coudert. One of the most interesting feature is that you can use LaTeX commands.
There are things you should to now.
- At thbeginningng it's good to turn on Options--Learning messages.
- It's much better to download the latest snapshot, than the EasyChem from SF.
- If you want include LaTeX fonts into your file, you should change locales before starting EasyChem:
export LANG=C; easychemAt the very end I would like to write, that at the moment I miss only one thing. There are no ornament with symbol of current (for ions, zwitterions).
Monday, November 21, 2005
WindowMaker without DockApps
One of the most annoying thinks in WMakera, are IconApps. Theoretical you can easily turn them off, but you turn off a lot of useful DockApps too. One of the strategy is choosing one application after another and changing to Yes its "No application icon" attribute, but is annoying too. Therefore I was looking for another method. And I found something.
- You choose any of application and setting Default for all windows in"Window Specification" in Attributes.
- Next setting "No application icon" to Yes (Application Specific).
- No you have to open terminal and lists all running applications (your applications). For example ps -u $USER. From this list you have write down all of your dockapps (i.e. wmcalclock, wmnet, wmsysmon, docker).
- Now you have to find what its WM_CLASS attribute. You can use xprop command to do this, i.e.: xprop -name wmnet In this case you should get two string wmnet and WMNET.
- After you write down all of this information you need to edit ~/GNUstep/Defaults/WMWindowAttributes file. You have to turn on AppIcon for chooses application. In our example you have to add this code: wmnet.WMNET = { NoAppIcon = No;}; For other applications you have to write theirs WM_CLASSes at the beginning of line.
- You can now restart your WindowMaker.
Linux4Chemistry
I've just hit the very interesting website, where many chemistry related programs are listed.
Saturday, November 19, 2005
WindowMaker and Docker
Docker is very nice DockApp which simulate KDE/Gnome system tray. I found that the Docker work much nicer in WindowMaker with options -wmaker (obvious) and -vertical (not so clear).
Wednesday, November 16, 2005
When ports building fails
Sometime port failed to build. It would be nice to see what wrong with source, but working directory disappear... I was wondering if it possible to save source file, and finally find fitting option. You need to use pkgmk -kw (kw from keep working).
Massive jobs starting in queue system
Quite often we need to start many jobs in a supercomputer center. In this example I have to submit Gaussian files with com extension. All of them are in one directory. (I have my own script g03-test to start Gaussian). We can do it in a one line:
for i in *.com ; do g03-test "$i"; done
Labels:
computing,
Gaussian,
linux,
quantum chemistry,
shell
Subscribe to:
Posts (Atom)