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.
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.
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:
Signal Chaining: java.sun.com/javase/6/docs/technotes/guides/vm/signal-chaining.html
Revelations on Java signal handling and termination: www.ibm.com/developerworks/java/library/i-signalhandling/
Signal Handling on Solaris OS and Linux: java.sun.com/javase/6/webnotes/trouble/TSG-VM/html/gbzbl.html
|Using Salt Stack and Vagrant for Drupal Development||May 20, 2013|
|Making Linux and Android Get Along (It's Not as Hard as It Sounds)||May 16, 2013|
|Drupal Is a Framework: Why Everyone Needs to Understand This||May 15, 2013|
|Home, My Backup Data Center||May 13, 2013|
|Non-Linux FOSS: Seashore||May 10, 2013|
|Trying to Tame the Tablet||May 08, 2013|
- RSS Feeds
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Using Salt Stack and Vagrant for Drupal Development
- New Products
- Validate an E-Mail Address with PHP, the Right Way
- Drupal Is a Framework: Why Everyone Needs to Understand This
- A Topic for Discussion - Open Source Feature-Richness?
- Download the Free Red Hat White Paper "Using an Open Source Framework to Catch the Bad Guy"
- Tech Tip: Really Simple HTTP Server with Python
- Home, My Backup Data Center
- Android is Linux -- why no better inter-operation
1 hour 23 min ago
- Connecting Android device to desktop Linux via USB
1 hour 52 min ago
- Find new cell phone and tablet pc
2 hours 50 min ago
4 hours 19 min ago
- Automatically updating Guest Additions
5 hours 27 min ago
- I like your topic on android
6 hours 14 min ago
- Reply to comment | Linux Journal
6 hours 35 min ago
- This is the easiest tutorial
12 hours 50 min ago
- Ahh, the Koolaid.
18 hours 28 min ago
- git-annex assistant
1 day 28 min ago
Enter to Win an Adafruit Pi Cobbler Breakout Kit for Raspberry Pi
It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Pi Cobbler Breakout Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- 5-21-13, Prototyping Pi Plate Kit: Philip Kirby
- Next winner announced on 5-27-13!
Free Webinar: Linux Backup and Recovery
Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.
In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.