<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-9221273284073253620</id><updated>2012-01-23T11:55:10.571-08:00</updated><category term='Python'/><category term='Tools and Programs'/><category term='ubuntu'/><category term='Programming (AMPL)'/><category term='Linux'/><category term='MultiProcessing'/><title type='text'>Tech Corner</title><subtitle type='html'>IT, Computer Science, Database Management Systems, Storage Systems, Linux, Device Drivers, Postgres, etc.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://oguzhanozmen.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9221273284073253620/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://oguzhanozmen.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Oguzhan Ozmen</name><uri>http://www.blogger.com/profile/10212318186137421583</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp3.blogger.com/_BbzVEUJW3Dw/SI_I7XbBw4I/AAAAAAAAAAU/B4A9zMyfgZs/S220/resmim2.png'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>13</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-9221273284073253620.post-5418298181528410716</id><published>2010-06-04T16:26:00.000-07:00</published><updated>2010-06-04T16:35:45.682-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><title type='text'>Ubuntu 8.10 gdm AutoStart at Boot</title><content type='html'>&lt;span style="font-family:courier new;"&gt;/etc/rcS.d&lt;/span&gt; contains the scripts that are executed at boot time. These are in general symbolic links to the scripts in /etc/init.d&lt;br /&gt;&lt;br /&gt;gdm start/stop script is found in &lt;span style="font-family:courier new;"&gt;/etc/init.d/&lt;/span&gt;. If you're missing the link to this script in /etc/rcS.d then it is a reason why your gdm does not start when your linux box boots.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;ln -s  /etc/init.d/&lt;gdm_conf_file&gt;[conf_file]   /etc/rcS.d/&lt;xxx&gt;[name_it].sh&lt;/xxx&gt;&lt;/gdm_conf_file&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9221273284073253620-5418298181528410716?l=oguzhanozmen.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oguzhanozmen.blogspot.com/feeds/5418298181528410716/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9221273284073253620&amp;postID=5418298181528410716' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9221273284073253620/posts/default/5418298181528410716'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9221273284073253620/posts/default/5418298181528410716'/><link rel='alternate' type='text/html' href='http://oguzhanozmen.blogspot.com/2010/06/ubuntu-810-gdm-autostart-at-boot.html' title='Ubuntu 8.10 gdm AutoStart at Boot'/><author><name>Oguzhan Ozmen</name><uri>http://www.blogger.com/profile/10212318186137421583</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp3.blogger.com/_BbzVEUJW3Dw/SI_I7XbBw4I/AAAAAAAAAAU/B4A9zMyfgZs/S220/resmim2.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9221273284073253620.post-3437882294662338191</id><published>2009-08-17T18:08:00.000-07:00</published><updated>2009-08-29T09:27:13.713-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MultiProcessing'/><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><title type='text'>How to Pass an Opened Socket (or File Descriptor) to a Forked Process in Python/Windows</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Client Side&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;The client side program creates 5 threads, and each thread communicates with the server.&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;blockquote  style="font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;import socket, threading&lt;br /&gt;import ctypes&lt;br /&gt;&lt;br /&gt;NUMBER_OF_CLIENT_THREADS = 5&lt;br /&gt;HOST = 'localhost'&lt;br /&gt;PORT = 7777&lt;br /&gt;BUF_SIZE = 100        &lt;br /&gt;&lt;br /&gt;class Client(threading.Thread):&lt;br /&gt;&lt;br /&gt;  def run(self):&lt;br /&gt;&lt;br /&gt;      buf = ctypes.create_string_buffer(BUF_SIZE)&lt;br /&gt;&lt;br /&gt;      # open a conn. to the server      &lt;br /&gt;      client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)&lt;br /&gt;      client.connect((HOST, PORT))&lt;br /&gt;&lt;br /&gt;      # send your message and recive a response&lt;br /&gt;      client.send('Hello, I am {0}'.format(self.getName()))&lt;br /&gt;      buf.value = '\0' * BUF_SIZE&lt;br /&gt;      data = client.recvfrom_into(buf, BUF_SIZE)&lt;br /&gt;      print '\tServer:', buf.value&lt;br /&gt;&lt;br /&gt;      # say your last words&lt;br /&gt;      client.send('Goodbye Server!')&lt;br /&gt;      buf.value = '\0' * BUF_SIZE&lt;br /&gt;      data = client.recvfrom_into(buf, BUF_SIZE)&lt;br /&gt;      print '\tServer:', buf.value&lt;br /&gt;&lt;br /&gt;      # exit&lt;br /&gt;      client.close()&lt;br /&gt;   &lt;br /&gt;&lt;br /&gt;def main():&lt;br /&gt;&lt;br /&gt;  thread_list = []&lt;br /&gt;&lt;br /&gt;  for i in xrange(NUMBER_OF_CLIENT_THREADS):&lt;br /&gt;      thread_list.append( Client() )&lt;br /&gt;      thread_list[i].setName("thread-"+repr(i))&lt;br /&gt;      thread_list[i].start()&lt;br /&gt;&lt;br /&gt;for thr in thread_list:&lt;br /&gt;thr.join()&lt;br /&gt;   &lt;br /&gt;if __name__ == "__main__":&lt;br /&gt;  main()&lt;/span&gt;&lt;/blockquote&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-size:100%;"&gt;Server Side&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;Server forks a new child process for each connection, and child processes communicate with the client threads.&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;blockquote  style="font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;import socket, signal, os, multiprocessing, time&lt;br /&gt;from ctypes import *&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# Structures needed to duplicate a socket:&lt;br /&gt;#&lt;br /&gt;kernel32 = windll.kernel32&lt;br /&gt;Ws2_32   = windll.Ws2_32&lt;br /&gt;msvc     = cdll.msvcrt&lt;br /&gt;&lt;br /&gt;class GUID(Structure):&lt;br /&gt;  _fields_ = [("Data1", c_ulong),&lt;br /&gt;              ("Data2", c_ushort),&lt;br /&gt;              ("Data3", c_ushort),&lt;br /&gt;              ("Data4", c_char * 8)]&lt;br /&gt;&lt;br /&gt;class WSAPROTOCOLCHAIN(Structure):&lt;br /&gt;  _fields_ = [("ChainLen", c_int),&lt;br /&gt;              ("ChainEntries", c_ulong * 7)]&lt;br /&gt;&lt;br /&gt;class WSAPROTOCOL_INFO(Structure):&lt;br /&gt;  _fields_ = [("dwServiceFlags1",c_ulong),&lt;br /&gt;              ("dwServiceFlags2",c_ulong),&lt;br /&gt;              ("dwServiceFlags3",c_ulong),&lt;br /&gt;              ("dwServiceFlags4",c_ulong),&lt;br /&gt;              ("dwProviderFlags",c_ulong),&lt;br /&gt;              ("ProviderId",GUID),&lt;br /&gt;              ("dwCatalogEntryId",c_ulong),&lt;br /&gt;              ("ProtocolChain", WSAPROTOCOLCHAIN),&lt;br /&gt;              ("iVersion",c_int),&lt;br /&gt;              ("iAddressFamily",c_int),&lt;br /&gt;              ("iMaxSockAddr",c_int),&lt;br /&gt;              ("iMinSockAddr",c_int),&lt;br /&gt;              ("iSocketType",c_int),&lt;br /&gt;              ("iProtocol",c_int),&lt;br /&gt;              ("iProtocolMaxOffset",c_int),&lt;br /&gt;              ("iNetworkByteOrder",c_int),&lt;br /&gt;              ("iSecurityScheme",c_int),&lt;br /&gt;              ("dwMessageSize",c_ulong),&lt;br /&gt;              ("dwProviderReserved",c_ulong),&lt;br /&gt;              ("szProtocol",c_char* 256)]&lt;br /&gt;&lt;br /&gt;BUF_SIZE = 100&lt;br /&gt;&lt;br /&gt;def WorkerProcess(conn_child):&lt;br /&gt;&lt;br /&gt;  buf = create_string_buffer(BUF_SIZE)&lt;br /&gt;&lt;br /&gt;  # communicate with the parent process to duplicate the opened socket with client&lt;br /&gt;  pid = os.getpid()&lt;br /&gt;  conn_child.send(pid)&lt;br /&gt;&lt;br /&gt;  wsock_prot_info = conn_child.recv()&lt;br /&gt;  &lt;/span&gt;&lt;span style="font-size:85%;"&gt;# (AF_INET, SOCK_STREAM, IPPROTO_TCP, x, group, flag)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;    sock_no = Ws2_32.WSASocketA(2, 1, 6, byref(wsock_prot_info), 0, 0)&lt;br /&gt;&lt;br /&gt;  if(sock_no == c_uint(~0)):&lt;br /&gt;      print "Error in duplicating the socket"&lt;br /&gt;      conn_child.send(1)&lt;br /&gt;      exit(1)&lt;br /&gt;&lt;br /&gt;  conn_child.send(0) # everthing has gone OK!&lt;br /&gt;&lt;br /&gt;  # Now we have obtained the socket, go on to communicate with the client&lt;br /&gt;  while 1:&lt;br /&gt;&lt;br /&gt;      buf.value = '\0' * len(buf)&lt;br /&gt;      ret = Ws2_32.recv(sock_no, buf, len(buf), 0)&lt;br /&gt;      if ret == 0 or ret == -1:&lt;br /&gt;          break     &lt;br /&gt;      print 'Client:' + buf.value&lt;br /&gt;   &lt;br /&gt;      buf.value = '\0' * len(buf)&lt;br /&gt;      buf.value = "OK"&lt;br /&gt;      ret = Ws2_32.send(sock_no, buf, len(buf), 0)&lt;br /&gt;      if ret == -1: # SOCKET_ERROR&lt;br /&gt;          print "Error in sending data"&lt;br /&gt;          break&lt;br /&gt;       &lt;br /&gt;  msvc._close(sock_no)&lt;br /&gt;&lt;br /&gt;  print "Worker Process Exiting..."&lt;br /&gt;  exit(1)&lt;br /&gt;&lt;br /&gt;def main():&lt;br /&gt;&lt;br /&gt;  HOST = ''&lt;br /&gt;  PORT = 7777&lt;br /&gt;  wsock_prot_info = WSAPROTOCOL_INFO()&lt;br /&gt;   &lt;br /&gt;  # 1. Initialize ZFS&lt;br /&gt;  print "Server is starting..."&lt;br /&gt;&lt;br /&gt;  # 2. Set up the server:&lt;br /&gt;  server = socket.socket( socket.AF_INET, socket.SOCK_STREAM )&lt;br /&gt;  server.bind ( (HOST, PORT) )&lt;br /&gt;  server.listen ( 5 )&lt;br /&gt;&lt;br /&gt;  # 3. Listen for client connections:&lt;br /&gt;  while 1:&lt;br /&gt;   &lt;br /&gt;      conn, addr =  server.accept()&lt;br /&gt;      print 'New connection with', addr&lt;br /&gt;   &lt;br /&gt;      #&lt;br /&gt;      # WE WANT TO PASS THE OPENED SOCKET TO THE NEWLY FORKED PROCESS:&lt;br /&gt;      #&lt;br /&gt;   &lt;br /&gt;      # 1. open a pipe to realize comm. bw parent and the forked process&lt;br /&gt;      conn_parent, conn_child = multiprocessing.Pipe(True)&lt;br /&gt;   &lt;br /&gt;      # 2. fork a process and hand the one side of the pipe to the child&lt;br /&gt;      new_worker = multiprocessing.Process(target=WorkerProcess, args=(conn_child,))&lt;br /&gt;      new_worker.start()&lt;br /&gt;   &lt;br /&gt;      # 3. Child sends back its process id&lt;br /&gt;      cpid = conn_parent.recv()     &lt;br /&gt;      print "New Child Process with pid {0} to handle the new client".format(cpid)&lt;br /&gt;   &lt;br /&gt;      # 4. duplicate the opened socket and obtain prorocol info structure&lt;br /&gt;      if Ws2_32.WSADuplicateSocketA(conn.fileno(), c_ulong(cpid), byref(wsock_prot_info)) != 0:&lt;br /&gt;          print "Error in duplicating the socket"&lt;br /&gt;   &lt;br /&gt;      # 5. Send this structure to the child, it'll use this info to create its own handle&lt;br /&gt;      conn_parent.send(wsock_prot_info)&lt;br /&gt;   &lt;br /&gt;      # 6. Get the confirmation from the child&lt;br /&gt;      ret = conn_parent.recv()     &lt;br /&gt;      if(ret!=0):&lt;br /&gt;          print "Error in handing in the socket to the child process"&lt;br /&gt;&lt;br /&gt;      # 7. Close connection with the client (child will handle that) and the pipe.&lt;br /&gt;      conn_parent.close()&lt;br /&gt;      conn.close()&lt;br /&gt;   &lt;br /&gt;if __name__ == "__main__":&lt;br /&gt;  main()&lt;/span&gt;&lt;/blockquote&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9221273284073253620-3437882294662338191?l=oguzhanozmen.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oguzhanozmen.blogspot.com/feeds/3437882294662338191/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9221273284073253620&amp;postID=3437882294662338191' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9221273284073253620/posts/default/3437882294662338191'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9221273284073253620/posts/default/3437882294662338191'/><link rel='alternate' type='text/html' href='http://oguzhanozmen.blogspot.com/2009/08/how-to-pass-opened-socket-or-file.html' title='How to Pass an Opened Socket (or File Descriptor) to a Forked Process in Python/Windows'/><author><name>Oguzhan Ozmen</name><uri>http://www.blogger.com/profile/10212318186137421583</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp3.blogger.com/_BbzVEUJW3Dw/SI_I7XbBw4I/AAAAAAAAAAU/B4A9zMyfgZs/S220/resmim2.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9221273284073253620.post-4866579906253461267</id><published>2009-03-26T14:11:00.000-07:00</published><updated>2009-03-26T14:41:08.853-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>How to Compile Your Own Module</title><content type='html'>Below is a sample module to compile (my_module.c):&lt;br /&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;#include linux/init.h&lt;br /&gt;#include linux/module.h&lt;linux h=""&gt;&lt;linux h=""&gt;&lt;linux h=""&gt;&lt;linux h=""&gt;&lt;linux h=""&gt;&lt;br /&gt;&lt;br /&gt;MODULE_LICENSE("GPL");&lt;br /&gt;MODULE_AUTHOR("Oguzhan Ozmen");&lt;br /&gt;MODULE_DESCRIPTION("My simple Hello World module");&lt;br /&gt;&lt;br /&gt;static int module_init(void){&lt;br /&gt;&lt;br /&gt;  printk(KERN_ALERT "Hello World\n");&lt;br /&gt;&lt;br /&gt;  return 0; // success&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;static void __exit module_exit(void){&lt;br /&gt;&lt;br /&gt;printk(KERN_ALERT "Goodbye\n");&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;module_init(module_init);&lt;br /&gt;module_exit(module_exit);&lt;/linux&gt;&lt;/linux&gt;&lt;/linux&gt;&lt;/linux&gt;&lt;/linux&gt;&lt;/span&gt;&lt;/blockquote&gt;Within the directory where my_module.c resides in, create a Makefile whose content is as follows:&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;blockquote&gt;obj-m += monitor_blockio.o&lt;/blockquote&gt;Then, generate the kernel object file (.ko) using the following command:&lt;br /&gt;&lt;blockquote&gt;make -C &lt;span style="font-weight: bold;"&gt;[build_dir] &lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;build_dir&gt;&lt;/build_dir&gt;&lt;/span&gt; M=$PWD modules&lt;/blockquote&gt;Here, &lt;build_dir&gt; &lt;/build_dir&gt;[build_dir] &lt;build_dir&gt;stands for the directory which contains the necessary files to build new kernel modules:&lt;br /&gt;&lt;blockquote&gt;- Makefile&lt;br /&gt;- .config&lt;br /&gt;- module.symVers (module symbol information)&lt;br /&gt;- kernel header files (include/ and include/asm)&lt;/blockquote&gt;In general, &lt;/build_dir&gt;[build_dir] &lt;build_dir&gt;&lt;build_dir&gt; is:&lt;br /&gt;&lt;blockquote&gt;- /lib/modules/$(uname -r)/build   OR&lt;br /&gt;- /usr/src/packages/BUILD/kernel-$(uname -r)&lt;br /&gt;&lt;br /&gt;(assuming that you are using a distro compiled kernel)&lt;/blockquote&gt;&lt;/build_dir&gt;&lt;/build_dir&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9221273284073253620-4866579906253461267?l=oguzhanozmen.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oguzhanozmen.blogspot.com/feeds/4866579906253461267/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9221273284073253620&amp;postID=4866579906253461267' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9221273284073253620/posts/default/4866579906253461267'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9221273284073253620/posts/default/4866579906253461267'/><link rel='alternate' type='text/html' href='http://oguzhanozmen.blogspot.com/2009/03/how-to-compile-your-own-module.html' title='How to Compile Your Own Module'/><author><name>Oguzhan Ozmen</name><uri>http://www.blogger.com/profile/10212318186137421583</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp3.blogger.com/_BbzVEUJW3Dw/SI_I7XbBw4I/AAAAAAAAAAU/B4A9zMyfgZs/S220/resmim2.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9221273284073253620.post-4839425812603715858</id><published>2008-10-22T19:30:00.000-07:00</published><updated>2008-10-22T19:49:23.022-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>How to Generate a Patch File</title><content type='html'>If you need to generate a patch file for a set of file(s) residing in a directory structure or just for one file, then you can use "diff" command. You can find a very nice article in Linux Magazine named "&lt;a href="http://www.linux-mag.com/id/7161"&gt;What's the diff?&lt;/a&gt;".  Basically, this command finds out the difference between two files.&lt;br /&gt;&lt;br /&gt;If you want to generate a patch for a directory structure:&lt;br /&gt;&lt;blockquote&gt;diff -rau "old_dir" "modified_dir" &gt; "patch_file"&lt;br /&gt;&lt;br /&gt;r: recursive&lt;br /&gt;a: treat all files as text.&lt;br /&gt;u: Output NUM (default 3) lines of unified context.&lt;br /&gt;&lt;/blockquote&gt;In case of two file, ignoring -r would be enough.&lt;br /&gt;a&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9221273284073253620-4839425812603715858?l=oguzhanozmen.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oguzhanozmen.blogspot.com/feeds/4839425812603715858/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9221273284073253620&amp;postID=4839425812603715858' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9221273284073253620/posts/default/4839425812603715858'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9221273284073253620/posts/default/4839425812603715858'/><link rel='alternate' type='text/html' href='http://oguzhanozmen.blogspot.com/2008/10/how-to-generate-patch-file.html' title='How to Generate a Patch File'/><author><name>Oguzhan Ozmen</name><uri>http://www.blogger.com/profile/10212318186137421583</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp3.blogger.com/_BbzVEUJW3Dw/SI_I7XbBw4I/AAAAAAAAAAU/B4A9zMyfgZs/S220/resmim2.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9221273284073253620.post-5799285118978280027</id><published>2008-10-22T10:36:00.000-07:00</published><updated>2009-08-29T09:28:48.196-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>How to Prevent "sudo" from Asking a Password</title><content type='html'>Some commands like "echo 3 &gt; /proc/sys/vm/drop_caches"* require superuser priviliges so (if you are just a user and you are a sudoer) you need to sudo.&lt;br /&gt;&lt;br /&gt;"sudo" asks for a password. However, if you're "sudo"ing in a script then it's a problem: you wouldn't want to reveal your password as a text.&lt;br /&gt;&lt;br /&gt;You can work around so that "sudo" doesn't require a password:&lt;br /&gt;&lt;blockquote&gt;Edit "/etc/sudoers": &lt;your_username&gt; ALL=(ALL) NOPASSWD: ALL&lt;br /&gt;&lt;/your_username&gt;&lt;/blockquote&gt;&lt;br /&gt;* NOTE:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;echo 1 &gt; drop_caches : just to free "pagecache" (memory which is used to cache the user data pages)&lt;/li&gt;&lt;li&gt;echo 2 &gt; drop_caches: just to free dcache (which stores recently generated dentries which are created when a pathname is resolved) and inodes (which contain metadata for files).&lt;/li&gt;&lt;li&gt;echo 3 &gt; drop_caches: remove all caches&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9221273284073253620-5799285118978280027?l=oguzhanozmen.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oguzhanozmen.blogspot.com/feeds/5799285118978280027/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9221273284073253620&amp;postID=5799285118978280027' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9221273284073253620/posts/default/5799285118978280027'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9221273284073253620/posts/default/5799285118978280027'/><link rel='alternate' type='text/html' href='http://oguzhanozmen.blogspot.com/2008/10/how-to-prevent-sudo-from-asking.html' title='How to Prevent &quot;sudo&quot; from Asking a Password'/><author><name>Oguzhan Ozmen</name><uri>http://www.blogger.com/profile/10212318186137421583</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp3.blogger.com/_BbzVEUJW3Dw/SI_I7XbBw4I/AAAAAAAAAAU/B4A9zMyfgZs/S220/resmim2.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9221273284073253620.post-8405133233521191515</id><published>2008-10-05T22:20:00.000-07:00</published><updated>2008-10-22T09:19:49.164-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming (AMPL)'/><title type='text'>AMPL/BONMIN (Linux/Ubuntu)</title><content type='html'>&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;IMPORTANT LINKS FOR BONMIN&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Below are the websites which are helpful in explaining how to download/install BONMIN in a linux box:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;(getting started) https://projects.coin-or.org/Bonmin/wiki/GettingStarted&lt;/li&gt;&lt;li&gt;https://projects.coin-or.org/BuildTools/wiki/downloadUnix&lt;/li&gt;&lt;/ul&gt;The latest version of BONMIN can be downloaded from&lt;br /&gt;&lt;ul&gt;&lt;li&gt;http://www.coin-or.org/download/source/Bonmin/&lt;/li&gt;&lt;/ul&gt;&lt;span style=";font-family:courier new;font-size:130%;"  &gt;&lt;span style="font-weight: bold;"&gt;CAUTION&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Although, it's claimed that BONMIN is tested with "gcc version 3.* and 4.* up &lt;span class="searchword1"&gt;to&lt;/span&gt; 4.3", I encountered a compiler/linker error:&lt;br /&gt;&lt;blockquote&gt;ERROR: ....rodata' defined in discarded section `.gnu.linkonce...&lt;/blockquote&gt;I've been using gcc-3.4.6. After googling, I found that it's because of a bug which is fixed in gcc-4.*. After switching to gcc-4.0, the error is gone.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;SUMMARY&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;After downloading and untarring the BONMIN file, the main directory contains all the necessary tools (e.g., Bonmin, IpOpt, Cbc, CoinUtils, etc.). However, some 3rd party programs which are required for installation and run are not included (because of licencing issues).&lt;br /&gt;&lt;br /&gt;The directories, however, for these 3rd party programs are already available:&lt;br /&gt;&lt;blockquote&gt;.../Bonmin-0.100.2/ThirdParty&lt;br /&gt;&lt;ul&gt;&lt;li&gt;HSL&lt;/li&gt;&lt;li&gt;Blas&lt;/li&gt;&lt;li&gt;Lapack&lt;/li&gt;&lt;li&gt;ASL&lt;/li&gt;&lt;/ul&gt;&lt;/blockquote&gt;You only need to download the source codes into the corresponding directories:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;.../Bonmin-0.100.2/ThirdParty/Blas$ ./get.Blas&lt;/li&gt;&lt;li&gt;.../Bonmin-0.100.2/ThirdParty/Lapack$ ./get.Lapack&lt;/li&gt;&lt;li&gt;.../Bonmin-0.100.2/ThirdParty/ASL$ ./get.ASL&lt;/li&gt;&lt;li&gt;For HSL: goto &lt;a href="http://hsl.rl.ac.uk/archive/hslarchive.html"&gt;http://hsl.rl.ac.uk/archive/hslarchive.html&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;blockquote&gt;   - Fill in "Registration Form". You don't need to activate your membership! After acquiring the username/passwd just go ahead!&lt;br /&gt; - In  the "Package(s) Required'' part, enter 'MA27'.&lt;br /&gt; - Login the "HSL Archieve" with the acquired username and password.&lt;br /&gt; - You will need the double precision versions of the MA27 (you don't need to download the dependencies such as ID05 and ZA02), MC19. In the HSL directory, you should save to files named ma27ad.f and mc19ad.f respectively.&lt;/blockquote&gt;Finally, create a new director called "build" under the main directory:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;mkdir .../Bonmin-0.100.2/build&lt;/li&gt;&lt;/ul&gt;And, within the "build", execute the following commands&lt;br /&gt;&lt;ol&gt;&lt;li&gt;../configure -C &lt;/li&gt;&lt;li&gt;make &lt;/li&gt;&lt;li&gt;make test &lt;/li&gt;&lt;li&gt;make &lt;span class="searchword2"&gt;install&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;"make install" will create the below directories under "build":&lt;br /&gt;&lt;ul&gt;&lt;li&gt;bin&lt;/li&gt;&lt;li&gt;lib&lt;/li&gt;&lt;li&gt;share&lt;/li&gt;&lt;li&gt;include&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;"bin" contains the executable "bonmin" and the solvers it uses: Cbc, Clp, and Ipopt. "lib" contains the neccesary libarary files for "bonmin" to run.&lt;br /&gt;&lt;br /&gt;Create a symbolic link named "bonmin" (which points at .../Bonmin-0.100.2/build/bin/bonmin) under the directory where "ampl" executable resides so that ampl can use BONMIN as a solver.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9221273284073253620-8405133233521191515?l=oguzhanozmen.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oguzhanozmen.blogspot.com/feeds/8405133233521191515/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9221273284073253620&amp;postID=8405133233521191515' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9221273284073253620/posts/default/8405133233521191515'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9221273284073253620/posts/default/8405133233521191515'/><link rel='alternate' type='text/html' href='http://oguzhanozmen.blogspot.com/2008/10/amplbonmin-linuxubuntu.html' title='AMPL/BONMIN (Linux/Ubuntu)'/><author><name>Oguzhan Ozmen</name><uri>http://www.blogger.com/profile/10212318186137421583</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp3.blogger.com/_BbzVEUJW3Dw/SI_I7XbBw4I/AAAAAAAAAAU/B4A9zMyfgZs/S220/resmim2.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9221273284073253620.post-5324365789325154557</id><published>2008-10-05T22:11:00.000-07:00</published><updated>2008-10-22T09:22:08.201-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming (AMPL)'/><title type='text'>AMPL/Linux - Setting Environment Variables</title><content type='html'>If your PATH environment variable doesn't contain the path to the solvers, AMPL complains that it couldn't find the solver:&lt;br /&gt;&lt;blockquote&gt;ampl: option solver minos;&lt;br /&gt;ampl: solve;&lt;br /&gt;Cannot invoke minos: No such file or directory&lt;br /&gt;exit code 4&lt;br /&gt;&lt;break&gt;&lt;/break&gt;&lt;/blockquote&gt;You need to add the path to the solver executables in the PATH:&lt;br /&gt;&lt;blockquote&gt;export PATH="$PATH":/home/user/.../Solvers&lt;/blockquote&gt;Similarly, if your model contains an external function you need to set the environment variable AMPLFUNC. It should be pointing at the shared object file (i.e., amplfunc.so), or the directory which contains this file.&lt;br /&gt;&lt;blockquote&gt;export AMPLFUNC=/home/user/.../AMPL/amplfunc.so&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9221273284073253620-5324365789325154557?l=oguzhanozmen.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oguzhanozmen.blogspot.com/feeds/5324365789325154557/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9221273284073253620&amp;postID=5324365789325154557' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9221273284073253620/posts/default/5324365789325154557'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9221273284073253620/posts/default/5324365789325154557'/><link rel='alternate' type='text/html' href='http://oguzhanozmen.blogspot.com/2008/10/ampllinux-setting-environment-variables.html' title='AMPL/Linux - Setting Environment Variables'/><author><name>Oguzhan Ozmen</name><uri>http://www.blogger.com/profile/10212318186137421583</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp3.blogger.com/_BbzVEUJW3Dw/SI_I7XbBw4I/AAAAAAAAAAU/B4A9zMyfgZs/S220/resmim2.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9221273284073253620.post-1034515539979447243</id><published>2008-09-16T09:24:00.000-07:00</published><updated>2008-10-22T20:02:09.483-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>Kernel Logging, Log Ring Buffer, printk(), syslog-ng</title><content type='html'>&lt;span style="font-weight: bold;"&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;Kernel Log (Ring) Buffer&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;Linux kernel generates log messages using printk(). These messages are stored in a "ring buffer". The size of this buffer is controlled by a kernel configuration parameter:&lt;br /&gt;&lt;blockquote&gt;CONFIG_LOG_BUF_SHIFT&lt;/blockquote&gt;The default value of this parameter is 14, which means 2^14 bytes, thus 16KB. The size of the buffer can not be changed online so it should be modified (if you'd like to have a larger or smaller buffer) before compiling the kernel (&lt;a href="http://www.blogger.com/post-edit.g?blogID=9221273284073253620&amp;amp;postID=7430538840468663616"&gt;more information on kernel compilation&lt;/a&gt;). &lt;span style="font-size:78%;"&gt;(1)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-size:130%;"&gt;printk() - print() function at the Kernel level&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;printk() is used to print messages at the kernel level. The size of the message can not be larger than 1KB. Below is a sample printk() statement:&lt;br /&gt;&lt;blockquote&gt;printk( KERN_INFO "message\n");&lt;/blockquote&gt;One can classify kernel messages according to their importance/priorities. Priority of a print statement is given by a log level macro. There are 8 priority levels defined in the kernel:&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;KERN_EMERG - emergency the highest level&lt;/li&gt;&lt;li&gt;KERN_ALERT, KERN_CRIT, KERN_ERR, KERN_WARNING, KERN_NOTICE, KERN_INFO, and&lt;/li&gt;&lt;li&gt;KERN_DEBUG - debugging messages with the lowest priority&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;For more information on printk(): &lt;a href="http://lwn.net/images/pdf/LDD3/ch04.pdf"&gt;Linux Device Drivers, 3rd Edition&lt;/a&gt;.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-size:130%;"&gt;How are Kernel Log Messages Exposed to User Space?&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;The log buffer is exposed to user through /proc/kmsg file. If the file is read one can catch the kernel log messages. In fact, there are available programs to display the ingredients of the file /proc/kmsg, and log the content of this file in a static file (e.g., klogd and syslogd deamons, and syslog-ng logging facility). /proc is a memory filesystem (&lt;/span&gt;it contains virtual files which reveals the current state of the running Linux kernel&lt;span style="font-size:100%;"&gt;), and the content of /proc/kmsg are being overwritten. In addition, reading from /proc/kmsg is destructive; that's, once you read a line/message it's removed from the file.&lt;span style="font-size:78%;"&gt;(2)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;"&lt;a href="http://www.balabit.com/network-security/syslog-ng/"&gt;syslog-ng&lt;/a&gt;" (system log new generation) is a widely used logging application in Linux systems. It can directly read from /proc/kmsg and log the messages into static file(s). "syslog-ng" can be regarded as the upgraded version of the old kernel deamon "syslogd".&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-size:130%;"&gt;syslog-ng&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;syslog-ng can be configured so that messages can be directed based on their priorities.  That means you direct different level of messages to different files.&lt;br /&gt;&lt;br /&gt;syslog-ng can be configured using the configuration file:&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;/etc/syslog-ng/syslog-ng.conf (in SuSE Linux, you need to change syslog-ng.conf.in file which is used to generate syslog-ng.conf automatically by SuSE config).&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;In this configuration file, you define:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;the &lt;span style="font-weight: bold;"&gt;sources&lt;/span&gt; syslog-ng is using: for example, /proc/kmsg, /dev/log, etc.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;filters&lt;/span&gt; to identify the priority of a message or the facility from which a message is originated (news, mail, etc.)&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;destination files&lt;/span&gt; to direct the messages belonging to certain group (based on filters)&lt;/li&gt;&lt;li&gt;Finally, with &lt;span style="font-weight: bold;"&gt;"log" statements&lt;/span&gt;, you combine {source, filter, destination} to specify where to log which messages.&lt;/li&gt;&lt;/ul&gt;You can find some sample configuration files &lt;a href="http://www.softpanorama.org/Logs/Syslog_ng/configuration_examples.shtml"&gt;here&lt;/a&gt;, and some more information on logging with syslog-ng &lt;a href="http://sial.org/howto/logging/syslog-ng/"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-size:130%;"&gt;Tuning syslog-ng for Performance&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;In "&lt;a href="http://www.blogger.com/post-edit.g?blogID=9221273284073253620&amp;amp;postID=4530282308955921416"&gt;Monitoring Block I/O at Linux FileSystem Level&lt;/a&gt;" project, I am logging information on each block I/O using printk() function and syslog-ng logging facility. In our experiments, we can produce a trace file (i.e., a log file) of size 1 GB within couple of hours. As a result, to be able to configure HOW we log kernel messages into a static trace file is critical, we don't want to hurt the performance by producing too many I/O operations at a high rate.&lt;br /&gt;&lt;br /&gt;However, using syslog-ng, you can control how you log the messages into a file. While defining a destionation file, you can set&lt;br /&gt;&lt;ul&gt;&lt;li&gt;log_fifo_size: log buffer size (in terms of number of messages)&lt;/li&gt;&lt;li&gt;fsynch(no): by saying "no", syslog-ng will not issue fflush() for each of the message received from the source; otherwise, it'd be catastrophic for the performance.&lt;/li&gt;&lt;li&gt;flush_lines &amp;amp; flush_timeout: syslog-ng will flush either flush_lines many message are collected in the log buffer of the destination or flush_timeout is passed since the last flushing.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;As a result, you can control the rate at which you write the syslog-ng destination files.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-size:130%;"&gt;Example&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;Below is a simple example for a syslog-ng configuration file:&lt;br /&gt;&lt;br /&gt;# defining a source: /proc/kmsg -&gt; kernel messages&lt;br /&gt;source my_source { file("/proc/kmsg" log_msg_size(1024)); };&lt;br /&gt;&lt;br /&gt;# defining a filter: kernel messages with the level of KERN_DEBUG&lt;br /&gt;filter f_myfilter { facility(kern) and priority(debug); };&lt;br /&gt;&lt;br /&gt;# defining a destination file: it defines a log file (i.e., a.txt) which will have its&lt;br /&gt;# own buffer with a size of 10000 messages. Messages are flushed from buffer&lt;br /&gt;# to the log file if 8000 messages are collected in the buffer of 5 second is past&lt;br /&gt;# since the last flushing.&lt;br /&gt;destination my_destination { file("/home/user/a.txt"  log_fifo_size(10000) fsync(no) flush_lines(8000) flush_timeout(5000) );};&lt;br /&gt;&lt;br /&gt;# Finally, a logging point is defined using above source, filter, and destination:&lt;br /&gt;log { source(my_source); filter(f_myfilter); destination(my_destination); };&lt;br /&gt;&lt;br /&gt;&lt;span&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span&gt;Foot Notes:&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;blockquote&gt;(1) Some information may be kernel version dependant. I've considered Linux kernel 2.6.21 in this document.&lt;br /&gt;(2) dmesg which also examines the kernel ring buffer is on the other hand non-destructive.&lt;br /&gt;&lt;/blockquote&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9221273284073253620-1034515539979447243?l=oguzhanozmen.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oguzhanozmen.blogspot.com/feeds/1034515539979447243/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9221273284073253620&amp;postID=1034515539979447243' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9221273284073253620/posts/default/1034515539979447243'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9221273284073253620/posts/default/1034515539979447243'/><link rel='alternate' type='text/html' href='http://oguzhanozmen.blogspot.com/2008/09/kernel-log-buffering-printk-syslog-ng.html' title='Kernel Logging, Log Ring Buffer, printk(), syslog-ng'/><author><name>Oguzhan Ozmen</name><uri>http://www.blogger.com/profile/10212318186137421583</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp3.blogger.com/_BbzVEUJW3Dw/SI_I7XbBw4I/AAAAAAAAAAU/B4A9zMyfgZs/S220/resmim2.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9221273284073253620.post-6259846696625028066</id><published>2008-09-06T05:58:00.001-07:00</published><updated>2008-10-22T18:44:04.094-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>How to Assign PassWd to root</title><content type='html'>If you haven't assigned a password to the superuser "root", you can do so by using the command:&lt;br /&gt;&lt;blockquote&gt;sudo passwd &lt;passwd&gt; root&lt;br /&gt;&lt;/passwd&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;passwd&gt;&lt;/passwd&gt;It asks for a password, what you entered will be the initial password for the superuser root.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9221273284073253620-6259846696625028066?l=oguzhanozmen.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oguzhanozmen.blogspot.com/feeds/6259846696625028066/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9221273284073253620&amp;postID=6259846696625028066' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9221273284073253620/posts/default/6259846696625028066'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9221273284073253620/posts/default/6259846696625028066'/><link rel='alternate' type='text/html' href='http://oguzhanozmen.blogspot.com/2008/09/how-to-assign-passwd-to-root.html' title='How to Assign PassWd to root'/><author><name>Oguzhan Ozmen</name><uri>http://www.blogger.com/profile/10212318186137421583</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp3.blogger.com/_BbzVEUJW3Dw/SI_I7XbBw4I/AAAAAAAAAAU/B4A9zMyfgZs/S220/resmim2.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9221273284073253620.post-7430538840468663616</id><published>2008-09-05T12:13:00.000-07:00</published><updated>2008-10-22T19:11:03.284-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>Compiling a Linux (Vanilla) Kernel</title><content type='html'>Here's how I've compiled vanilla kernel for my SuSE 10.0 &lt;span style="font-size:78%;"&gt;(1)&lt;/span&gt;.  A vanilla kernel is the one you can download from &lt;a href="http://www.kernel.org/"&gt;www.kernel.org&lt;/a&gt;,which does not include any modification by any distribution (e.g., Suse, Debian, etc.). Normally, a distribution adds its own patches, facilities to this core kernel.&lt;br /&gt;&lt;br /&gt;Likewise, you can also add any patchset supported by the linux version you are about to compile. For example, &lt;a href="http://kerneltrap.org/node/6642"&gt;ARA&lt;/a&gt; (adaptive readahead) is not a stock option as of version 2.6.21 but there is a patchset if you'd like to have ARA feature on your Linux box. Or else, you'd like to upgrade to an upper version you may apply the new version's patch, which are called &lt;a href="http://kernel.org/patchtypes/pre.html"&gt;prepatches&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Basically below are the steps you would normally go through when compiling a linux kernel source:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Get the kernel source from &lt;a href="http://www.kernel.org/pub/linux/kernel/v2.6/"&gt;kernel.org&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Untar the download file in /usr/src directory. This will create a new directory under /usr/src, which would be like linux-2.6.21.x&lt;/li&gt;&lt;li&gt;Create a symbolic link named "linux" to this new directory again under /usr/src:&lt;/li&gt;&lt;ul&gt;&lt;li&gt;/usr/src/linux -&gt; /usr/src/linux-2.6.21.x&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;Apply the patches if you have any supported by the version you are about to compile&lt;/li&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;Untar&lt;/span&gt; the patch file under /&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;usr&lt;/span&gt;/&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;src&lt;/span&gt;/&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;linux&lt;/span&gt;&lt;/li&gt;&lt;li&gt;I'd definitely recommend you first do a dry-run. A dry-run will not actually add the patch but kind of simulate it. You'd have a chance to see whether any failure occurred. You can find more information on how to apply patches to a kernel source tree &lt;a href="http://www.mjmwired.net/kernel/Documentation/applying-patches.txt"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;/li&gt;&lt;ul&gt;&lt;li&gt;patch --dry-run -p1 &lt; "patch_name" &lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;li&gt;Now, it's &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;cofiguration&lt;/span&gt; time. Before compiling the kernel you need to configure it. Basically, you select which drivers to include, change any default parameter, etc.&lt;br /&gt;&lt;br /&gt;It's a very common practice to use the already running kernel's configuration file because it is probably configured to include all the necessary drivers, etc. The running kernel's configuration file is found under the /boot directory. Hence, copy the existing &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;config&lt;/span&gt; file (probably named as /boot/config-2.6.x.y) under /&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;usr&lt;/span&gt;/&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;src&lt;/span&gt;/&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;linux&lt;/span&gt;:&lt;br /&gt;&lt;blockquote&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;cp&lt;/span&gt; /boot/&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_10"&gt;config&lt;/span&gt;-`&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_11"&gt;uname&lt;/span&gt; -r` /&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_12"&gt;usr&lt;/span&gt;/&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_13"&gt;src&lt;/span&gt;/&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_14"&gt;linux&lt;/span&gt;/&lt;span style="font-weight: bold;"&gt;.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_15"&gt;config&lt;/span&gt;&lt;/span&gt; &lt;span style="font-size:78%;"&gt;(2)&lt;/span&gt;&lt;/blockquote&gt;&lt;span style="font-size:78%;"&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;Use "make &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_16"&gt;menuconfig&lt;/span&gt;" to start configuring your new kernel. This command brings up a menu. You need to first "load" the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_17"&gt;config&lt;/span&gt; file using the "Load an Alternate Configuration Final" menu item. This will load the old &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_18"&gt;config&lt;/span&gt; file.&lt;br /&gt;Afterwards, you can go through the menu tree and configure your kernel. For example, as mentioned in &lt;a href="http://oguzhanozmen.blogspot.com/2008/09/kernel-log-buffering-printk-syslog-ng.html"&gt;kernel log buffer&lt;/a&gt; subject, you may want to change the size of the kernel log ring buffer, which can only be modified at kernel compilation time. You can do it by Choosing "Kernel Hacking" menu item and then change the "Kernel Log Buffer Size" menu item in the new menu.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;We have the source tree, we have configured the kernel parameters /drivers/etc; &lt;/span&gt;&lt;span style="font-size:100%;"&gt;finally, it's time to build/compile the kernel. At this point, there is separate paths to follow depending on your Linux distribution. In &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_19"&gt;Suse&lt;/span&gt;, you create an rpm file. In &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_20"&gt;Ubuntu&lt;/span&gt; and Debian, you need to compile the kernel source into a deb package. "&lt;a href="http://www.howtoforge.com/"&gt;Linux &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_21"&gt;HowTos&lt;/span&gt; and Tutorials&lt;/a&gt;" web site has a very nice set of documents for compiling kernel for each most popular &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_22"&gt;linux&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_23"&gt;distros&lt;/span&gt;.&lt;/span&gt;&lt;/li&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;&lt;a href="http://www.howtoforge.com/kernel_compilation_suse_p2"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_24"&gt;SuSE&lt;/span&gt; way&lt;/a&gt;: make rpm&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;&lt;a href="http://www.howtoforge.com/kernel_compilation_ubuntu"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_25"&gt;Ubuntu&lt;/span&gt; way&lt;/a&gt;: "make-&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_26"&gt;kpkg&lt;/span&gt; clean" and then "make deb-pkg"&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;You can go to &lt;a href="http://www.howtoforge.com/"&gt;http://www.howtoforge.com/&lt;/a&gt;, and search how you can build a kernel for your Linux &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_27"&gt;distro&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;Normally, compilation takes half an hour to one or one and a half hours depending on the speed of your box. After building is done, it's time to install the newly built kernel.&lt;br /&gt;Again in above source, you can find how to carry out installation process for your Linux &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_28"&gt;distro&lt;/span&gt;.&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;Footnotes:&lt;br /&gt;&lt;br /&gt;(1) You can learn the version of your distribution from /etc/issue&lt;br /&gt;(2) &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_29"&gt;uname&lt;/span&gt; command prints the system information. "&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_30"&gt;uname&lt;/span&gt; -r" gives the version of the running kernel.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9221273284073253620-7430538840468663616?l=oguzhanozmen.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oguzhanozmen.blogspot.com/feeds/7430538840468663616/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9221273284073253620&amp;postID=7430538840468663616' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9221273284073253620/posts/default/7430538840468663616'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9221273284073253620/posts/default/7430538840468663616'/><link rel='alternate' type='text/html' href='http://oguzhanozmen.blogspot.com/2008/09/compiling-linux-vanilla-kernel.html' title='Compiling a Linux (Vanilla) Kernel'/><author><name>Oguzhan Ozmen</name><uri>http://www.blogger.com/profile/10212318186137421583</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp3.blogger.com/_BbzVEUJW3Dw/SI_I7XbBw4I/AAAAAAAAAAU/B4A9zMyfgZs/S220/resmim2.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9221273284073253620.post-3909859429374346376</id><published>2008-08-15T11:59:00.000-07:00</published><updated>2008-10-22T14:15:56.593-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>How to reach Windows partition from Linux, and vice-versa</title><content type='html'>&lt;strong&gt;&lt;span&gt;How to Mount a Windows NTFS file system &lt;span name="IL_SPAN"&gt;&lt;input name="IL_MARKER" type="hidden"&gt;partition&lt;/span&gt; in Linux:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;strong&gt;fdisk -l&lt;/strong&gt;&lt;span&gt; to see which partition has the NTFS file system. For example, let's say, it's /dev/hda1&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;mkdir /mnt/windows &lt;/strong&gt;&lt;span&gt;create a directory to mount the NTFS filesystem.&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;mount /dev/hda1 /mnt/windows/ -t ntfs -o nls=utf8,umask=0222&lt;/strong&gt;&lt;/li&gt;&lt;ul&gt;&lt;li&gt;-t option: type of the filesystem to be mounted&lt;/li&gt;&lt;li&gt;with -o option, you can specify several option seperated by commas.&lt;/li&gt;&lt;li&gt;with nls option, you can specify the io character set&lt;/li&gt;&lt;li&gt;using umask, set the file permission on the file system (the value is in octal). By default, only root has the access, above option gives permission to other users.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;You can access your Windows files using the directory /mnt/windows (which may correspond to C:\, D:\, etc.)&lt;/li&gt;&lt;li&gt;To unmount the Windows NTFS partiton: &lt;strong&gt;umount /mnt/windows/&lt;/strong&gt;&lt;/li&gt;&lt;/ol&gt;  &lt;p&gt;&lt;span style="font-weight: bold;"&gt;How to Access Files on your Linux Partition From Windows:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:100%;"&gt;I find "&lt;a href="http://uranus.it.swin.edu.au/%7Ejn/linux/explore2fs-old.htm"&gt;explore2fs&lt;/a&gt;" very effective and simple if you'd like to access ext partitions. No installation needed.&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9221273284073253620-3909859429374346376?l=oguzhanozmen.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oguzhanozmen.blogspot.com/feeds/3909859429374346376/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9221273284073253620&amp;postID=3909859429374346376' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9221273284073253620/posts/default/3909859429374346376'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9221273284073253620/posts/default/3909859429374346376'/><link rel='alternate' type='text/html' href='http://oguzhanozmen.blogspot.com/2008/08/how-to-reach-windows-partition-from.html' title='How to reach Windows partition from Linux, and vice-versa'/><author><name>Oguzhan Ozmen</name><uri>http://www.blogger.com/profile/10212318186137421583</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp3.blogger.com/_BbzVEUJW3Dw/SI_I7XbBw4I/AAAAAAAAAAU/B4A9zMyfgZs/S220/resmim2.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9221273284073253620.post-5748681192352956201</id><published>2008-07-30T18:16:00.000-07:00</published><updated>2008-08-24T01:44:54.648-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming (AMPL)'/><title type='text'>How to Import User-Defined Functions to AMPL?</title><content type='html'>AMPL is a mathematical programming language for describing optimization problems. There are quite a number of solvers that accept AMPL model as input. It's a powerful language but sometimes you may need to have your own function to include in your AMPL model. Just to note, if your model includes a user-defined function, it's not possible to use &lt;a href="http://www-neos.mcs.anl.gov/"&gt;NEOS&lt;/a&gt; solvers.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.netlib.org/ampl/solvers/funclink/README"&gt;NETLIB&lt;/a&gt; provides some explanation on how to import user-defined functions to AMPL but I found the related information rather scattered. Here, I'll try to walk through the process of importing a very simple user-defined function.&lt;br /&gt;&lt;br /&gt;First of all, user-defined functions are imported to AMPL through "amplfunc.dll" shared library. If this file exists then AMPL loads the defined functions. AMPL looks for this dll file in the execution directory and the directory (or file) given as a command-line option using "-i".&lt;br /&gt;&lt;br /&gt;The same shared library makes user defined functions availbale both to AMPL and to solvers. If AMPL finds a shared-library, it sets the $AMPLFUNC environment variable to inform the linked solvers.&lt;br /&gt;&lt;br /&gt;A function can be in one of the 3 categories: deterministic, symbolic (string) and random. Since solvers directly igonore functions returnming strings and non-deterministic functions I'll write a deterministic function.&lt;br /&gt;&lt;br /&gt;Below is a very simple function which sums up the given two arguments and sends back the result:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;You need to download &lt;a href="http://www.netlib.org/ampl/solvers/funcadd.h"&gt;the header file&lt;/a&gt; from Netlib which inlcudes necessary definitions; for example, the defition of the structure "struct arglist" is found in this header file. You'll include it in your c program.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Then, you'll begin to code your function; note that you may have more than 1 function to import. In Visual C/C++, you need to explicilty export the function you want to use in AMPL:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms235636%28VS.80%29.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms235636%28VS.80%29.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;__declspec(dllexport) real foo(arglist *al){&lt;br /&gt;&lt;br /&gt;/* the return type is real, which is nothing but a double: see the definition in header file you downloaded */&lt;br /&gt;&lt;br /&gt;/* Now, you'll get the arguments passed by AMPL */&lt;br /&gt;&lt;br /&gt;real arg1 = al-&gt;ra[0];&lt;br /&gt;real arg2 = al-&gt;ra[1];&lt;br /&gt;&lt;br /&gt;/* return the result */&lt;br /&gt;return (arg1+arg2);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Another function you have to export is "funcadd". It'll be used by AMPL to get the information about the user-defined function(s), in this case it's just foo.&lt;br /&gt;&lt;br /&gt;__declspec(dllexport) void funcadd(AmplExports *ae){&lt;br /&gt;&lt;br /&gt;/* 1st param: name of the function to import to AMPL.&lt;br /&gt;2nd param: pointer to the function "foo"&lt;br /&gt;3rd param: function type...you can get more info from the header file by checking enumarated type FUNCADD_TYPE.&lt;br /&gt;4th param: Number of arguments passed to function "foo".&lt;br /&gt;5th param: funcinfo&lt;br /&gt;*/&lt;br /&gt;addfunc("foo", (rfunc)foo, 0, 2, 0);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Again, NETLIB includes a more complicated sample: &lt;a href="http://www.netlib.org/ampl/solvers/funclink/funcadd.c"&gt;funcadd.c&lt;/a&gt; .&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;After creating dll, you can name it "amplfunc.dll" and copy it under the execution directory of AMPL.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Lastly, you have to declare the function in your model before using it:&lt;br /&gt;&lt;br /&gt;....&lt;br /&gt;function foo;&lt;br /&gt;...&lt;br /&gt;subject to X: ... foo(param1, var1)...;&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9221273284073253620-5748681192352956201?l=oguzhanozmen.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oguzhanozmen.blogspot.com/feeds/5748681192352956201/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9221273284073253620&amp;postID=5748681192352956201' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9221273284073253620/posts/default/5748681192352956201'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9221273284073253620/posts/default/5748681192352956201'/><link rel='alternate' type='text/html' href='http://oguzhanozmen.blogspot.com/2008/07/how-to-import-user-defined-functions-to.html' title='How to Import User-Defined Functions to AMPL?'/><author><name>Oguzhan Ozmen</name><uri>http://www.blogger.com/profile/10212318186137421583</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp3.blogger.com/_BbzVEUJW3Dw/SI_I7XbBw4I/AAAAAAAAAAU/B4A9zMyfgZs/S220/resmim2.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9221273284073253620.post-626691971513049055</id><published>2008-07-30T10:32:00.000-07:00</published><updated>2008-07-30T10:51:38.886-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tools and Programs'/><title type='text'>TortoiseCVS - Does it crash when you try to update or commit?</title><content type='html'>I found TortoiseCVS one of the best CVS clients to be used at a WindowsXP end. However, I had some hard times at the beginning. When I was trying to use CVS update/commit, it was crashing and XP's famous error reporting  message box was poping up afterwards.&lt;br /&gt;&lt;br /&gt;In my case, the cvs client couldn't connect to the server because of authorization issues. The solution was to add an environment variable:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;CVS_RSH which points to the Plink executable (Plink is the one which tries to establish the client/server connection); for example, C:\Program Files\TortoiseCVS\TortoisePlink.exe.&lt;/li&gt;&lt;/ul&gt;Adding an environment variable in XP is an easy task:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Right Click on "My Computer" -&gt; Properties -&gt; Select "Advanced" tab -&gt; Click on "Environment Variables" at the bottom of the window -&gt; Add CVS_RSH as a system variable.&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9221273284073253620-626691971513049055?l=oguzhanozmen.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9221273284073253620/posts/default/626691971513049055'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9221273284073253620/posts/default/626691971513049055'/><link rel='alternate' type='text/html' href='http://oguzhanozmen.blogspot.com/2008/07/tortoisecvs-does-it-crash-when-you-try.html' title='TortoiseCVS - Does it crash when you try to update or commit?'/><author><name>Oguzhan Ozmen</name><uri>http://www.blogger.com/profile/10212318186137421583</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp3.blogger.com/_BbzVEUJW3Dw/SI_I7XbBw4I/AAAAAAAAAAU/B4A9zMyfgZs/S220/resmim2.png'/></author></entry></feed>
