Jaiwant Mulik

OpenSim

Working Regions.ini file

[Classics]
RegionUUID = D468B529-95F2-44A7-B4A8-683F03CDFC20
Location = 1002,1002
InternalAddress = 0.0.0.0
InternalPort = 9001
AllowAlternatePorts = False
ExternalHostName = x.x.x.x (replace with host ip address)

[Corfu]
RegionUUID = 5c445740-6460-43d3-ba4c-444444445555
Location = 1001,1001
InternalAddress = 0.0.0.0
InternalPort = 9002
AllowAlternatePorts = False
ExternalHostName = x.x.x.x (replace with host ip address)

Blender

PARTS OF AN OBJECT (Edit Mode, cursor is "+".): Objects are made of meshes. Meshes has vertices, edges and faces.

To move to edit mode: From menu or "Tab".

Select vertices, edges, surfaces: Right click near. Right click again to toggle.

Select everything in an object: "a".

Transform the selected vertices/edges: Use "s", "r" or "g" to scale, rotate or grab, just like in the object mode.

Extrude: Select vertices, edge or face you want to extrude, then "e" then move.

Extrude is very useful and commonly used. Use TAB to move between Object and Edit mode.

Box select: In Edit Mode, "b" then left button and drag box to select points. Box deselect: In Edit Mode, "b" then middle button and drag box to deselect points.

To delete selection: Select then "x".

To select a different object than the one currently select: "Tab" to move to Object Mode. The right click to select object. "Tab" to move to Edit Mode.

MATERIALS

Select the "Buttons Window" Menu panel and then click on Materials Button. To select another object, go back to object menu and in 3D window and select new object.

ANIMATION:

http://www.blendercookie.com/getting-started-with-blender-animation/ is a great tutorial, except that the record does not seem to work in my version. Using "i" to insert key frames at specific points in the timeline works great.

Enscript

enscript -2 -r -f Arial10 -onetfilter-hacking-HOWTO2.ps netfilter-hacking-HOWTO.txt Convert txt file to ps with 2 cols per page (-2), in landscape mode (-r) with font Arial size 10 (-f) enscript -Ec -2rG -o output.ps input.c Pretty c 2 column, rotated, gaudy

Linux Sysadmin

To install the parallel port Zip drive use: /sbin/modprobe imm and not the ppa module as the HOWTO suggests (the HOW TO is very old) on my machine: mount /dev/sda /mnt/zip

Wireless

/etc/rc.d/init.d/pcmcia start On my machine eth1. "iwconfig" to check

Sound

When Realplayer or XMMS does not start with the "Cannot open sound device: Another application may be using it" kind of error, check for zombie processes of other sound applications. plaympeg is a notorious one, it is configured as my Opera media player and sometimes will leave zombies. Worse they do not seem to die with "killall plaympeg", you must "kill -9" all the zombies manually. Always make sure using "ps auxwww | less" that there are no other sound application zombies around. Don't completely trust "kill" and "killall", check for yourself. Once such zombies are dead sound seems to always work for me :-)

Library not found

If you just compiled a new library but your program cannot find it. Add the path to the lib in /etc/ld.so.conf and run ldconfig.

If you just compiled/installed a library and another program cannot find the newer version you installed (pkg-config is still reporting the older version), define a new environment variable PKG_CONFIG_PATH and set it to the path for the pkgconfig (.pc) file for that library (look at the output of the compilation and you can figure out where the .pc file was installed). Setting a value to to PKG_CONFIG_PATH does not affect the default path pkg-config already searches, it just appends to the default path.

Sound/ALSA If you have to recompile the ALSA modules for your kernel it might advisable to use the i386 setting instead of the i686 setting even if your machine is the latest and greatest Pentium and the kernel says i686. Ensure that the kernel version number given to "rpm --rebuild" is the same as the output of "uname -a". By default the sound is muted, use alsamixer to unmute. If alsamixer does not start then you will not get any sound :-). Make sure that alsamixer works. Instructions at FreshRPMS are good.

Linux kernel

Installing a new kernel: Remove the old kernel source from /usr/src/linux Download the new kernel source into /usr/src bunzip2 linux-x.x.x.tar.bz2 tar xvf linux-x.x.x.tar mv linux linux-x.x.x ln -s linux-x.x.x linux cd linux make mrproper make menuconfig make dep; make bzImage make modules; make modules_install cp /usr/src/linux/arch/i368/boot/bzImage /boot/bzImage-x.x.x update lilo rm -rf /usr/include/linux /usr/include/asm ln -s /usr/src/linux/include/linux /usr/include/linux ln -s /usr/src/linux/include/asm /usr/include/asm Enjoy.

HTTPD

Symptom: httpd does not start (segmentation fault) While configuring apache make sure that in the configuration file, usually /etc/httpd/conf/httpd.conf, the "Servername" directive is set to the domain name of the server.

SCTPD

Symptom: Segmentation fault while receiving data. To register callbacks in sctpd, we declare a variable of type UDP_UA_CB which we then populate with function calls. Make sure that the declaration of the variable is global. This is because it is passed by reference to register_UA_UDP_Callbacks().

TCPLIB

Symption: Programs hang midway or otherwise erratic runtime behavior If function tcplib in tcplib.c contains debug statements ... bad things can happen. Make sure that you have a fresh install of tcplib on whichever machine you plan to use it on. Do not copy a installation from one machine to another "similar" machine.

C Programming

When programming using multiple sources files, compiling them separately and then linking them, remember to declare user defined functions as extern when using in a source file where it is not defined. gcc ohsource.o sctpTelnetSource.o ../tcplib/telnet.o ../tcplib/tcplib.o ${WRAPPER}.o ${INCDIR} ${LIBDIR} ${LIB} ${FLAGS} -o ${OHSOURCE}

is not the same as

gcc ohsource.o sctpTelnetSource.o ../tcplib/telnet.o ../tcplib/tcplib.o ${INCDIR} ${LIBDIR} ${LIB} ${FLAGS} ${WRAPPER}.o -o ${OHSOURCE}

For structures, always use memcpy() to copy and always pass by reference.

Installing NIST Net

How to install Nistnet on a Redhat 7.2 machine. Install Redhat 7.2 with kernel sources and the X-Development Kit. Ensure that the kernel sources are in /usr/src/linux. The realtime clock driver should be a modules instead of being compiled into the kernel. Using a kernel configuration tools (eg. ma ke menuconfig) look under "Character devices" and make sure that the RTC is modularized. Also, to insmod from complaining turn off modules versioning. If necessary recompile and reinstall the kernel and modules.

kernel-2.2.16-i386-BOOT.config kernel-2.2.16-i586.config kernel-2.2.16-i386-smp.config kernel-2.2.16-i686-enterprise.config kernel-2.2.16-i386.config kernel-2.2.16-i686-smp.config kernel-2.2.16-i586-smp.config kernel-2.2.16-i686.config To determine which one is actually being used, type uname -r - on the box here, this gives 2.2.16-22enterprise, so the appropriate config file is kernel-2.2.16-i686-enterprise.config.

cp kernel-2.2.16-i686-enterprise.config ../.config - replace this with whichever one is appropriate cd /usr/src/linux make menuconfig - look over the selections if you wish, though you probably don't need to change anything. When you exit, say "yes" to saving the kernel configuration. make dep - creates all the dependencies and so on corresponding to your configuration. If you don't have a /usr/src/linux/configs directory, you'll have to create a configuration file as best you can. Just skip to the make menuconfig part above. For other packages, you may want to put some effort into setting up a good configuration, but for NIST Net, the default values are almost certainly good enough, so you can just exit out and save. You should now be able to compile and install NIST Net. Now, make the following changes to the source (from nistnet mailing list): In rtc_capture.c, I changed:

int irq_desc_addr;

to

#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,3,0) int irq_desc_addr; #endif

And in knistnet.c, I changed:

#if LINUX_VERSION_CODE > KERNEL_VERSION(2,1,0) extern int irq_desc_addr; MODULE_PARM(irq_desc_addr, "i"); #endif

to

#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,3,0) #if LINUX_VERSION_CODE > KERNEL_VERSION(2,1,0) extern int irq_desc_addr; MODULE_PARM(irq_desc_addr, "i"); #endif #endif This stops insmod from complaining about the unresolved irq_desc_addr symbol. Create the following directories: /usr/local/man/man1, /usr/local/man/man3, usr/local/man/man4 Now follow the instructions given in the nistnet README.1st file. If all goes well, nistnet should be installed. Reboot the machine. Do $ cnistnet -u $ cnistnet -a 10.1.1.1 10.1.2.1 --delay 5000 This installs a delay of 5000 msec between the two hosts. Of course, you will have to configure the rest of the network to use this nistnet machine as the router. Network Simulator 2 (NS-2)

In the ns-allinone-2.1b9: ns-allinone-2.1b9/ns-2.1b9/ns-tutorial/index.html is messed up !! The ping example described in the tutorial does not work. The correct code can be found in ns-allinone-2.1b9/ns-2.1b9/apps/ping.cc and ping.h. The main difference seems to be in the way packet header information is accessed. Trick to dynamically set destination addresses in NS-2 if(argc == 4)

}

SAMBA

When configuring samba on Linux and using windows 2000 clients do (among other things): [from redhat manual] To configure Samba on your Red Hat Linux system to use encrypted passwords, follow these steps:

Create a separate password file for Samba. To create one based on your existing /etc/passwd file, at a shell prompt, type the following command: cat /etc/passwd | mksmbpasswd.sh > /etc/samba/smbpasswd The mksmbpasswd.sh script is installed in your /usr/bin directory with the samba package.

Use the command chmod 600 /etc/samba/smbpasswd to change permissions on the Samba password file so that only root has read and write permissions.

The script does not copy user passwords to the new file. To set each Samba user's password, use the command smbpasswd username (replace username with each user's username). A Samba user account will not be active until a Samba password is set for it.

The next step is to enable encrypted passwords in the Samba configuration file. In the file smb.conf, uncomment the following lines: encrypt password = yes smb passwd file = /etc/samba/smbpasswd To have the changes take effect, restart Samba by typing the command service smb restart at a shell prompt.

Visor

Using jpilot + pilot-xref Kernel modules required: usbserial and visor. On my machine the cradle seems to be attached to /dev/usb/ttyUSB1 To test pilot-xref use: "pilot-xfer -p /dev/usb/ttyUSB1 -b visorbackup" and must simultaneously press the hot sync button on the visor. Then set a username and id for the visor using: "install-user /dev/usb/ttyUSB0 " <put full name here include quotes>" <numeric id here >"

Now start jpilot, press sync on jpilot and the hot sync on the cradle and everything should work like a charm.

Note: If you do not use the pilot-xfer command and simultaneously press the hotsync button, pilot-xfer will complain about not finding the device/unable to bind.

NIS/NFS

Setting up NIS in Redhat 7.2

Use the "authconfig" tools to setup user authentication. It is simpler then trying to struggle with NIS configuration (which sometimes despite your best intentions refuses to work :-().

NFS

If you at a client you get "permission denied" error while trying to mount a remote NFS dir, look at the /var/log/messages on the server for nfsd error messages. If the error says "exports entry not found" AND there IS an /etc/exports entry you should either restart nfsd or run "exportfs -a" to rebuild the database of exported directories/machines. Palm Programming

iNitial setup hints here. However, it is missing a resource file and the makefile is needs adjustment. The resource file should look like:

FORM ID HelloForm AT (0 0 160 160) 
BEGIN
    TITLE "Hello World"
END

Note: If there is not clause between the BEGIN and END, the application will crash. There should be some keyword there. The resource file compilation part of the makefile should look like: resource.binaries:

and you should include the resource.h file in your application source. make

 Warning: Clock skew detected. Your build may be incomplete 

If your filesystem is NSF mounted this probably means that your machine's clock is not synchronized to the NSF server clock. Do "ypwhich" to find the NSF server and then "ntpdate <server>" a couple of time to synchronize your clock with the NSF server.

XYpic

To get thick line in arrow (or another connectors) in xypic you must use:

\usepackage[dvips,all,color,line]{xy} 
An example to create a thick colored line is:
\[
\xymatrix{ A\ar@*{[green]}@*{|<5pt>]}[rrr] &&& B}
\]

If you are using emacs in the Latex mode and want to enter the double-quotes character, say for the prefix character, they hitting the double-quotes character on the kerboard will not work. Hitting double quotes in the Latex mode insets two single quotes. A quick work around is the temporarily change to the fundamental mode insert the "real" double quote and then switch back to Latex mode. Drawing arrows: If you name two object "a" and "b" then to get a arrow from "a" to "b" use  \ar@{->} "a";"b"  on a new line.

Latex

Figure placement To get 2 pictures side-by-side in the figure environment use, in the premable (taken from Kluwer style file kapproc.cls):

\long\def\sidebyside#1#2{%
\hbox to\textwidth{\vtop{\hsize=.45\textwidth%
\parindent=0pt
\centering
 
#1\vskip1sp}\hfill\vtop{\hsize=.45\textwidth%
\parindent=0pt
\centering
#2

}}} and in the main text put:

\begin{figure}
\hspace{.5cm}\scalebox{0.15}{\includegraphics{first.eps}}\hspace{2.5cm}\scalebox{0.15}{\includegraphics{second.eps}}
\sidebyside
{\caption{blurb about first}\label{fig1}}
{\caption{blurb about second}\label{fig2}}
\end{figure}

In the above snippet make sure that the two scaleboxes are on a single line. Bold and Italic

\textbf{\textit{This text will be printed in bold and italic}}

Table of contents To include the references/works cited/bibliography in your Table of Contents, right before the bibliography command, use the command: \addcontentsline{toc}{section}{References}

Make eps background transparent.

FreeBSD NIS/NFS setup

Use vipw instead of using a regulat text editor to edit the password file. Just say "vipw" and then add "+:::::::::" to the end of that file. Check the password format in /etc/login.conf, it should be "des" instead of "md5". Edit /etc/groups /etc/hosts etc. as per regular instructions. Start up configuration is in /etc/rc.conf. Edit this file for nis and nfs startup.

Emacs

Version Control

While creating a webpage/document that is version controlled using CVS and edited using Emacs, you can insert the CVS version information directly in the document. Just put "$Id: index.html,v 1.1 2008/02/21 00:33:20 jmulik Exp jmulik $" into the document and check in the document using C-x v-v. Just before the document is checked in Emacs will replace $Id: index.html,v 1.1 2008/02/21 00:33:20 jmulik Exp jmulik $ with a string containing the filename, version, timestamp and author. Cool. SUN Sparc Classic (running NetBSD/sparc)

To get the the OpenBoot BIOS prompt, hit "Stop-A" during startup, before the OS starts booting. (I think you can also hit Stop-A during regular operation but it abort whatever is running and is considered unsafe.) To configure interface use "ifconfig le0 192.168.1.2/24 media UTP" this assumes that le0 is your interface, 192.168.1.2 is the IP address, netmask is 255.255.255.0 and that you have attached a 10BaseT (UTP/twisted pair) cable and not a 10Base5 (AUI Dense26 pin) connector. The "media UTP" part is important.

If the interface does not seem to work try testing the interfaces by first getting to the OpenBoot prompt using the above instructions and the use "test net" command at the "ok" prompt to test all interfaces. In my case it first showed "External-interface: failed" with a warning about the cable. Changing the cable [6~fixed the problem. OpenBoot is a complete(?) Forth Interpreter and has a whole bunch a tools. Sure beats the pants off PC BIOSs.

CVS

When using update use, "cvs update -d" the "-d" option creates in the working directory any directories that might have been added to the repository.

GPG

My gpg public key To extract a public key from your ring: gpg -a --export <id> Cannot encrypt with someones keys (also in Evolution): That can happen even if you have signed the key in your ring. Usually the case is that the key is signed but for some reason there is not trust level set. So use: gpg --edit-key gr@eclipsed.net showpref <


This might show trust: -/- (No trust assigned) trust <


Now at the prompt sent some trust level. Encryption will now work fine.

vsftpd

Getting vsftpd to work with only one non-anonymous user Ensure that vsftpd is pam linked: "ldd vsftpd" show show pam.o Create a user on the local system 'testuser' (not nis/yp user)

In vsftpd.conf:

anonymous_enable=NO

pam_service_name=vsftpd

In /etc/pam.d/vsftpd:

auth required pam_listfile.so item=user sense=allow file=/etc/vsftpd.ftpusers onerr=succeed In /etc/vsftpd.ftpusers: testuser The trick is that instead of denying everyone from vsftpd.ftpusers, we are allowing just the one user in vsftpd.ftpuser Matlab

To index into an element of a cell array of vectors/matrics, use {}. So res.s{1} gives you actual the vector/matrix values if you use res.s(1) you get something like [1x2 double] etc.

Installing Matlab on solaris The license manager must be running before you can start Matlab. The license manager is FLEXnet and can be started using $MATLAB/etc/lmstart (the deamon is $MATLAB_DIR/etc/sol2/lmgrd). This deamon reads its license file from $LM_LICENSE_FILE, so do an export LM_LICENSE_FILE=/path/to/license.dat before you start this deamon (no command line parameters required). Ensure that the license file has the right SERVER option. The license options are taken from MLM.opt. In this file ensure that each user planning on using matlab is listed such as "INCLUDE Matlab USER username", one line for each user and package. Using Net-SNMP

Python

Python 2.3 on Redhat 9.0: Be careful Do not remove the original 2.2 installation, a lot of redhat functionality depends on it. If you install the rpms from http://www.python.org/ftp/python/2.3.2/rpms/redhat-9/ it will install in /usr/lib/python2.3. Querying the rpm database will return python2.2. That is ok. You just need to use "python2.3" to run python scripts instead of just "python". If you install a package and want it to be used by python2.3 use "python2.3 setup.py install" if the package distribution follows the distutils standards. If you do not get a .tar.gz file, try to get a src.rpm then install this rpm. Typically the src.rpm will leave a tar.gz in /usr/src/redhat/SOURCES ALWAYS USE "python2.3" instead of "python". Do not try to short-cut and make a ln -s from python to python2.3 the original python in Redhat-9 is required by other programs.

Gnuplot

Cool script to create box charts can be found here. Either of gnuplot-boxfill/gnuplot seems to create a ugly legend when the first data point value is zero. So in a 2D plot if the 1st y value is 0, the legend for that data series will show a line, instead of a nice box. To fix this, change the data value to 0.1 (assuming yrange [0:100]), so that the data bar does not show up, but the legend is now proper.

SunFire v880

This machine has two basic network interfaces, a gigabit OPTICAL interface and a regular RJ45 type FAST (i.e 100 Mbps) interface. The RJ45 ethernet interface is next to the USB slots. A vanilla Solaris 10 installation on this machine detected the FAST interface, the one we would use a regular twisted-pair network cable, but did not create the required files. Instead Solaris detected and configured the optical gigabit as the ge0 interface. This is the one that shows up on ifconfig and trying to configure ge0 is useless if you have a twisted pair. The RJ45 Fast ethernet has to be manually enabled,as follows: Create a file /etc/hostname.eri0 with the name of the system in it say "hilbert". eri is the driver for fast pci ethernet. Add " hilbert" line to /etc/hosts Do "ifconfig eri0 plumb up" Do "ifconfig eri0 netmask " Do "route add -net default " Create /etc/resolv.conf with nameserver as "nameserver ". Repeat line for every nameserver. Ensure that in /etc/nsswitch "hosts : files dns" This should work :-) Excellent resource for solaris shell command is http://www.sun.com/bigadmin/shellme/#category_23 . The parent directory is also a resource for all admin.

During booting, the keyboard must be present for the monitor to display anything. If there is no keyboard the server tries to redirect to ttya.

Installing an HP network printer in Solaris

Download the SOLe134.pkg or equivalent HP JetDirect Installer package form the HP support site. Install package using addpkg -d SOLe134.pkg Ensure print scheduler is running (use lpstat -r), if not use 'svcadm enable application/print/server' to start scheduler. Run the HP installer using /opt/hpnpl/hppi Use the gnome add/delete printer utility to make the installer printer your default printer. If unable to login to CDE or Java Desktop (with permission problems) This could be a hostname problem. Ensure that all locations have the same hostname:

/etc/hosts /etc/nodename /etc/hostname.* /etc/net/ticlts/hosts /etc/net/ticots/hosts /etc/net/ticotsord/hosts /etc/inet/ipnodes (above list from here.) Apple XServe (OS X)

If you accidently disconnet an hotplug harddrive that was mirrored, in order to restore the mirroring, do Reboot from disk 1 of orginal Mac OS X installation CD. Use the disk utility (Finder->applications->utility etc.) to erase the disk in question. Within the disk utility RAID menu drag over the problem disk into the RAID that has the other (mirrored, but now degraded hard drive). Hit rebuild and wait and watch the rebuild. Then reboot.

OPNET

INSTALLATION To install the compiler for opnet. Download and install gcc package from a sunfreeware.com mirror. Ensure /usr/local/bin is in path Make the follwing changes (from Opnet FAQ):

If you are using gcc, confirm that the following are set in you env_db: bind_shobj_prog : bind_so_gcc bind_static_flags_devel: -g bind_static_prog : bind_gcc comp_flags_devel : -g comp_prog : comp_gcc comp_prog_cpp : comp_g++ If opnet is already running, restart opnet. USING - HINTS

If "Tda" error with index out-of-bound error, it probably means that you did not set up your custom link correctly with missing or incorrect txdel_model or error model. (The correct value, for a point-to-point duplex link, of txdel_model is dpt_txdel, error model is error_zero_err, ecc model is ecc_zero_err, propdel model is dpt_propdel.) You should also include the recompiled link_delay from File->Declare External Files from the Link editor. To recompile see an item in this list below. You have to very careful when assigning the executive attribute of a transition path (in a process model). Putting "function" instead of "function()" makes all the difference. The function will not execute and there will be no error. It took me a while track down this error. While creating a XML model and such make sure that if you use a 10BaseT link, then your node tx and rx channel-rate is set to 10000000 bps. Also, always verify links for all your models. To begin to use g++ code in your process models, you must follow the instructions outlined in /export/home/opnet/11.0.A/sys/etc/README.C++. In the version 11 there is an error ... replace the library -lopgalaxy with -lopgalaxy_base. The code that used in the process should include "#include<stdio.h>" in the header block. The function included should include FIN(fun()) and FOUT; as shown the tutorial examples. At least one process model should have begsim enables. Emable through Process interface menu in process editor. If relocation error when you add a 10BaseT link or such, you might have to create your own link model. After you do that you need the do the following for the OPNET faq: link_delay is a function used by several link pipeline stages, including dpt_new_propdel and dpt_propdel. It is defined in the external code file link_delay.ex.c. This external code file must be compiled and declared.

To compile the model in the current release of Modeler, open the "link_delay" external file ("External Source (C Code)"), and click on the "compile" button.

To compile the model in 6.0 and earlier use the following command: prompt%> op_mko -type ex -m link_delay

You can declare this external file in the Project Editor for each scenario you have, or alternatively Modeler users can declare this external file in one of their process models or link models.

To declare an external object file in the Project Editor select Declare External Files from the File menu. Scroll down until you see the file in question (in this case link_delay) and then change its status from "not included" to "included".

You can declare this external file in a process model or link model which you know will be included whenever you are using this link model. A good candidate might be a MAC process model. To declare an external object file in the Process Model Editor select Declare External Files from the File menu. Scroll down until you see the file in question (in this case link_delay) and then change its status from "not included" to "included".

You may need to refresh model directories between compiling and declaring the external object file.

THE "begsim intrpt" value for all nodes should be enabled. Without it some processes might not move fast enough past the "init" (forced beginning state) state into a state that can received interrupts and might miss interrupts that sent to it. So if the init state of node1 sends a packet to node2 (identical design), but only the begsim intrp of node1 is enabled, then the packet arrival interrupt for node2 will occur before node2 can finish its init state and get to a state that can receive the interrupt. Enabling all begsims will ensure that all nodes start at the same time and all are awake when the action begins. IMPORTANT: If you declare variables in the header block and expect them to retain value between invocations of the process, you are in for a real surprise. Contrary to what one (at least I) would expect, it seems that variables declated in the header block are treated as "temporary" variables and will not retain value between invocations. If you want the values to be retained (which is usually the case), then declare the variables in the "State Variables" block. So, struct/class/defines definitions in header block whereas actual varaible declarations in "State Variables" block. If you want to include a pointer variable using a file through "Edit Ascii" use 'int* \x;' and not 'int \*x;' SCHEDULING EVENTS (LINK DOWN, CAPACITY CHANGE ETC): The trick is to use op_intrpt_schedule_remote(). So create a "command" node is the same subnet as the network and then have the command not schedule remove interrupts to processors at nodes in the networks. This "command" does not have to be connected the real network. In every processor of each node in the network catch the OPC_INTRPT_REMOTE interrupt. Create a ICI format, using the ICI formated object you can actually pass information along with the scheduled remote interrupt. So the command node creates the ICI object, fills it with command values and installs the ici op_ici_install(), the the command node scheduled a remote interrupt for the remote node op_intrpt_schedule_remote(), then the command node uninstalls the ici object. The remote node when it get the interrupt can then read theici information. The scheduled time for op_intrpt_schedule_remote is in seconds. So a 5 minute simulation (as configured fromt the DES->RUN) can have meaningful interrupts scheduled in the [0,300) interval. Also remember that interrupts can only the sent to objects such as processors and queues, not to nodes. See examples of scheduling below (command node):

To trap the interrupt at the target node (in header): #define REMOTEARRIVAL (op_intrpt_type () == OPC_INTRPT_REMOTE) and then the code /* Function called when this process gets and remove interrupt.

static void remoteArrival(void) {

} Of course remoteArrival() and REMOTEARRIVAL should be set as the executive and condition to a transition on the receiving process model. USING - CONCEPTS

To define a statistic within the process model, declare a STATHANDLE in the process model. Declate a Node Statistic from the Interface menu of the node model. In the process model use op_stat_reg to associate the stathandle with the node statistic (this is best done is the init state). In process model make sure begsim interrupt in enabled. Then whenever you want to write a statistic just use op_stat_write(stat handle, value). Ensure that you save all files (in each editor). Then in the project editor use "Choose individual DES statistics" and check the node statistic under the node statistics tree. Seem convoluted but is very structured and useful. Writing DVD in Linux

For Plextor PX-716UF external DVR writer:

Download dvd+rw tools from http://fy.chalmers.se/~appro/linux/DVD+RW/tools/?M=D To create iso from local files use: mkisofs -r -l -L -allow-multidot -allow-leading-dots -no-bak -o /usr/local/src/jmulik.iso . Compile Burn an image using /usr/local/src/dvd+rw-tools-5.21.4.10.8/growisofs -Z /dev/scd0=FC-5-i386-DVD.iso If external DVD does not show as device, disable automount ("Gnome->Desktop Preferences->Removable Media and Drives"). Also specifically on my Dell 650 Precision, try plugging in the drive into the USB port on the keyboard rather than the ones in the front of the CPU. Try to unload and reload usb-storage.ko. (If rmmod says device busy, make sure that you are not he drive and then "rmmod -l usb-storage.ko"). Try switching drive on/off. Activating Stereo in NVIDIA FX cards

Make sure that the card has a three pin circular connector for the stereo emitter to plug in. This probably means that your cards is stereo capable. Download the latest NVIDIA driver for your card. DO NOT download the 3D stereo driver for that card. The 3D stereo driver seem to provide a "fake" 3D stereo effect to existing non-stereo applications. Stereo is not activated by default. To activate go to screen properties-->advanced-->Performance and Quality the scroll down within the list and select and activate the stereo effect. (This procedure transcribed, possibily incorrectly, by me but figured out by Dr. Steve Senger). Installing OMNETPP on SPARC/Solaris 10

A whole lunch of libraries and packages need to be available including bison, make, libxml2, libconv and zlib. All are available from SunFreeWare.com. Then modify LD_LIBRARY_PATH to $LD_LIBRARY_PATH:/usr/local/lib:/home/jmulik/omnetpp/lib. Also samples/socket/Makefile add -lnsl -lsocket to LIBS.

Cool Commands

To kill process started as INET

Gentoo

For cd buring on my laptop cdrecord dev=/dev/hdc -scanbus gives 1,0,0 as the bus for the cdr cdrecord dev=ATA:1,0,0 image.iso burns the image. When following the installation instructions from the Gentoo handbook take care not to "noauto" the boot partition in /etc/fstab. The handbook recommends not automounting the boot partition for security but the problem is that I keep forgetting to mount it when I do want to install a new Kernel. Copying the new compiled kernel in to an umounted /boot will work without complain and be useless as you will keep booting into the old kernel.

For Gentoo Networking setup look at the manual "Gentoo Networking Configuration" at http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=4

Gentoo sound: To get sound working, make sure all the ALSA modules and your device specific drivers are enabled. IN ADDITION follow the alsa instruction at http://www.gentoo.org/doc/en/alsa-guide.xml (especially the part where you need alsamixer to unmute the speakers and such).

Plone

FIRST MAKE SURE YOU ARE USING A VERSION PLONE THAT IS COMPATIABLE WITH THE ZOPE INSTALL To install Plone: Do not try to install the whole ZEO or unified installed shabang .. it is easy to understand and install zope and plone separately. Basic steps are: (a) Install zope (b) Install Plone.

To install Zope follow the generic instructions here with the following exceptions:

Create a user plone with home directory /home/plone Download zope tarball into /home/plone After you unzip make the install directory something like /home/plone/zope_2.10.5_install After the installation in done do not create an instance in the same directory. Create an instance in /home/plone/zope_2.5.10_instance_home/ You should not have three directories, the initial tarball extraction, the install directory and the instance home. Now download and untar Plone (I used Plone 3.0.6) Now exactly follow the instructions in the Plone/INSTALL.txt file (scroll down in the file for detailed instruction). The basic idea is the install the Plone product in in the zope instance directory (**not** in the zope install directory). The directory structures are similar so confusion is easy. To start zope/plone ... use the bin/zopectl start command in the zope instance directory (not in the zope install folder) Special instructions for Max OS X:

If you can access the zope site from the local machine but not from a remote machine there there is, of course, a firewall issue. The easiest way to open the firewall is to allow the "python" application to accept incoming connections. So add the "python.app" (in Resources) and "python" executable (in bin) the specific services and application that can accept incoming connections. Leopard gui configuration only allow for you to specify application that can accept connections and not ports.

To get Zope to startup on boot (Leopard)

mkdir /Library/StartupItems/Zope cd /Library/StartupItems/Zope vi Zope #!/bin/sh

# Zope Web Application Server

. /etc/rc.common

StartService () {

}

StopService () {

}

RestartService () {

}

ConsoleMessage "In the Zope script in /Library/StartupItems" RunService "$1" vi StartupParameters.plist {

} To change logo Follow instructions fomr Plone's site. If an older image still keeps appearing ... right click on the image on the displayed page to find he name of the image ... them in search for the image in ZMI using the search tab. Replace that image with what you want. Remember to maintain the same name.

C++ Standard Template Library

To initialize a multidimensional vector when you do not know the dimensions: vector<int> inner; vector< vector<int> > outer(5, inner); Subversion

If you have existing directory foo somwhere that you want to add to a svn repository (including all sub directories. $ mkdir tempdir $ cd tempdir $ mv ../foo . $ svn import . https://url.to.server/svn-folder -m "New project for foo" $ cd .. $ svn co https://url.to.server/svn-folder/foo #make sure that all files checked out correctly. Now foo is under svn control. $ cd tempdir $ rm -rf foo $ cd .. $ rmdir tempdir To add new ssl svn user:

sudo htpasswd -c -m /path/to/subversion.auth newuser

vi and Vim

Copy and paste: ma to mark beginning of copy y`a to mark end of copy. p to paste. Cut and paste: ma to mark beginning of cut d`a to mark end of cut. p to paste. This makes sense since y is to yank (copy) and d is to delete. Ghostview/Ghostscript

In ghostview you can define you own page size using State-->Setup Options. ere add a line to the bottom of Media Sizes with you own name (followed by comma) and size in points. Now you should be able this size from the page size drop down box. If you add a really big page size (say 2160x2160, i.e. 30inch by 30inch) then increase the -dMaxBitmap size in State-->Ghostscript Option. In the Antialias Device textbox increase the -dMaxBitmap to 100000000 (10^8) and 2160x2160 should work.

Mathematica

Plotting When using Plot make sure you use the PlotRange->All option. If you do not, Mathematica tries to be clever and may clips some data points. To reduce the spacing between cells: Select the cells, select Format->Option Inspector and change the Cell Margins values. Jaiwant Mulik $Id: index.html,v 1.1 2008/02/21 00:33:20 jmulik Exp jmulik $


CategoryHomepage

JaiwantMulik (last edited 2011-05-17 03:42:41 by JaiwantMulik)