UpFront

The UpFront Section

UpFront

Tech Tip

To take a screenshot of the entire screen and save the image as screenshot.png, use the command:

$ import -window root screenshot.png*

To select an area to capture with a crosshair, use import without the -window option.

To take a screenshot of a specific area of the screen, use the -crop, option along with the dimension in pixels, for example:

import -crop 300X250

The import utility is part of the ImageMagick suite of tools.

Tech Tip

Sometime you may want to find all files modified during the installation of a given package. This problem can be solved simply as follows:

echo temp > /tmp/afile
# Install your package
find /etc -newer /tmp/afile  
# Find files modified in /etc

A useful variation is to identify all files “accessed” during the execution of a given program. Often some files under /etc are accessed, and you need to know which ones. This can be done as follows:

echo temp > /tmp/afile
# Run your program
find /etc -anewer /tmp/afile

A sneaky variation is to find all files modified between time1 and time2. Let's use the times 2007-12-02 13:45 and 2007-12-04 01:30 as an example:

touch -t 200712021345.00 /tmp/file1
touch -t 200712040130.00 /tmp/file2

find /etc -newer /tmp/file1 -a ! -newer /tmp/file2

This works by using touch -t to set the modification date of the files to set a date range for use with find.

Tech Tip

Do you have code for Linux written in Assembler, C, C++, FreePascal or any other native-compiled language that surfaces a Java JNI interface?

Have you had problems with crashes from time to time? It could be that your native code is improperly, from Java's point of view anyway, using signals. Even if your code is not explicitly using signals, the Run-Time Library (RTL) linked into your Java JNI Shared Object may be using signals “for” you.

The answer to your problems may lie in a Shared Object named libjsig.so that comes with later versions of Java. Basically, libjsig.so makes it easy to implement something called signal chaining that allows the Java JVM, and your Java JNI native code that uses signals, to interact with one another properly.

There are a couple ways to use libjsig.so, but one quick way to find out whether libjsig.so will benefit you is to use the wonderful Linux LD_PRELOAD capability discussed in the November 2004 issue of Linux Journal in the article “Modifying a Dynamic Library without Changing the Source Code” by Greg Kroah-Hartman (www.linuxjournal.com/article/7795).

To give it a go, in a bash shell, use the following technique to execute your Java application:

export LD_PRELOAD=/path/to/libjsig.so; java YOUR_JAVA_CLASS

For more information on libjsig.so try:

______________________

White Paper
Fabric-Based Computing Enables Optimized Hyperscale Data Centers

Today’s modular x86 servers are compute-centric, designed as a least common denominator to support a wide range of IT workloads. Those generic, virtualized IT workloads have much different resource optimization requirements than hyperscale and cloud applications. They have resulted in a “one size fits all” enterprise IT architecture that is not optimized for a specific set of IT workloads, and especially not emerging hyperscale workloads, such as web applications, big data, and object storage. In this report, you will learn how shifting the focus from traditional compute-centric IT architectures to an innovative disaggregated fabric-based architecture can optimize and scale your data center.

Learn More

Sponsored by AMD

White Paper
Red Hat White Paper: Using an Open Source Framework to Catch the Bad Guy

Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6

Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.

Learn more about catching the bad guy in this free white paper.

Learn More

Sponsored by DLT Solutions