Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Events
Videos
Audiobooks
Packt Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds

How-To Tutorials

7018 Articles
article-image-inkscape-faqs
Packt
31 Jan 2011
4 min read
Save for later

Inkscape FAQs

Packt
31 Jan 2011
4 min read
Have you got questions on Inkscape you want answers for? You've come to the right place. Whether you're new to the web design software or there are a couple of issues puzzling you, we've put together this FAQ to answer some of the most common Inkscape queries. What is Inkscape? Inkscape is an open source, free program that creates vector-based graphics that can be used in web, print, and screen design as well as interface and logo creation, and material cutting. Its capabilities are similar to those of commercial products such as Adobe Illustrator, Macromedia Freehand, and CorelDraw and can be used for any number of practical purposes. It is a software for web designers who want to add attractive visual elements to their website. What License is Inkscape released under? Inkscape is a free, open source program developed by a group of volunteers under the GNU General Public License (GPL). You not only get a free download but can use the program to create items with it and freely distribute them, modify the program itself, and share that modified program with others. What platforms does Inkscape run on? Inkscape is available for download for Windows, Macintosh, Linux, or Solaris operating systems. Where can you download Inkscape from? Go to the official Inkscape websiteand download the appropriate version of the software for your computer. How do you run Inkscape on MAC OS X operating system? To run on the Mac OS X operating system, it typically runs under X11—an implementation of the X Window System software that makes it possible to run X11-based applications in Mac OS X. The X11 application has shipped with the Mac OS X since version 10.5. When you open Inkscape on a Mac, it will first open X11 and run Inkscape within that program. Loss of some shortcut key options will occur but all functionality is present using menus and toolbars. Is the X11 application a part of the MAC OS X operating system? If you have Mac OS X version 10.5 or above. If you have a previous version of the MAC OS X operating system, you can download the X11 application package 2.4.0 or greater from this website: http://xquartz.macosforge.org/trac/wiki/X112.4.0. What is the interface of Inkscape like? The Inkscape interface is based on the GNOME UI standard which uses visual cues and feedback for any icons. For example: Hovering your mouse over any icon displays a pop-up description of the icon. If an icon has a dark gray border, it is active and can be used. If an icon is grayed out, it is not currently available to use with the current selection. All icons that are in execution mode (or busy) are covered by a dark shadow. This signifies that the application is busy and won't respond to any edit request. There is a Notification Display on the main screen that displays dynamic help messages to key shortcuts and basic information on how to use the Inkscape software in its current state or based on what objects and tools are selected. Within the main screen there is the main menu, a command, snap and status bar, tool controls, and a palette bar. What are Paths? Paths have no pre-defined lengths or widths. They are arbitrary in nature and come in three basic types: open paths (have two ends), closed paths (have no ends, like a circle), or compound paths (uses a combination of two open and/or closed paths). In Inkscape there are a few ways we can make paths: the Pencil (Freehand), Bezier (Pen), and Calligraphy tools—all of which are found in the tool box. They can also be created by converting a regular shape or text object into paths. What shapes can be created in Inkscape? Inkscape can also create shapes that are part of the SVG standard. These are: Rectangles and squares 3D boxes Circles, ellipses, and arcs Stars Polygons Spirals To create any of these shapes, see the following screenshot. Select (click) the shape tool icon in the tool box and then draw the shape on the canvas by clicking, holding, and then dragging the shape to the size you want on the canvas. What is slicing? It is a term used to describe breaking of an image created in a graphics program apart so that it can be re-assembled in HTML to create a web page. To do this, we'll use Web Slicer Extension: from the main menu select Extensions | Web | Slicer | Create a slicer rectangle.
Read more
  • 0
  • 0
  • 2154

article-image-microsoft-sharepoint-2010-administration-monitoring-and-reporting
Packt
31 Jan 2011
7 min read
Save for later

Microsoft SharePoint 2010 Administration: Monitoring and Reporting

Packt
31 Jan 2011
7 min read
SharePoint 2010 has been architected to be a proactive system that provides many tools to the administrators. The goal is to catch issues before they occur. If they do occur, the system should give the administrator the capability to debug the issues with the least amount of resistance. One example of this is the new logging database. It collects information from disparate servers and collates this information into the database. For instance, the Unified Logging Service (ULS) logs collect information that is useful in troubleshooting issues. These logs are found on every SharePoint Server. These ULS logs are collected from all servers and the event logs. This makes the logging database a valuable tool. It is must-have knowledge for SharePoint administrators and covered in one of the recipes. Reporting is another area where SharePoint 2010 has been given focus. Reports are more robust and present better information down at the site level. This gives administrators a better idea about how their site is being utilized, what they are searching for, and uncovers where functionality is lacking. When it comes to monitoring and being proactive, SharePoint offers another level of service — self-correcting health monitoring. SharePoint 2010 health monitoring jobs have the ability to uncover issues, report them, and then SharePoint is able to automatically correct the issue (in some cases). Finally, SharePoint 2010 delivers a tool that can give details on the performance of a page. Currently, we have to use a tool such as Microsoft Visual Round Trip Analyzer. This is now an innate built-in capability of the infrastructure. The last recipe in this chapter shows how to use this tool. The monitoring and reporting capabilities combined together empower the administrator to be proactive with regards to the health of the SharePoint farm. These capabilities can be leveraged with other SharePoint functions such as alerts, so that the team managing the SharePoint farm should be well versed in the performance of the installation. Accessing the SharePoint 2010 logging database As mentioned in the introduction, the SharePoint 2010 logging database is a major enhancement to monitoring, debugging, and protecting the health of the farm. By default, the database is called WSS_Logging . This database should be the starting point for administrators to collect and analyze information. In this recipe, we will access the database and run a view (that already is installed) against it. Getting ready You must have farm-level administrative permissions to the Central Administration site. You must have read and execute permissions as well to the WSS_Logging database in order to open and execute views. How to do it... Open up SQL Server Management Studio. When asked for authentication, log in to the correct instance where SharePoint is running using your windows authentication credentials. If SQL authentication is the preferred method of connecting, use the appropriate User ID/Password. Navigate to the WSS_Logging database and click on the plus sign to expand it. Under the toolbar at the top, click on the New Query button. In the new query window, type in the following query: Select * from RequestUsage. Click Execute. Results are populated in the window pane below the query, as seen in the following screenshot: How it works... In the above recipe a view called RequestUsage was executed. This is an out of the box view that provides site usage information. It provides information such as the referring URL, the browser being used, the site ID, the web ID, the server URL, the request type, and when it was done. The logging database contains, but is not limited to, the following information: It is a place where information is aggregated from across the farm. For instance, all ULS logs, from every SharePoint server, are collected within this database. There are 26 views installed by default. However, the purpose of this database is to give administrators and developers a place to log information based on processes. These are typically custom processes. Views can be created to meet an organization's needs. There's more... The location of the logging database is not a setting that can be done through the user interface in Central Administration. Because of all the data that is collected in this database, it can grow quite large. Additionally, as SharePoint-integrated applications are created, developers can utilize this database to communicate issues. Therefore, due to size and usage, it is a wise idea to move the database to another physical location such as a dedicated disk. This can be done only via PowerShell, using the following command: Set-SPUsageApplication -DatabaseServer <DB Server Name> -DatabaseName <DB Name> [-DatabaseUsername <User Name>] [-DatabasePassword <Password>] More info The ULS logs are present on every WFE. It is important for an Administrator to know where to find these logs manually. They are located at the following location: Common FilesMicrosoft SharedWeb Server Extensions14Logs. Configuring what gets logged The SharePoint 2010 logging database covered in the previous recipe captures information that can be modified via the Central Administration interface. The advantage of this being that the collection of information can be voluminous, which can also be the disadvantage. Disk space, I/O, and just the amount of data needed to retain this information can become an issue. Being able to reduce the type of information that gets captured is critical to the wellness of your farm. In this recipe, we will cover how to change what gets captured and put into the logging database. Getting ready You must have farm-level administrative permissions to the Central Administration site. How to do it... Open the SharePoint 2010 Central Administration website. Click Monitoring. Under the Reporting section, click Configure usage and health data collection. The following form appears for configuration: Fill in the following details: Usage Data Collection: This is enabled by default. Event Selection: These are specific events that are being logged. Use the check box to enable or disable them. Usage data collection settings: In this section, the location of the ULS logs are set. Also, there is a setting to limit the size of the log file. Health data collection: This is enabled by default. Log Collection Schedule: Administrator has the ability to change the schedule. Modify the settings in step 4 and click OK. How it works... The options presented in the usage and health data collection are logged to the logging database and to the ULS logs. The health logging schedule can be modified to fit the needs (also known as Service Level Agreements) of your organization. It is important to remember that there is a hidden cost associated with the increased logging. The hidden cost is mainly in the form of storage and possibly performance. The ULS logs have the potential to grow large. The logs can be moved to a new physical location (physical spindle), which does not contain the operating system or WFE/Application server software. The physical location reference must exist on all servers in the farm. The location of the logs is set within Central Administration. To access the setting, go to Central Administration, click Monitoring, and then select Configure diagnostic logging. Under the Trace Log section is the Path. This contains the location of the ULS logs. There's more... The logging information is retained for a period of 14 days by default. Using PowerShell you can change this parameter, using the following command: Set-SPUsageDefinition -Identity <GUID> [-Enable] -DaysRetained 14
Read more
  • 0
  • 0
  • 6525

article-image-creating-man-made-materials-blender-25
Packt
28 Jan 2011
10 min read
Save for later

Creating Man-made Materials in Blender 2.5

Packt
28 Jan 2011
10 min read
  Blender 2.5 Materials and Textures Cookbook Over 80 great recipes to create life-like Blender objects Master techniques to create believable natural surface materials Take your models to the next level of realism or artistic development by using the material and texture settings within Blender 2.5. Take the hassle out of material simulation by applying faster and more efficient material and texture strategies Part of Packt's Cookbook series: Each recipe is a logically organized according to the surface types with clear instructions and explanations on how these recipes can be applied across a range of materials including complex materials such as oceans, smoke, fire and explosions.        Creating a slate roof node material that repeats but with ultimate variety Man-made materials will often closely resemble their natural surface attributes. Slate is a natural material that is used in many building projects. Its tendency to shear into natural slices makes it an ideal candidate for roofing. However, in its man-made form it is much more regularly shaped and graded to give a nice repeating pattern on a roof surface. That doesn't mean that there is no irregularity in either the edges or surface of manufactured slate tiles. In fact, architects often use this irregularity to add character and drama to a roof. Repeat patterns in a 3D suite like Blender can be extremely difficult to control. If repeats become too obvious, particularly when surface and edges are supposed to be random, it can ruin the illusion. Fortunately, we will be employing Blender controls to add randomness to a repeated image representing the tiled pattern of the roof. Of course, slates like any building material need to be fixed to a roof. This is usually achieved with nails. After time, these metal joiners will age and either rust or channel water to add streaks and rust lines across the slate, often emphasizing the slope of the roof. All these secondary events will add character and dimension to a material simulation. However, such a material need not be complex to achieve a believable and stimulating result. Getting ready The preparation for this recipe could not be simpler. The modeling required to produce the mesh roof is no more than a simple plane created at the origin and rotated in its Y axis to 30°. The plane can be at the default size of one blender unit and should have no more than four vertices. That's just about the simplest model you can have in a 3D graphics program. Position the camera so that you have a reasonably close-up view as shown in the following image: The default lights will be fine for this simulation. But, you are welcome to place lights as you wish. Please bear in mind that a slate roof tends to be quite a dark material. So, if test renders appear too dark, raise the light energy until a reasonable render can be produced. You can also turn off Raytrace render and Ambient Occlusion, if it has been previously set, as they are not required for this material. This will save considerable time in rendering test images. Save your blendfile as slate-roof-01.blend. You will also need to either create or download a small tileable image to represent the pattern of the slate roof. Instructions are given on how to create it within the recipe but a downloadable version is available from the Packtpub website. How to do it... We need to create an image of the smallest repeatable pattern of our slates. This can act both as a bump map and also to mask and apply color variation to the material. The image is very simple and is based on the shape and dimension of a standard rectangular slate. You will see later how the shape can be changed to represent other slate patterns. This was created in GIMP, although any reasonable paint package could be used. Here are the steps to aid you in creating one yourself: Create a new image with size 260 x 420 pixels. I will show later how you can scale an image to give better proportions for more efficient use within Blender. Either place guides or create a grid to sub-divide the rectangle into four sections. In the top half of the rectangle, create a blend fill from black at the top to white at the middle. Do the same for the bottom half of the rectangle. Create a new layer and draw a black line, of three pixels' width, from the middle of the top rectangle section to divide the top rectangle into two. Draw black lines of the same thickness on each side of the whole rectangle. If you used a grid, you should find that one of these verticals is two pixels' width and the other one. Obviously, when this image is tiled, the black lines will all appear as equal in thickness. Finally, create another blend fill from the bottom of each rectangle from black to white upwards about ten pixels. Save your completed image as slate-tile.png to your Blender textures directory. If you want to skip these steps you can download a pre-created one from the Packtpub website. How it works... The image that you want to tile must be carefully designed to hide any seams that might appear when repeated. Most of the major paint packages, such as Photoshop and GIMP, have tools to aid you in that process. However, manual drawing, or editing of an image, will almost always be necessary to create accurate tileable images. Even tiny variations between seams will show up if repeated enough times across a surface. Fortunately, there are techniques available in Blender that will help mask these repeat image shortcomings. Using a tileable texture to add complexity to a surface We will use the tileable texture created in the previous recipe and apply it to a slate roof material in Blender. Reload the slate-roof-01.blend file saved earlier and select the roof mesh object. From the Materials panel, create a new material and name it slate-roof. In the Diffuse tab, set the color selector to R 0.250, G 0.260, and B 0.300. Under Specular tab, change the specular type to Wardiso, with Intensity to 0.400 and Slope to 0.300. The color should stay at the default white. That's set the general color and specularity for the first material that we will use to start a node material solution for our slate roof shader. Ensure you have a Node Editor window displayed. In the Node Editor, select the material node button and check the Use Nodes checkbox. A blank material node should be displayed connected to an output node. From the Browse ID Data button, on the Material node, select the material previously created named slate-roof. To confirm that the material is loaded into the node, re-select that node by left clicking it. Of course, at the moment, the material is no more than a single color with a soft specular shine. To start turning it into a proper representation of a slate roof, we have to add our tileable texture and set up some bump and color settings to make our simple plane look a little more like a slate roof with many tiles. With the Material node still selected, go to the Texture panel and in the first texture slot, create a new texture of type Image or Movie and name it slate-tile. From the Image tab, open the slate-tile.png image you saved earlier. Under Image Mapping/ Extension, select Repeat and set Repeat to X 9 and Y 6. That means the image will be repeated nine times in the X direction and six in the Y of the texture space. In the Influence tab, select Diffuse/Color and set to 0.831. Also, select Geometry/Normal and set to -5.000. Finally, set the Blend type to Darken. Save your work at this point, incrementing your filename number to slate-roof-02.blend. As you can see, a repeated pattern has been stamped on our flat surface with darker colors representing the slate tile separations and a darker top that currently looks like a shadow. This will be corrected in following recipes, along with the obvious clinical precision of each edge. How it works... The surface properties of slate produce a spread of specular highlight when the slate is dry. The best way of simulating that in Blender is to employ a specular shader that can easily generate this type of specular property. The Wardiso specular shader is ideal for this task as it allows a wide range of slope settings from very tight, below 0.100, to very widely spread, 0.400. This is different from the other specular shaders that use a hardness setting to vary the highlight spread. However, you will notice that other specular shader types produce a narrower range than the Wardiso shader. In our slate example, this particular shader provides the ideal solution. Man-made materials are often made from repeated patterns. This is often because it's easier to manufacture objects as components and bring them together when building thus producing patterns. Utilizing simple tileable images to represent those shapes is an extremely efficient way of creating a Blender material simulation. Blender provides some really useful tools to ease the process, using repeats within a material as well as techniques to add variety and drama to a material. Repeat is a really useful way of tiling an image any number of times across the object's texture space. In our example, we were applying the image texture to the object's generated texture space. That's basically the physical dimensions of the object. You can find out what the texture space looks like for any object by selecting the Object panel and choosing the Display tab and checking Texture Space. An orange dotted border, representing the texture space, will surround the object. The plane object used for this material simulation is a square rectangle. If you were to scale the plane disproportionately, the texture would distort accordingly. If we were using this material for a roof simulation, where the scale may not be square, we may need to alter the repeat settings in the texture to match the proportions of the roof rectangle. In our recipe, we started with a one blender unit square mesh then set the repeat pattern to X 9 and Y 6. The repeat settings have to be integer numbers so it may be necessary to calculate the nearest repeat numbers for the image you want to use. In our example, we didn't need to be absolutely accurate. Slates, after all, are often quite variable in size between buildings. If you want to be absolutely accurate, scale your original mesh in Object mode to match to the image proportions. So, in our example, we could have scaled the plane to 2.60 (or 0.26) blender units on its X axis and 4.20 (or 0.42) on its Y axis, and then designed our repeats from that point.
Read more
  • 0
  • 0
  • 3037

article-image-faqs-microsoft-sql-server-2008-high-availability
Packt
28 Jan 2011
6 min read
Save for later

FAQs on Microsoft SQL Server 2008 High Availability

Packt
28 Jan 2011
6 min read
Microsoft SQL Server 2008 High Availability Minimize downtime, speed up recovery, and achieve the highest level of availability and reliability for SQL server applications by mastering the concepts of database mirroring,log shipping,clustering, and replication  Install various SQL Server High Availability options in a step-by-step manner  A guide to SQL Server High Availability for DBA aspirants, proficient developers and system administrators  Learn the pre and post installation concepts and common issues you come across while working on SQL Server High Availability  Tips to enhance performance with SQL Server High Availability  External references for further study Q: What is Clustering? A: Clustering is usually deployed when there is a critical business application running that needs to be available 24 X 7 or in terminology—High Availability. These clusters are known as Failover clusters because the primary goal to set up the cluster is to make services or business processes that are critical for business and should be available 24 X 7 with 99.99% up time. Q: How does MS Windows server Enterprise and Datacenter edition support failover clustering? A: MS Windows server Enterprise and Datacenter edition supports failover clustering. This is achieved by having two or more identical nodes connected to each other by means of private network and commonly used resources. In case of failure of any common resource or services, the first node (Active) passes the ownership to another node (Passive). Q: What is MSDTC? A: Microsoft Distributed Transaction Coordinator (MSDTC) is a service used by the SQL Server when it is required to have distributed transactions between more than one machine. In a clustered environment, SQL Server service can be hosted on any of the available nodes if the active node fails, and in this case MSDTC comes into the picture in case we have distributed queries and for replication, and hence the MSDTC service should be running. Following are a couple of questions with regard to MSDTC. Q: What will happen to the data that is being accessed? A: The data is taken care of, by shared disk arrays as it is shared and every node that is part of the cluster can access it; however, one node at a time can access and own it. Q: What about clients that were connected previously? Does the failover mean that developers will have to modify the connection string? A: Nothing like this happens. SQL Server is installed as a virtual server and it has a virtual IP address and that too is shared by every cluster node. So, the client actually knows only one SQL Server or its IP address. Here are the steps that explain how Failover will work: Node 1 owns the resources as of now, and is active node. The network adapter driver gets corrupted or suffers a physical damage. Heartbeat between Node1 and Node 2 is broken. Node 2 initiates the process to take ownership of the resources owned by the Node 1. It would approximately take two to five minutes to complete the process. Q: What is Hyper-V? What are their uses? A: Let's see what the Hyper-V is: It is a hypervisor-based technology that allows multiple operating systems to run on a host operating system at the same time. It has advantages of using SQL Server 2008 R2 on Windows Server 2008 R2 with Hyper-V. One such example could be the ability to migrate a live server, thereby increasing high availability without incurring downtime, among others. Hyper-V now supports up to 64 logical processors. It can host up to four VMs on a single licensed host server. SQL Server 2008 R2 allows an unrestricted number of virtual servers, thus making consolidation easy. It has the ability to manage multiple SQL Servers centrally using Utility Control Point (UCP). Sysprep utility can be used to create preconfigured VMs so that SQL Server deployment becomes easier. Q: What are the Hardware, Software and Operating system requirements for installing SQL Server 2008 R2? A: The following are the hardware requirements: Processor: Intel Pentium 3 or Higher Processor Speed: 1 GHZ or Higher RAM: 512 MB of RAM but 2 GB is recommended Display : VGA or Higher The following are the software requirements: Operating system: Windows 7 Ultimate, Windows Server 2003 (x86 or x64), Windows Server 2008 (x86 or x64) Disk space: Minimum 1 GB .Net Framework 3.5 Windows Installer 4.5 or later MDAC 2.8 SP1 or later The following are the operating system requirements for clustering: To install SQL Server 2008 clustering, it's essential to have Windows Server 2008 Enterprise or Data Center Edition installed on our host system with Full Installation, so that we don't have to go back and forth and install the required components and restart the system. Q: What is to be done when we see the network binding warning coming up? A: In this scenario, we will have to go to Network and Sharing Center | Change Adapter Settings. Once there, pressing Alt + F, we will select Advanced Settings. Select Public Network and move it up if it is not and repeat this process on the second node. Q: What is the difference between Active/Passive and Active/Active Failover Cluster? A: In reality, there is only one difference between Single-instance (Active/Passive Failover Cluster) and Multi-instance (Active/Active Failover Cluster). As its name suggests, in a Multi-instance cluster, there will be two or more SQL Server active instances running in a cluster, compared to one instance running in Single-instance. Also, to configure a multi-instance Cluster, we may need to procure additional disks, IP addresses, and network names for the SQL Server. Q: What is the benefit of having Multi-instance, that is, Active/Active configuration? A: Depending on the business requirement and the capability of our hardware, we may have one or more instances running in our cluster environment. The main goal is to have a better uptime and better High Availability by having multiple SQL Server instances running in an environment. Should anything go wrong with the one SQL Server instance, another instance can easily take over the control and keep the business-critical application up and running! Q: What will be the difference in the prerequisites for the Multi-instance Failover Cluster as compared to the Single-instance Failover Cluster? A: There will be no difference compared to a Single-instance Failover Cluster, except that we need to procure additional disk(s), network name, and IP addresses. We need to make sure that our hardware is capable of handling requests that come from client machines for both the instances. Installing a Multi-instance cluster is almost similar to adding a Single-instance cluster, except for the need to add a few resources along with a couple of steps here and there.
Read more
  • 0
  • 0
  • 1520

article-image-linux-shell-script-logging-tasks
Packt
28 Jan 2011
7 min read
Save for later

Linux Shell Script: Logging Tasks

Packt
28 Jan 2011
7 min read
Linux Shell Scripting Cookbook Collecting information about the operating environment, logged in users, the time for which the computer has been powered on, and any boot failures are very helpful. This recipe will go through a few commands used to gather information about a live machine. Getting ready This recipe will introduce the commands who, w, users, uptime, last, and lastb. How to do it... To obtain information about users currently logged in to the machine use: $ who slynux   pts/0   2010-09-29 05:24 (slynuxs-macbook-pro.local) slynux   tty7    2010-09-29 07:08 (:0) Or: $ w 07:09:05 up  1:45,  2 users,  load average: 0.12, 0.06, 0.02 USER     TTY     FROM    LOGIN@   IDLE  JCPU PCPU WHAT slynux   pts/0   slynuxs 05:24  0.00s  0.65s 0.11s sshd: slynux slynux   tty7    :0      07:08  1:45m  3.28s 0.26s gnome-session It will provide information about logged in users, the pseudo TTY used by the users, the command that is currently executing from the pseudo terminal, and the IP address from which the users have logged in. If it is localhost, it will show the hostname. who and w format outputs with slight difference. The w command provides more detail than who. TTY is the device file associated with a text terminal. When a terminal is newly spawned by the user, a corresponding device is created in /dev/ (for example, /dev/pts/3). The device path for the current terminal can be found out by typing and executing the command tty. In order to list the users currently logged in to the machine, use: $ users Slynux slynux slynux hacker If a user has opened multiple pseudo terminals, it will show that many entries for the same user. In the above output, the user slynux has opened three pseudo terminals. The easiest way to print unique users is to use sort and uniq to filter as follows: $ users | tr ' ' 'n' | sort | uniq slynux hacker We have used tr to replace ' ' with 'n'. Then combination of sort and uniq will produce unique entries for each user. In order to see how long the system has been powered on, use: $ uptime 21:44:33 up  3:17,  8 users,  load average: 0.09, 0.14, 0.09 The time that follows the word up indicates the time for which the system has been powered on. We can write a simple one-liner to extract the uptime only. Load average in uptime's output is a parameter that indicates system load. In order to get information about previous boot and user logged sessions, use: $ last slynux tty7         :0              Tue Sep 28 18:27   still logged in reboot system boot 2.6.32-21-generi Tue Sep 28 18:10 - 21:46 (03:35) slynux pts/0      :0.0          Tue Sep 28 05:31 - crash (12:39) The last command will provide information about logged in sessions. It is actually a log of system logins that consists of information such as tty from which it has logged in, login time, status, and so on. The last command uses the log file /var/log/wtmp for input log data. It is also possible to explicitly specify the log file for the last command using the –f option. For example: $ last -f /var/log/wtmp In order to obtain info about login sessions for a single user, use: $ last USER Get information about reboot sessions as follows: $ last reboot reboot system boot 2.6.32-21-generi Tue Sep 28 18:10 - 21:48 (03:37) reboot system boot 2.6.32-21-generi Tue Sep 28 05:14 - 21:48 (16:33) In order to get information about failed user login sessions use: # lastb test     tty8    :0          Wed Dec 15 03:56 - 03:56  (00:00) slynux tty8    :0          Wed Dec 15 03:55 - 03:55  (00:00) You should run lastb as the root user. Logging access to files and directories Logging of file and directory access is very helpful to keep track of changes that are happening to files and folders. This recipe will describe how to log user accesses. Getting ready The inotifywait command can be used to gather information about file accesses. It doesn't come by default with every Linux distro. You have to install the inotify-tools package by using a package manager. It also requires the Linux kernel to be compiled with inotify support. Most of the new GNU/Linux distributions come with inotify enabled in the kernel. How to do it... Let's walk through the shell script to monitor the directory access: #/bin/bash #Filename: watchdir.sh #Description: Watch directory access path=$1 #Provide path of directory or file as argument to script inotifywait -m -r -e create,move,delete $path -q A sample output is as follows: $ ./watchdir.sh . ./ CREATE new ./ MOVED_FROM new ./ MOVED_TO news ./ DELETE news How it works... The previous script will log events create, move, and delete files and folders from the given path. The -m option is given for monitoring the changes continuously rather than going to exit after an event happens. -r is given for enabling a recursive watch the directories. -e specifies the list of events to be watched. -q is to reduce the verbose messages and print only required ones. This output can be redirected to a log file. We can add or remove the event list. Important events available are as follows: Logfile management with logrotate Logfiles are essential components of a Linux system's maintenance. Logfiles help to keep track of events happening on different services on the system. This helps the sysadmin to debug issues and also provides statistics on events happening on the live machine. Management of logfiles is required because as time passes the size of a logfile gets bigger and bigger. Therefore, we use a technique called rotation to limit the size of the logfile and if the logfile reaches a size beyond the limit, it will strip the logfile and store the older entries from the logfile in an archive. Hence older logs can be stored and kept for future reference. Let's see how to rotate logs and store them. Getting ready logrotate is a command every Linux system admin should know. It helps to restrict the size of logfile to the given SIZE. In a logfile, the logger appends information to the log file. Hence the recent information appears at the bottom of the log file. logrotate will scan specific logfiles according to the configuration file. It will keep the last 100 kilobytes (for example, specified SIZE = 100k) from the logfile and move rest of the data (older log data) to a new file logfile_name.1 with older entries. When more entries occur in the logfile (logfile_name.1) and it exceeds the SIZE, it updates the logfile with recent entries and creates logfile_name.2 with older logs. This process can easily be configured with logrotate.logrotate can also compress the older logs as logfile_name.1.gz, logfile_name2.gz, and so on. The option for whether older log files are to be compressed or not is available with the logrotate configuration. How to do it... logrotate has the configuration directory at /etc/logrotate.d. If you look at this directory by listing contents, many other logfile configurations can be found. We can write our custom configuration for our logfile (say /var/log/program.log) as follows: $ cat /etc/logrotate.d/program /var/log/program.log { missingok notifempty size 30k compress weekly rotate 5 create 0600 root root } Now the configuration is complete. /var/log/program.log in the configuration specifies the logfile path. It will archive old logs in the same directory path. Let's see what each of these parameters are: The options specified in the table are optional; we can specify the required options only in the logrotate configuration file. There are numerous options available with logrotate. Please refer to the man pages (http://linux.die.net/man/8/logrotate) for more information on logrotate.  
Read more
  • 0
  • 0
  • 6841

article-image-models-and-animations-away3d-36
Packt
28 Jan 2011
7 min read
Save for later

Models and Animations with Away3D 3.6

Packt
28 Jan 2011
7 min read
Away3D 3.6 Essentials Take Flash to the next dimension by creating detailed, animated, and interactive 3D worlds with Away3D Create stunning 3D environments with highly detailed textures Animate and transform all types of 3D objects, including 3D Text Eliminate the need for expensive hardware with proven Away3D optimization techniques, without compromising on visual appeal Written in a practical and illustrative style, which will appeal to Away3D beginners and Flash developers alike Models and Animations It is possible to create a 3D object from the ground up using basic elements like vertices, triangle faces, Sprite3D objects, and segments. However, creating each element manually in code is not practical for more complex models. While the classes from the away3d.primitives package offer a solution by providing a way to quickly create some standard shapes, advanced applications will need to display more complex shapes. For those situations where these standard primitive shapes do not provide enough fexibility, Away3D can load and display 3D models created by external 3D modeling applications. 3D modeling applications are specifcally designed to provide a visual environment in which 3D models can be manipulated. It is certainly much more convenient to create or edit a 3D mesh in one of these applications than it is to build up a mesh in code using ActionScript. Away3D can directly load a wide range of 3D formats. The process of exporting a 3D mesh into a fle that can be used with Away3D will be covered for the following 3D modeling applications: 3ds Max: A popular commercial modeling, animation, and rendering application which runs on Windows. Blender: A free and open source modeling application, which is available on a number of platforms, including Windows, Linux, and MacOS. Milkshape: A commercial low-polygon modeler which runs on Windows that was originally designed for the game Half-Life. Sketch-up: A free 3D modeling application provided by Google. A commercial version is also available that includes a number of additional features. Sketch-up runs on Windows and MacOS. Actually creating a model in these 3D modeling applications is outside the scope of this article. However, 3D models are provided that can be loaded and then exported from these applications, which will allow you run through the procedure without having to know how to make a 3D model from scratch. 3D formats supported by Away3D Away3D includes classes that can load a wide range of 3D model fle formats. All the supported formats can be used to load a static 3D model, while a smaller number can be used to load animated models. The following table lists the 3D model formats supported by Away3D, their common extensions, whether they can load animated 3D models, and the Away3D class that is used to load and parse them. Exporting 3D models The following instructions show you how to export a Collada fle from a number of different 3D modeling applications. Collada is an open, XML-based format that has been designed to provide a way to exchange data between 3D applications. Away3D supports loading both static and animated 3D models from the Collada format. Exporting from 3ds Max 3ds Max is a commercial 3D modeling application. At the time of writing, the latest version of the ColladaMax plugin, which is the plugin that we will use to export the 3D model, was 3.05C. This version supports 3ds Max 2008, 3ds Max 9, 3ds Max 8 SP3, or 3ds Max 7 SP1. Note that this version does not support 3ds Max 2010 or 2011. A trial version of 3ds Max 9 is available, although it can be diffcult to fnd. You should be able to fnd a copy if you search the Internet for Autodesk3dsMax2009_ENU_TrialDownload.exe, which is the name of fle that will install the trial version of 3ds Max 9. Download and install the ColladaMax plugin from http://sourceforge.net/projects/colladamaya/files/. Open 3ds Max. Click File | Open. Select the MAX file you wish to open and click on the Open button. Click File | Export from within 3ds Max. Select COLLADA (*.DAE) from the Save as type drop-down list. Select the same directory where the original MAX fle was located. Type a fle name for the exported fle in the File name textbox, and click on the Save button. In the ColladaMax Export dialog box make sure the following checkboxes are enabled: Relative Paths Normals Triangulate If you want to export animations, enable the Enable export checkbox. If you want to export a specifc range of frames, enable the Sample animation checkbox and enter the required values in the Start and End textboxes. Click on the OK button to export the fle. Exporting from MilkShape The Collada exporter supplied with MilkShape does not export animations. So even if the MilkShape MS3D file we are loading contains an animated model, the exported Collada DAE file will be a static mesh. A trial version of MilkShape can be downloaded and installed from its website at http://chumbalum.swissquake.ch/. Click File | Open. Select the MS3D file you wish to open and click on the Open button. Click File | Export | COLLADA…. Select the same directory where the original MS3D file was located. Type a flename for the exported fle in the File name textbox and click the Save button. Exporting from Sketch-Up Like Milkshape, Sketch-up does not support exporting animated Collada fles. Sketch-Up can be downloaded for free from http://sketchup.google.com/. Click File | Open. Select the SKP file you wish to open and click on the Open button. Click File | Export | 3D Model…. Select Collada File (*.dae) from the Export type combobox. Select an appropriate directory, and type a filename for the exported file in the File name textbox. Click on the Options... button. Make sure the Triangulate All Faces checkbox is enabled. If the Export Texture Maps option is enabled, Sketch-Up will export the textures along with the DAE file. Click on the OK button to save the options. Click on the Export button to export the file. Exporting from Blender The latest version of the Collada exporter for Blender, which is version 0.3.162 at the time of writing, does support exporting animations. However, in most cases Away3D will not load these animations correctly. It is recommended that only static meshes be exported from Blender to a Collada fle. Click File | Open.... Select the BLEND file you wish to open and click on the Open button. Click File | Export | COLLADA1.4 (*.dae) .... Type a flename for the exported fle in the directory where the original BLEND fle was located in the Export File textbox. Make sure the Triangles and Use Relative Paths buttons are pressed. Click on the Export and Close button. A note about the Collada exporters Despite being free and open standard, exporting to a Collada fle that can be correctly parsed by Away3D can be a hit-and-miss affair. The Collada exporters for 3ds Max are a good example. During testing, neither the built-in Collada exporter included with 3ds Max, nor the third-party OpenCollada exporter from http://opencollada.org (version 1.2.5 was the latest version at the time of writing) would export an animated Collada fle that Away3D could read. At best Away3D would display a static mesh, and at worst it would throw an exception when reading the DAE fle. Likewise, neither of the Collada exporters that come with Blender (which was at version 2.49b at the time of writing) would consistently export an animated Collada mesh that was compatible with Away3D. It is important to be aware that just because a 3D modeling application says that it can export to a Collada fle, this is no guarantee that the resulting fle can be read correctly by Away3D.
Read more
  • 0
  • 0
  • 5101
Unlock access to the largest independent learning library in Tech for FREE!
Get unlimited access to 7500+ expert-authored eBooks and video courses covering every tech area you can think of.
Renews at €18.99/month. Cancel anytime
article-image-how-to-install-the-microsoft-dynamics-ax-database
Packt
28 Jan 2011
6 min read
Save for later

How to install the Microsoft Dynamics AX database

Packt
28 Jan 2011
6 min read
Although the installation program provides a lot of self-governance, when it comes to installing each component, it does not do everything. At times, you will have to perform some manual tasks to get the components working the way you intend them to work. Although many components can be installed at the same time, which speeds up the installation process, it is far better to avoid this approach as you have less control over the integrity of the installation. Installing the Dynamics AX database The very first component that must be installed is the Dynamics AX database server component. The database server component is a SQL database that will store all the Dynamics AX data for quick retrieval. To install and set up the database server component, perform the following steps: Run the Microsoft Dynamics AX Setup installation program and select your language: After clicking on the OK button, you will now be in the Dynamics AX installation wizard. With all the defaults set, click on the Next button until you arrive at the Add or modify components screen: You can either create a database automatically using the installation wizard or manually. If creating a database manually, ensure that the appropriate permissions are set, as described in the following steps. To start creating a database using the wizard, check the Database (Microsoft SQL Server) option in the Base section of the wizard and then click on the Next button. The next screen Database: Create new SQL Server database, will enable you to perform the actual creation of the new SQL Server database. Although it's not required to have Dynamics AX working, you should name your database with the same name you intend to use for your AOS instance. In this instance, since we are creating a development environment, the database name will be AX2009_INGNOMICS_DEV01. It is best practice to have the same name for the database, Application Object Server, and Application file directory. It is also best practice to name the database as &ltAXVersion>&ltCompany&gt_&ltInstance> or &gtAXVersion&lt_&ltCompany&gt_&ltInstance&gt. The final screen indicates whether the installation was performed successfully. The color of the box on the right side of the component installed can be green, orange, or red. Green indicates that the installation was successful, orange indicates that there was a warning, yet the component was installed, and red indicates that there was a fatal error and the component did not install at all. If there is either a warning or error, check the Open the log file when Setup closes option and click on the Finish button to view the reasons for the warning and errors: Manually installing and setting up the Dynamics AX database Manually installing and setting up the Dynamics AX database is preferred when there is a desire to understand the permissions and setup involved. For example, in instances where demo data is copied or when you copy an existing Dynamics AX database from one server to another, it is likely that the permissions may be set up differently. In this case, understanding what permissions need to be set on which object will prevent lots of unnecessary issues. From now on, understanding how the Dynamics AX database is set up is not only useful but essential as well. Once understood, you will be able to create the Dynamics AX database more quickly. This procedure covers the process of manually creating and installing the database in Microsoft SQL Server 2008 or 2008 R2. To do this, you will need to perform the following steps: As an administrator, access SQL Server using SQL Server Management Studio and log in to the server that you want the database to reside in. In the database engine, create a new database by right clicking on the Databases folder and then clicking on New Database.... In the New Database window, provide the appropriate Database name and location on the disk to store the database. Once complete, click on the OK button to create the database. Once you have specified the name you want for your database, you can click on the OK button in the New Database wizard to create the database you specified. The database will now appear below the Databases folder, (you may need to refresh). Now that you have created the database manually, you will need to set the permissions manually as well. First, the service account name that will be running the AOS must be added as a valid SQL login. Expand the Dynamics AX database and right-click on the Security folder and click on New | User.... In the Database User – New window, provide the AOS service account name in the User name and Login name fields and assign the login to db_datareader, db_datawriter, and db_ddladmin in the Database role membership section. If the NT AUTHORITYNetworkService or LocalSerivce account are the AOS service accounts, then the account login should follow the format &ltAOSServer>$, where &ltAOSServer> is the server that the AOS is running on. For example, AX2009-AOS$ would be a valid account login to add to the database. Next we need to assign the permissions on two stored procedures. To do this, go to the Securables page. Click on the Search.. button, and the Add Objects window will be displayed. Ensure that the Specific objects... radio button is marked and click on the OK button. The Select Objects window will open, click on the Object Types... button to search for specific object types. The Select Object Types window will open, mark Stored procedures and then click on the OK button. This will filter our search to only include stored procedures in the database. Now that we are back in the Select Objects window, click on the Browse... button to view the list of stored procedures in the database. In the Browse for Objects window that pops up, mark the CREATESERVERSESSIONS and CREATEUSERSESSIONS stored procedures in order to modify permissions. When complete, click on the OK button. Verify that the Select Objects window has the two stored procedures listed, then click on the OK button to add the Securables. The Securables page will now have the two stored procedures listed. Grant Execute permissions to the account on both of the stored procedures. When complete, click on the OK button to finalize the permission settings on the Dynamics AX database for the account.
Read more
  • 0
  • 0
  • 3801

article-image-microsoft-forefront-uag-preparing-creating-and-publishing-https-trunk
Packt
28 Jan 2011
7 min read
Save for later

Microsoft Forefront UAG: Preparing, Creating, and Publishing an HTTPS Trunk

Packt
28 Jan 2011
7 min read
Preparing for an HTTPS trunk We have chosen to talk about HTTPS first, because these trunks are the most used by UAG customers and because, well, HTTP trunks are as easy as pie. Creating an HTTPS trunk is not difficult but, before going there, you need to have a certificate, and this can make your whole day rainy. The HTTPS protocol provides better security as it encrypts the traffic between the user and the server. This is an age old protocol that has stood the test of time well, but it may still be a bit challenging to use, because just like real-life certificates, digital ones can't just be handed out by anyone. Many books have been written about PKI (public key infrastructure), so we won't go into much detail about it, but it's important to understand the basics, so here goes. Encryption is based on a simple concept. You want to send data to someone without anyone else being able to read it. You take the data, and change it in a way that only you and the future recipient know. If that data falls into the wrong hands, it will look like meaningless garbage. The intended recipient, though, knows how to reverse the process and read it. Encryption is done by taking a key, which is a very long and unique number, and using it to perform a mathematical function on the data, resulting in encrypted data that appears to be meaningless. To decrypt the data, you do the opposite, with the same number, and obtain the original data. Let's do a simple example: Suppose you want to encrypt the word RIDDLE: First, you convert each letter to a number. If we start with A=1, B=2, we get 18, 9, 4, 4, 12, and 5. Second, we "encrypt" the data with our key. Let's say our key is "50", so we just add the key to each number, and end up with 68, 59, 54, 54, 62, and 55. Now, when it's time to decrypt this sequence, we just subtract the same number back, and convert font to letters. Naturally, that level of secrecy wouldn't be too hard to break, but real key-based digital encryption is much more complicated – trust me! The previous process is known as "symmetric" encryption, because the same key is used to encrypt and decrypt. In old-school espionage, the recipient would be equipped in advance with the knowledge or means to do the decryption. The problem with the internet is that the sender and recipient hardly ever meet, so we need to come up with a way to provide the recipient with the know-how, without it being intercepted along the way, because that will allow anyone who's smart enough to intercept internet traffic (which isn't very hard, really) to decrypt anything and listen in. To our help comes ASSYMETRIC encryption, and digital certificates. Asymmetric encryption Asymmetric encryption uses a special mathematical formula that generates two different keys, instead of one. We then use a special encryption formula that cannot be reversed with the same key. If you encrypt using the first key, you need the second to decrypt, and vice-versa. It's really quite a headache, but computers can do this sort of thing almost instantly. What happens when computers need to encrypt data is that the server (this could be your web server, for that matter) creates these two keys randomly. One is called the public key, and the other one the private key. Now, when that server wants to communicate securely with some other computer (say, your client), it sends it its public key (which is not secret—anyone is free to have it at any time), and then the client creates a unique and random regular key (like the one we discussed earlier). The client then encrypts the regular key using the server's public key, and sends it to the server. If you recall, the encrypted regular key stays secret, because even if someone intercepts that message, he can't decrypt it because, to do so, they would need the server's PRIVATE Key, which is kept really private and secret. So, the encrypted regular key is received by the server, which decrypts it, and now both sides have a regular key that no one else knows, and they can start using it to encrypt and decrypt messages back-and-forth. Fantastic. One thing, though, still needs to be taken care of is—trust. Say you are a client, and a server sends you this nice encrypted key, how do you know it's really a genuine partner, and not some other server that impersonates it? Well, for that, we have digital certificates. Digital certificates A digital certificate, like a real-world certificate, is a way to prove one's identity. When you want to get on a plane, you convince the security guard that you really are who you say you are by showing him a certificate given to you by the government—a passport or ID card, usually. It would have some unique seal or mark to prevent you from photo-shopping someone else's ID, and that allows the guard to trust you because he trusts the body that gave you that certificate. After all, the government (at least ours) won't hand out a passport randomly, right? Well, a digital certificate is given out by special companies who give them out only after verifying the recipient's identity properly, and so everyone trusts them. Even if you have never heard of VeriSign, Thawte, Valicert, or Entrust, your computer has heard of them. If you open your local certificate store, you can see them, as well as several others. To do so, open the Internet Control Panel, and switch to Content. Click on Publishers, and switch to Trusted Root Certificate Authorities, and voila: Once you have a digital certificate, you install it on the server it was intended for, and then, your server can present it to clients which attempt to connect to it. These clients check if the certificate is a match to the server by comparing the server's URL to the Common Name listed in the certificate. They also check if the certificate has not expired, if the certificate's issuer is a trustworthy one, and if that issuer hasn't revoked that certificate. If that is good and well, the whole encryption process discussed previously can continue. If something fails, the browser will alert you to that fact, and you can then decide if you want to take a risk and go ahead anyway, or walk away. If you look at the previous screenshot, or your own computer's Trusted Root Certification Authorities, you will notice that your browser comes with a pre-populated list of all major Certificate companies, but some companies don't want to buy a certificate from them because it can cost a lot of money, hundreds of dollars in some cases. Instead, they set up their own Certificate Authorities within the organization. Anyone can do that really. In fact, all versions of Windows Server come with a built-in Certificate Authority server that can be enabled for free. The challenge here is that such a server, by default, is not trusted by other computers unless they are configured to do so. This is done by installing the company's Certificate Authority's own certificate into each computer that needs to trust it. That could be a tedious process but, sometimes, it is inevitable. So, going back to our HTTPS trunks, to enable computers on the internet to communicate with it securely, it has to be able to prove its identity to these computers by having a digital certificate. The rest of the encryption process is done automatically and there's no need to worry about it. Getting the certificate, though, requires some planning. We already said that the client checks four things: The certificate is issued by a trusted authority The certificate's URL matches the one it's assigned to The certificate has not expired (calendar-wise) The certificate has not been revoked by the publisher
Read more
  • 0
  • 0
  • 3774

article-image-linux-shell-script-monitoring-activities
Packt
28 Jan 2011
8 min read
Save for later

Linux Shell Script: Monitoring Activities

Packt
28 Jan 2011
8 min read
Linux Shell Scripting Cookbook Solve real-world shell scripting problems with over 110 simple but incredibly effective recipes Master the art of crafting one-liner command sequence to perform tasks such as text processing, digging data from files, and lot more Practical problem solving techniques adherent to the latest Linux platform Packed with easy-to-follow examples to exercise all the features of the Linux shell scripting language Part of Packt's Cookbook series: Each recipe is a carefully organized sequence of instructions to complete the task as efficiently as possible.    Disk usage hacks Disk space is a limited resource. We frequently perform disk usage calculation on hard disks or any storage media to find out the free space available on the disk. When free space becomes scarce, we will need to find out large-sized files that are to be deleted or moved in order to create free space. Disk usage manipulations are commonly used in shell scripting contexts. This recipe will illustrate various commands used for disk manipulations and problems where disk usages can be calculated with a variety of options. Getting ready df and du are the two significant commands that are used for calculating disk usage in Linux. The command df stands for disk free and du stands for disk usage. Let's see how we can use them to perform various tasks that involve disk usage calculation. How to do it... To find the disk space used by a file (or files), use: $ du FILENAME1 FILENAME2 . . For example: $ du file.txt 4 The result is, by default, shown as size in bytes. In order to obtain the disk usage for all files inside a directory along with the individual disk usage for each file showed in each line, use: $ du -a DIRECTORY -a outputs results for all files in the specified directory or directories recursively. Running du DIRECTORY will output a similar result, but it will show only the size consumed by subdirectories. However, they do not show the disk usage for each of the files. For printing the disk usage by files, -a is mandatory. For example: $  du -a test 4  test/output.txt 4  test/process_log.sh 4  test/pcpu.sh 16  test An example of using du DIRECTORY is as follows: $ du test 16  test There's more... Let's go through additional usage practices for the du command. Displaying disk usage in KB, MB, or Blocks By default, the disk usage command displays the total bytes used by a file. A more human-readable format is when disk usage is expressed in standard units KB, MB, or GB. In order to print the disk usage in a display-friendly format, use –h as follows: du -h FILENAME For example: $ du -sh test/pcpu.sh 4.0K  test/pcpu.sh # Multiple file arguments are accepted Or: # du -h DIRECTORY $ du -h hack/ 16K  hack/ Finding the 10 largest size files from a given directory Finding large-size files is a regular task we come across. We regularly require to delete those huge size files or move them. We can easily find out large-size files using du and sort commands. The following one-line script can achieve this task: $ du -ak SOURCE_DIR | sort -nrk 1 | head Here -a specifies all directories and files. Hence du traverses the SOURCE_DIR and calculates the size of all files. The first column of the output contains the size in Kilobytes since -k is specified and the second column contains the file or folder name. sort is used to perform numerical sort with column 1 and reverse it. head is used to parse the first 10 lines from the output. For example: $ du -ak /home/slynux | sort -nrk 1 | head -n 4 50220 /home/slynux 43296 /home/slynux/.mozilla 43284 /home/slynux/.mozilla/firefox 43276 /home/slynux/.mozilla/firefox/8c22khxc.default One of the drawbacks of the above one-liner is that it includes directories in the result. However, when we need to find only the largest files and not directories we can improve the one-liner to output only the large-size files as follows: $ find . -type f -exec du -k {} ; | sort -nrk 1 | head We used find to filter only files to du rather than allow du to traverse recursively by itself. Calculating execution time for a command While testing an application or comparing different algorithms for a given problem, execution time taken by a program is very critical. A good algorithm should execute in minimum amount of time. There are several situations in which we need to monitor the time taken for execution by a program. For example, while learning about sorting algorithms, how do you practically state which algorithm is faster? The answer to this is to calculate the execution time for the same data set. Let's see how to do it. How to do it... time is a command that is available with any UNIX-like operating systems. You can prefix time with the command you want to calculate execution time, for example: $ time COMMAND The command will execute and its output will be shown. Along with output, the time command appends the time taken in stderr. An example is as follows: $ time ls test.txt next.txt real    0m0.008s user    0m0.001s sys     0m0.003s It will show real, user, and system times for execution. The three different times can be defined as follows: Real is wall clock time—the time from start to finish of the call. This is all elapsed time including time slices used by other processes and the time that the process spends when blocked (for example, if it is waiting for I/O to complete). User is the amount of CPU time spent in user-mode code (outside the kernel) within the process. This is only the actual CPU time used in executing the process. Other processes and the time that the process spends when blocked do not count towards this figure. Sys is the amount of CPU time spent in the kernel within the process. This means executing the CPU time spent in system calls within the kernel, as opposed to library code, which is still running in the user space. Like 'user time', this is only the CPU time used by the process. An executable binary of the time command is available at /usr/bin/time as well as a shell built-in named time exists. When we run time, it calls the shell built-in by default. The shell built-in time has limited options. Hence, we should use an absolute path for the executable (/usr/bin/time) for performing additional functionalities. We can write this time statistics to a file using the -o filename option as follows: $ /usr/bin/time -o output.txt COMMAND The filename should always appear after the –o flag. In order to append the time statistics to a file without overwriting, use the -a flag along with the -o option as follows: $ /usr/bin/time -a -o output.txt COMMAND We can also format the time outputs using format strings with the -f option. A format string consists of parameters corresponding to specific options prefixed with %. The format strings for real time, user time, and sys time are as follows: Real time - %e f User - %U f sys - %S By combining parameter strings, we can create formatted output as follows: $ /usr/bin/time -f "FORMAT STRING" COMMAND For example: $ /usr/bin/time -f "Time: %U" -a -o timing.log uname Linux Here %U is the parameter for user time. When formatted output is produced, the formatted output of the command is written to the standard output and the output of the COMMAND, which is timed, is written to standard error. We can redirect the formatted output using a redirection operator (>) and redirect the time information output using the (2>) error redirection operator. For example: $ /usr/bin/time -f "Time: %U" uname> command_output.txt 2>time.log $ cat time.log Time: 0.00 $ cat command_output.txt Linux Many details regarding a process can be collected using the time command. The important details include, exit status, number of signals received, number of context switches made, and so on. Each parameter can be displayed by using a suitable format string. The following table shows some of the interesting parameters that can be used: For example, the page size can be displayed using the %Z parameters as follows: $ /usr/bin/time -f "Page size: %Z bytes" ls> /dev/null Page size: 4096 bytes Here the output of the timed command is not required and hence the standard output is directed to the /dev/null device in order to prevent it from writing to the terminal.  
Read more
  • 0
  • 0
  • 5844

article-image-ibm-tuesday
Packt
27 Jan 2011
2 min read
Save for later

IBM Tuesday

Packt
27 Jan 2011
2 min read
IBM Rational Team Concert 2 Essentials Improve your team productivity with Integrated Process, Planning, and Collaboration using Team Concert Enterprise Edition OUT NOW! Getting Started with IBM FileNet P8 Content Manager Install, customize, and administer the powerful FileNet enterprise content management platform OUT NOW!   IBM Lotus Quickr 8.5 for Domino Administration Ensure effective and efficient team collaboration by building a solid social infrastructure with IBM Lotus Quickr 8.5 OUT NOW! IBM WebSphere Application Server v7.0 Security Secure your WebSphere applications with Java EE and JAAS security standards OUT NOW!   Why not make the most of this offer and purchase a selection of IBM books, here are some popular bundles people are buying right now:   +   + WebSphere Application Server 7.0 Administration Guide   IBM WebSphere Application Server v7.0 Security   WebSphere Application Server 7.0 Administration Guide   IBM WebSphere eXtreme Scale 6   +       +   IBM Lotus Notes 8.5 User Guide   IBM Lotus Quickr 8.5 for Domino Administration   IBM Lotus Sametime 8 Essentials: A User's Guide   IBM Lotus Notes 8.5 User Guide   +       +   IBM Lotus Notes and Domino 8.5.1   IBM Lotus Quickr 8.5 for Domino Administration   WS-BPEL 2.0 for SOA Composite Applications with IBM WebSphere 7   Application Development for IBM WebSphere Process Server 7 and Enterprise Service Bus 7   +       +   IBM WebSphere Application Server v7.0 Security   WS-BPEL 2.0 for SOA Composite Applications with IBM WebSphere 7   IBM Cognos 8 Planning   IBM Cognos 8 Report Studio Cookbook   +           IBM ClearCase 7.0: Master the Tools That Monitor, Analyze, and Manage Software Configurations   IBM InfoSphere Replication Server and Data Event Publisher           Latest Articles On IBM:- IBM Lotus Quickr Services Overview Replication Alert Monitor: Monitoring Management Advanced Activities in BPEL FAQ on Installing and Using the IBM Lotus Sametime 8 Mobile Client IBM's BPM BlueWorks  
Read more
  • 0
  • 0
  • 6804
article-image-ibm-tuesday-competition
Packt
27 Jan 2011
1 min read
Save for later

IBM Tuesday Competition

Packt
27 Jan 2011
1 min read
Click on the images below to view these books in more detail
Read more
  • 0
  • 0
  • 1791

article-image-why-ajax-is-a-different-type-of-software
Packt
27 Jan 2011
14 min read
Save for later

Why Ajax is a different type of software

Packt
27 Jan 2011
14 min read
Ajax is not a piece of software in the way we think about JavaScript or CSS being a piece of software. It's actually a lot more like an overlaid function. But what does that mean, exactly? Why Ajax is a bit like human speech Human speech is an overlaid function. What is meant by this is reflected in the answer to a question: "What part of the human body has the basic job of speech?" The tongue, for one answer, is used in speech, but it also tastes food and helps us swallow. The lungs and diaphragm, for another answer, perform the essential task of breathing. The brain cannot be overlooked, but it also does a great many other jobs. All of these parts of the body do something more essential than speech and, for that matter, all of these can be found among animals that cannot talk. Speech is something that is overlaid over organs that are there in the first place because of something other than speech. Something similar to this is true for Ajax, which is not a technology in itself, but something overlaid on top of other technologies. Ajax, some people say, stands for Asynchronous JavaScript and XML, but that was a retroactive expansion. JavaScript was introduced almost a decade before people began seriously talking about Ajax. Not only is it technically possible to use Ajax without JavaScript (one can substitute VBScript at the expense of browser compatibility), but there are quite a few substantial reasons to use JavaScript Object Notation (JSON) in lieu of heavy-on-the-wire eXtensible Markup Language (XML). Performing the overlaid function of Ajax with JSON replacing XML is just as eligible to be considered full-fledged Ajax as a solution incorporating XML. Ajax helps the client talk to the server Ajax is a way of using client-side technologies to talk with a server and perform partial page updates. Updates may be to all or part of the page, or simply to data handled behind the scenes. It is an alternative to the older paradigm of having a whole page replaced by a new page loaded when someone clicks on a link or submits a form. Partial page updates, in Ajax, are associated with Web 2.0, while whole page updates are associated with Web 1.0; it is important to note that "Web 2.0" and "Ajax" are not interchangeable. Web 2.0 includes more decentralized control and contributions besides Ajax, and for some objectives it may make perfect sense to develop an e-commerce site that uses Ajax but does not open the door to the same kind of community contributions as Web 2.0. Some of the key features common in Web 2.0 include: Partial page updates with JavaScript communicating with a server and rendering to a page An emphasis on user-centered design Enabling community participation to update the website Enabling information sharing as core to what this communication allows The concept of "partial page updates" may not sound very big, but part of its significance may be seen in an unintended effect. The original expectation of partial page updates was that it would enable web applications that were more responsive. The expectation was that if submitting a form would only change a small area of a page, using Ajax to just load the change would be faster than reloading the entire page for every minor change. That much was true, but once programmers began exploring, what they used Ajax for was not simply minor page updates, but making client-side applications that took on challenges more like those one would expect a desktop program to do, and the more interesting Ajax applications usually became slower. Again, this was not because you could not fetch part of the page and update it faster, but because programmers were trying to do things on the client side that simply were not possible under the older way of doing things, and were pushing the envelope on the concept of a web application and what web applications can do. Which technologies does Ajax overlay? Now let us look at some of the technologies where Ajax may be said to be overlaid. JavaScript JavaScript deserves pride of place, and while it is possible to use VBScript for Internet Explorer as much more than a proof of concept, for now if you are doing Ajax, it will almost certainly be Ajax running JavaScript as its engine. Your application will have JavaScript working with XMLHttpRequest, JavaScript working with HTML, XHTML, or HTML5; JavaScript working with the DOM, JavaScript working with CSS, JavaScript working with XML or JSON, and perhaps JavaScript working with other things. While addressing a group of Django developers or Pythonistas, it would seem appropriate to open with, "I share your enthusiasm." On the other hand, while addressing a group of JavaScript programmers, in a few ways it is more appropriate to say, "I feel your pain." JavaScript is a language that has been discovered as a gem, but its warts were enough for it to be largely unappreciated for a long time. "Ajax is the gateway drug to JavaScript," as it has been said—however, JavaScript needs a gateway drug before people get hooked on it. JavaScript is an excellent language and a terrible language rolled into one. Before discussing some of the strengths of JavaScript—and the language does have some truly deep strengths—I would like to say "I feel your pain" and discuss two quite distinct types of pain in the JavaScript language. The first source of pain is some of the language decisions in JavaScript: The Wikipedia article says it was designed to resemble Java but be easier for non-programmers, a decision reminiscent of SQL and COBOL. The Java programmer who finds the C-family idiom of for(i = 0; i < 100; ++i) available will be astonished to find that the functions are clobbering each other's assignments to i until they are explicitly declared local to the function by declaring the variables with var. There is more pain where that came from. The following two functions will not perform the naively expected mathematical calculation correctly; the assignments to i and the result will clobber each other: function outer() { result = 0; for(i = 0; i < 100; ++i) { result += inner(i); } return result } function inner(limit) { result = 0; for(i = 0; i < limit; ++i) { result += i; } return result; } The second source of pain is quite different. It is a pain of inconsistent implementation: the pain of, "Write once, debug everywhere." Strictly speaking, this is not JavaScript's fault; browsers are inconsistent. And it need not be a pain in the server-side use of JavaScript or other non-browser uses. However, it comes along for the ride for people who wish to use JavaScript to do Ajax. Cross-browser testing is a foundational practice in web development of any stripe; a good web page with semantic markup and good CSS styling that is developed on Firefox will usually look sane on Internet Explorer (or vice versa), even if not quite pixel-perfect. But program directly for the JavaScript implementation on one version of a browser, and you stand rather sharp odds of your application not working at all on another browser. The most important object by far for Ajax is the XMLHttpRequest and not only is it not the case that you may have to do different things to get an XMLHttpRequest in different browsers or sometimes different (common) versions of the same browser, and, even when you have code that will get an XMLHttpRequest object, the objects you have can be incompatible so that code that works on one will show strange bugs for another. Just because you have done the work of getting an XMLHttpRequest object in all of the major browsers, it doesn't mean you're home free. Before discussing some of the strengths of the JavaScript language itself, it would be worth pointing out that a good library significantly reduces the second source of pain. Almost any sane library will provide a single, consistent way to get XMLHttpRequest functionality, and consistent behavior for the access it provides. In other words, one of the services provided by a good JavaScript library is a much more uniform behavior, so that you are programming for only one model, or as close as it can manage, and not, for instance, pasting conditional boilerplate code to do simple things that are handled differently by different browser versions, often rendering surprisingly different interpretations of JavaScript. Many of the things we will see done well as we explore jQuery are also done well in other libraries. We previously said that JavaScript is an excellent language and a terrible language rolled into one; what is to be said in favor of JavaScript? The list of faults is hardly all that is wrong with JavaScript, and saying that libraries can dull the pain is not itself a great compliment. But in fact, something much stronger can be said for JavaScript: If you can figure out why Python is a good language, you can figure out why JavaScript is a good language. I remember, when I was chasing pointer errors in what became 60,000 lines of C, teasing a fellow student for using Perl instead of a real language. It was clear in my mind that there were interpreted scripting languages, such as the bash scripting that I used for minor convenience scripts, and then there were real languages, which were compiled to machine code. I was sure that a real language was identified with being compiled, among other things, and that power in a language was the sort of thing C traded in. (I wonder why he didn't ask me if he wasn't a real programmer because he didn't spend half his time chasing pointer errors.) Within the past year or so I've been asked if "Python is a real programming language or is just used for scripting," and something similar to the attitude shift I needed to appreciate Perl and Python is needed to properly appreciate JavaScript. The name "JavaScript" is unfortunate; like calling Python "Assembler Kit", it's a way to ask people not to see its real strengths. (Someone looking for tools for working on an assembler would be rather disgusted to buy an "Assembler Kit" and find Python inside. People looking for Java's strengths in JavaScript will almost certainly be disappointed.) JavaScript code may look like Java in an editor, but the resemblance is a façade; besides Mocha, which had been renamed LiveScript, being renamed to JavaScript just when Netscape was announcing Java support in web browsers, it is has been described as being descended from NewtonScript, Self, Smalltalk, and Lisp, as well as being influenced by Scheme, Perl, Python, C, and Java. What's under the Java façade is pretty interesting. And, in the sense of the simplifying "façade" design pattern, JavaScript was marketed in a way almost guaranteed not to communicate its strengths to programmers. It was marketed as something that nontechnical people could add snippets of, in order to achieve minor, and usually annoying, effects on their web pages. It may not have been a toy language, but it sure was dressed up like one. Python may not have functions clobbering each other's variables (at least not unless they are explicitly declared global), but Python and JavaScript are both multiparadigm languages that support object-oriented programming, and their versions of "object-oriented" have a lot in common, particularly as compared to (for instance) Java. In Java, an object's class defines its methods and the type of its fields, and this much is set in stone. In Python, an object's class defines what an object starts off as, but methods and fields can be attached and detached at will. In JavaScript, classes as such do not exist (unless simulated by a library such as Prototype), but an object can inherit from another object, making a prototype and by implication a prototype chain, and like Python it is dynamic in that fields can be attached and detached at will. In Java, the instanceof keyword is important, as are class casts, associated with strong, static typing. Python doesn't have casts, and its isinstance() function is seen by some as a mistake. The concern is that Python, like JavaScript, is a duck-typing language: "If it looks like a duck, and it quacks like a duck, it's a duck!" In a duck-typing language, if you write a program that polls weather data, and there's a ForecastFromScreenscraper object that is several years old and screenscrapes an HTML page, you should be able to write a ForecastFromRSS object that gets the same information much more cleanly from an RSS feed. You should be able to use it as a drop-in replacement as long as you have the interface right. That is different from Java; at least if it were a ForecastFromScreenscraper object, code would break immediately if you handed it a ForecastFromRSS object. Now, in fairness to Java, the "best practices" Java way to do it would probably separate out an IForecast interface, which would be implemented by both ForecastFromScreenscraper and later ForecastFromRSS, and Java has ways of allowing drop-in replacements if they have been explicitly foreseen and planned for. However, in duck-typed languages, the reality goes beyond the fact that if the people in charge designed things carefully and used an interface for a particular role played by an object, you can make a drop-in replacement. In a duck-typed language, you can make a drop-in replacement for things that the original developers never imagined you would want to replace. JavaScript's reputation is changing. More and more people are recognizing that there's more to the language than design flaws. More and more people are looking past the fact that JavaScript is packaged like Java, like packaging a hammer to give the impression that it is basically like a wrench. More and more people are looking past the silly "toy language" Halloween costume that JavaScript was stuffed into as a kid. One of the ways good programmers grow is by learning new languages, and JavaScript is not just the gateway to mainstream Ajax; it is an interesting language in itself. With that much stated, we will be making a carefully chosen, selective use of JavaScript, and not make a language lover's exploration of the JavaScript language, overall. Much of our work will be with the jQuery library; if you have just programmed a little "bare JavaScript", discovering jQuery is a bit like discovering Python, in terms of a tool that cuts like a hot knife through butter. It takes learning, but it yields power and interesting results soon as well as having some room to grow. What is XMLHttpRequest in relation to Ajax? The XMLHttpRequest object is the reason why the kind of games that can be implemented with Ajax technologies do not stop at clones of Tetris and other games that do not know or care if they are attached to a network. They include massive multiplayer online role-playing games where the network is the computer. Without having something like XMLHttpRequest, "Ajax chess" would probably mean a game of chess against a chess engine running in your browser's JavaScript engine; with XMLHttpRequest, "Ajax chess" is more likely man-to-man chess against another human player connected via the network. The XMLHttpRequest object is the object that lets Gmail, Google Maps, Bing Maps, Facebook, and many less famous Ajax applications deliver on Sun's promise: the network is the computer. There are differences and some incompatibilities between different versions of XMLHttpRequest, and efforts are underway to advance "level-2-compliant" XMLHttpRequest implementations, featuring everything that is expected of an XMLHttpRequest object today and providing further functionality in addition, somewhat in the spirit of level 2 or level 3 CSS compliance. We will not be looking at level 2 efforts, but we will look at the baseline of what is expected as standard in most XMLHttpRequest objects. The basic way that an XMLHttpRequest object is used is that the object is created or reused (the preferred practice usually being to reuse rather than create and discard a large number), a callback event handler is specified, the connection is opened, the data is sent, and then when the network operation completes, the callback handler retrieves the response from XMLHttpRequest and takes an appropriate action. A bare-bones XMLHttpRequest object can be expected to have the following methods and properties.
Read more
  • 0
  • 0
  • 10014

article-image-openam-identity-stores-types-supported-types-caching-and-notification
Packt
27 Jan 2011
11 min read
Save for later

OpenAM Identity Stores: Types, Supported Types, Caching and Notification

Packt
27 Jan 2011
11 min read
Like any other service, the Identity Repository service is also defined using an XML file named idRepoService.xml that can be found in <conf-dir>/config/xml. In this file one can define as many subschema as needed. By default, the following subschema names are defined: LDAPv3 LDAPv3ForAMDS LDAPv3ForOpenDS LDAPv3ForTivoli LDAPv3ForAD LDAPv3ForADAM Files Database However, not all of them are supported in the version that has been tested while writing this article. For instance the files, LDAPv3, and Database subschema are meant to be sample implementations. One can extend it for other databases, keeping this as an example. The rest of the sub configurations are all well tested and supported. One of the Identity Repository types Access Manager Repository is missing from this definition, as it is a manual process to add it into the OpenSSO server. That is something which will be detailed later in this article. It is also called a legacy SDK plugin for OpenSSO. The Identity Repository framework requires support for logging service and session management to deliver its overall functionality. Identity store types In OpenSSO, multiple types of Identity Repository plugins are implemented including the following: LDAPv3Repo AgentsRepo InternalRepo/SpecialRepo FilesRepo AMSDKRepo Unlike the Access Manager Repository plugin, these are available in a vanilla OpenSSO server. So customers can readily use it without requiring to perform any additional configuration steps. LDAPv3Repo: Is the plugin that will be used by customers and the administrators quite frequently as the other types of plugin implementations are mostly meant to be used by OpenSSO internal services. This plugin forms the basis for building the configuration for supporting various LDAP servers including Microsoft Active Directory, Active Directory Application Mode (ADAM/LDS), IBM Tivoli Directory, OpenDS, and Oracle Directory Server Enterprise Edition. There are subschema defined for each of the recently mentioned LDAP servers in the IdRepo service schema as described in the beginning of this section. AgentsRepo: Is a plugin that is used to manage the OpenSSO policy agents' profiles. Unlike the LDAPv3Repo, AgentsRepo uses the configuration repository to store the agent's configuration data including authentication information. Prior to the Agents 3.0 version, all agents accessing earlier versions of OpenSSO such as Access Manager 7.1, had most of the configuration data of the agents stored locally in the file system as plain text files. This imposed huge management problems for the customers to upgrade or change any configuration parameters as it required them to log in to each host where the agents are installed. Besides, the configuration of all agents prior to 3.0 was stored in the user identity store. In OpenSSO the agent's profiles and configurations are stored as part of the configuration Directory Information Tree (DIT). The AgentsRepo is a hidden internal repository plugin, and at no point should it be visible to end users or administrators for modification. SpecialRepo: In the predecessor of OpenSSO the administrative users were stored as part of the user identity store. So even when the configuration store is up and running administrators still cannot log in to the system unless the user identity store is up and running. This kind of limits the customer experience especially during pilot testing and troubleshooting scenarios. To overcome this, OpenSSO introduced a feature wherein all the core administrative users are stored as part of the configuration store in the IdRepo service. All the administrative and special user authentication by default uses this specialrepo framework. It may be possible to override this behavior by invoking module based authentication. SpecialRepo is used as a fallback repository to get authenticated to the OpenSSO server. SpecialRepo is also a hidden internal repository plugin. At no point, should it be visible to end users or administrators for modification. FilesRepo: Is no longer supported in the OpenSSO product. You can see the references of this in the source code but it cannot be configured to use flat files store for either configuration data or user identity data. AMSDKRepo: This plugin has been made available to maintain the compatibility with the Sun Java System Access Manager versions. When this plugin is enabled the identity schema is defined using the DAI service as described in the ums.xml. This plugin will not be available in the vanilla OpenSSO server, the administrator has to perform certain manual steps to have this plugin available for use. In this plugin, identity management is tightly coupled with the Oracle Directory Server Enterprise Edition. It is generally useful in the co-existence scenario where OpenSSO needs to co-exist with Sun Access Manager. In this article wherever we refer to "Access Manager Repository plugin" it means refer to AMSDKRepo. Besides this there is a sample implementation for the MySQL-based database repository available as part of the server default configuration. It works; however, it is not extensively tested for all the OpenSSO features. You can also refer to another discussion on the custom database repository implementation at this link: http:// www.badgers-in-foil.co.uk/notes/installing_a_custom_opensso_identity_ repository/. Caching and notification For the LDAPv3Repo, the key feature that enables it to perform and scale is the caching of results set for each client query, without which it would be impossible to achieve the performance and scalability. When caching is employed there is a possibility that clients could get stale information about identities. This can be avoided by keeping the cache cleaned up periodically or having an external event dirty the cache so new values can be cached. OpenSSO provides more than one way to tackle this caching and notification. There are a couple of ways in which the cache can be invalidated and refreshed. The Identity Repository design relies broadly on two types of mechanisms to refresh the IdRepo cache. They are: Persistent search-based event notification Time-to-live (TTL) based refresh Both methods have their own merits and can be enabled simultaneously, and it is recommended. This is to handle the scenario where a network glitch (which could cause a packet loss) might have caused the OpenSSO server to miss some change notifications. The value of TTL purely depends on the deployment environment and end user experience. Persistent search-based notification The OpenSSO Identity Repository plugin cache can be invalidated and refreshed by registering a persistent search connection to the backend LDAP server provided the LDAP server supports the persistent search control. The persistent search (http:// www.mozilla.org/directory/ietf-docs/draft-smith-psearch-ldap-01.txt) control 2.16.840.1.113730.3.4.3 is implemented by many of the commercial LDAP servers including: IBM (Tivoli Directory) Novell (eDirectory) Oracle Directory Server Enterprise Edition(ODSEE) OpenDS (OpenDS Directory Server 1.0.0-build007) Fedora-Directory/1.0.4 B2006.312.1539 In order to determine whether your LDAP vendor supports a persistent search, perform the following search for the persistent search control 2.16.840.1.113730.3.4.3: ldapsearch -p 389 -h ds_host -s base -b '' "objectclass=*" supportedControl | grep 2.16.840.1.113730.3.4.3 Microsoft Active Directory implements in a different form using the LDAP control 1.2.840.113556.1.4.528. Persistent searches are handled by the max-psearch-count property in the Sun Java Directory Server that defines the maximum number of persistent searches that can be performed on the directory server. The persistent search mechanism provides an active channel through which entries that change (and information about the changes that occur) can be communicated. As each persistent search operation uses one thread, limiting the number of simultaneous persistent searches prevents certain kinds of denial of service attacks. It is quite apparent that a client implementation that generates a large number of persistent connections to a single directory server may indicate that the LDAP protocol may not have been the correct transport. However, horizontal scaling using Directory Proxy Servers, or an LDAP Consumer tier, may assist to spread the load. The best solution, from an LDAP implementation, would be to limit persistent searches. If you have created a user data store against an LDAP server which supports RFC2026, then a persistent search connection will be created with base DN configured in the LDAPv3 configuration. The search filter for this connection is obtained from the data store configuration properties. Though it is possible to listen to a specific type of change event, OpenSSO registers the persistent search connections to receive all kinds of change events. The IdRepo framework has the logic to determine whether the underlying directory server supports persistent searches or not. If not supported it does not try to submit the persistent search. In this case customers may resort to a TTL-based notification as described in the next section. Each active persistent search request requires that an open TCP connection be maintained between an LDAP client (in this case it is OpenSSO) and an LDAP (backend user store LDAP server) server that might not otherwise be kept open. The OpenSSO server that acts as an LDAP client closes idle LDAP connections to the backend LDAP server in order to maximize the resource utilization. If the OpenSSO servers are behind the load balancer or a firewall you need to tune the value of "com. sun.am.event.connection.idle.timeout". If the persistent search connections are made through a Load Balancer (LB) or firewall, then these connections are subject to the TCP timeout value of the respective LB and/or firewall. In such a scenario once the firewall closes the persistent search connection due to an idle TCP timeout, then the change notifications cannot happen to OpenSSO unless the persistent search connection is re-established. Customers could avoid this scenario by configuring the idle timeout for the persistent search connection so that it would restart the persistent search TCP connection before the LB/firewall idle timeout, that way the LB/firewall will not have an idle persistent search connection. The advanced server configuration property "com.sun.am.event.connection. idle.timeout" specifies timeout value in minutes after which the persistent searches will be restarted. Ideally, this value should be lower than the LB/firewall TCP timeout, to make sure that the persistent searches are restarted before the connections are dropped. A value of "0" indicates that these searches will not be restarted. By default the value is "0". Only the connections that are timed out will be reset. You should never set this value to a value lower than the LB/firewall timeout. The delta should not be more than five minutes. If your LB's idle connection timeout is "50" minutes, then set this property value to "45" minutes. For some reason if you want to disable the persistent search to be submitted to the backend LDAP server, just leave the persistent search base (sun-idrepo-ldapv3- config-psearchbase) empty, this will cause the IdRepo to disable the persistent search connection. Time-to-live based notification There may be deployment scenarios where persistent search-based notifications may not be possible or the underlying LDAP server may not be supporting the persistent search control. In such scenarios customers can employ the TTL or timeto- live based notification mechanism. It is a feature that involves a proprietary implementation by the OpenSSO server. This feature works in a fashion that is similar to the polling mechanism in the OpenSSO clients where the client periodically polls the OpenSSO server for changes, often called "pull" model. Whereas persistent search-based notifications are termed as "push" model (the LDAP server pushes the changes to the clients). Regardless of the persistent search based change notifications, the OpenSSO server polls the underlying directory server and gets the data to refresh its Identity Repository cache. TTL-specific properties for Identity Repository cache When the OpenSSO deployment is configured for TTL-based cache refresh, there are certain server-side properties that need to be configured to enable the Identity Repository framework to refresh the cache. The following are the core properties that are relevant in the TTL context: com.sun.identity.idm.cache.entry.expire.enabled=true com.sun.identity.idm.cache.entry.user.expire.time=1 (in minutes). com.sun.identity.idm.cache.entry.default.expire.time=1 (in minutes). The property com.sun.identity.idm.cache.user.expire.time and com.sun. identity.idm.cache.default.expire.time specify time in minutes for which the user and non-user entries such as roles and groups respectively remain valid after their last modification. In other words after this specified period of time elapses, the data for the entry that is cached will expire. At that instant, new requests for these entries will result in fresh reading from the underlying Identity Repository plugins. Suppose the property com.sun.identity.idm.cache.entry.expire.enabled is set to true, the non-user objects cache entries will expire based on the time specified in the com.sun.identity.idm.cache.entry.default.expire.time property. The rest of the user entries objects will be cleaned up based on the value set in the property com.sun.identity.idm.cache.entry.user.expire.time.
Read more
  • 0
  • 0
  • 3097
article-image-testing-workflows-microsoft-dynamics-ax-2009-administration
Packt
27 Jan 2011
3 min read
Save for later

Testing Workflows for Microsoft Dynamics AX 2009 Administration

Packt
27 Jan 2011
3 min read
Microsoft Dynamics AX 2009 Administration Testing Workflow At this point, you have performed all the steps required to process workflows. Running an actual Workflow is the best way to test the Workflow system. Depending on your license scheme, Dynamics AX will be equipped with default Workflow templates. In this example, we will cover the process of testing the Workflow system using the Purchase requisition workflow template. In Dynamics AX, go to Account Payable | Setup | Workflow configurations to load the Workflow configuration form specific for Accounts Payable business processes. In the Workflow configuration form, select the PurchReqApproval template from the Template drop-down. To create a new Workflow configuration for Purchase requisitions, click on the New button. The Create configuration: Select a template form will load. Select Purchase requisition approval and click on the Create configuration button to start creating the new configuration. After you have clicked on the Create configuration button, a new form Workflow: Purchase requisition approval will load. Provide the relevant field information in the current view. Various fields are required to be filled out in order to save a configuration. In this view, we must provide text in the Submission instructions field. You can set a specific condition that will allow this workflow to initiate. If the condition isn’t satisfied, the workflow will not proceed. For example, perhaps you would want the workflow to be used for Purchase requisitions that have a specific value. Instead of waiting for the workflow to run in order to verify that it works on specific conditions, you can simply test the conditions as you create them by clicking on the Test condition button. This will allow you to test your conditions on existing Purchase requisitions. In the next step, we must specify the required parameters for the complete and approval stage of the Purchase requisition workflow template. Each workflow may have different stages and each stage has fields that are required to be populated. To specify the parameters for the complete and approval stages in the Purchase requisition workflow, click on the Details tab. Select the PurchReqComplete task to specify the parameters for the complete stage as you did when you were in the General tab. When you have specified the required fields, collapse the PurchReqApproval task and select Step 1. You must also assign a user, group, or role that can approve the PurchReqComplete task. To specify a user, click on the Assignment tab. To specify a user, click on the Choose button. This will load the Assignment form where you can select a specific user, group, role, or hierarchy. You can also specify a time limit for how long a task must be approved by until it expires. Once you have specified the appropriate parameters, click on the OK button.
Read more
  • 0
  • 0
  • 5074

article-image-applied-architecture-patterns-microsoft-application-platform-packt-enterprises-book-mo
Packt
25 Jan 2011
1 min read
Save for later

Applied Architecture Patterns on the Microsoft Application Platform : Packt Enterprise's Book of the Moment

Packt
25 Jan 2011
1 min read
Packt Enterprise's Book of the Moment Packt Enterprise's book of the moment has been named as... Applied Architecture Patterns on the Microsoft Platform This book has been awarded Packt Enterprise's Book of the Moment accolade due to its innovative approach to applying Microsoft technologies. Written by a distinguished team of specialists in the Microsoft space - Richard Seroter, Ewan Fairweather, et al - this book provides an in-depth scenario-driven approach to architecting systems using Microsoft technologies. To view a video on the story behind the book click here           + Buy 'Applied Architecture Patterns on the Microsoft Platform' with'Microsoft Visio 2010 Business Process Diagramming and Validation' and get 50% off both the eBooks. Just add both the eBooks to your shopping cart and enter 'aapmpebk' in the 'Enter Promotion Code' field. Click 'Add Promoitonal Code'  and the discount will be applied.
Read more
  • 0
  • 0
  • 1131
Modal Close icon
Modal Close icon