Create thumbnail for pdf document using php
To convert source test.pdf to image test.jpg
Pass this command to php function ' system()';
# gs -q -dNOPAUSE -dBATCH -sDEVICE=jpeg -sOutputFile=test.jpg test.pdf
# convert -resize 120x120 test.jpg test.jpg
solaris add user [ useradd ]
You must be root (superuser) to add a user. An easy way to remember the syntax of the useradd command in Solaris is to run it with no options. Follow the resulting usage information including the parts that you require. Important options are:
-d home-directory-path
This is the new user's home directory, typically /export/home/username
-m
make home directory and copy the default skeleton files (these files are located in /etc/skel directory).
-u uid
The uid (userid) is a number from 0 to 65535 which identifies the user on the system. uid 0 is reserved for root. If you don't specify one, the next available uid will be used automatically.
-c "User Name"
Comment field which usually contains the name of the user. Make sure you enclose the name in quotes if it contains a space.
-s /path/to/shell
The shell to use. If you don't specify this, it will default to /bin/sh. Make sure you specify the fully qualified path.
So, putting it together, a typical addition of a user named fred would be:
It's a smart idea to run pwck (passwd check) whenever you make a change to the /etc/passwd file (as when adding or chaning a user). This program will identify any problems with the passwd file. If it doesn't tell you anything, then you are in good shape.
Changing Solaris 10 Hostname
This applied if the host is using DHCP
Make sure that the hostname you want to use is in /etc/nodename;
the contents of that file will then be used to set the hostname.
(Note that it is essential that the hostname you put into /etc/nodename
is terminated with a carriage return.
IF it set manually... look for these files:
Change the hostname in the following files:
/etc/nodename
/etc/hostname.*interface
/etc/inet/hosts
/etc/inet/ipnodes
and rename directory under /var/crash
# cd /var/crash
# mv oldname newname
then reboot the server.
Sun Blade 150 Get To openBoot Promt without using keyboard
1. Press the Power Button.
2. During boot up notice the Beep Sound.
3. Quickly press the Power Button twice as you do the double click using mouse.
4. You will then be prompted with the ok
If not success Repeat the step 1-3.
It work with mine ....
[JAVA] Remove leading or trailing spaces in a String using regular expressions
import java.util.regex.*;
public class BlankRemover
{
/* remove leading whitespace */
public static String ltrim(String source) {
return source.replaceAll("^\\s+&qu ot;, "");
}
/* remove trailing whitespace */
public static String rtrim(String source) {
return source.replaceAll("\\s+$&qu ot;, "");
}
/* replace multiple whitespaces between words with single blank */
public static String itrim(String source) {
return source.replaceAll("\\b\\s{2 ,}\\b", " ");
}
/* remove all superfluous whitespaces in source string */
public static String trim(String source) {
return itrim(ltrim(rtrim(source) ));
}
public static String lrtrim(String source){
return ltrim(rtrim(source));
}
public static void main(String[] args){
String oldStr =
"> <1-2-1-2-1-2-1-2-1-2-1 -----2-1-2-1-2-1-2-1-2-1- 2-1-2> <";
String newStr = oldStr.replaceAll("-", " ");
System.out.println(newStr);
System.out.println(ltrim(newStr));
System.out.println(rtrim(newStr));
System.out.println(itrim(newStr));
System.out.println(lrtrim(newStr));
}
}