The easiest way to download/mirror a complete website is using WGET and use the mirror option. If you want to see your website with the correct layout and all images, make sure you also supply the --page-requisites flag.
The full command:
wget -p -m -k -K -E http://your.website.com/
See wget --help for an explanation of all command-line options, but these should give you a good start.
Break line in fixed width with the linux fold command.
I keep forgetting this command, so here goes.
The Linux 'fold' command, can be used to wrap each input line to fit in specified width.
If width is not specified using -w option, by default, 'fold' breaks lines wider than 80 columns. The output is split into as many lines as necessary.
To change a default Eclipse project to an Eclipse Java project you can follow the steps below.
Example:
Original .project file
<?xml version="1.0" encoding="UTF-8"?> <projectDescription> <name>A project</name>
Sometimes you want to replace one piece of text with another in all files in a whole directory tree.
*nix and sed to the rescue.
find ./ -type f -exec sed -i ’s/queryString/replaceString/g’ {} \;
We all know that Java is a memory hog. This page aims to give you an idea how much it actually hogs without using a profiler.
Primitive types
A reference to an object is in this listing also considered to be a primitive type.
Objects
Each Java object uses the following:
To print from the command line with Firefox, you need to install an extension. One such extension is
Command Line Print by torisugari.
This extension allows you to print URLs immediately, without user interaction. This can be useful to convert html pages to PDF for example.
You first have to install the extension from http://torisugari.googlepages.com/commandlineprint2
After you've properly installed the extension, you can start using Firefox as command line printer.
Usage:
$>firefox -print http://www.example.com/index.html
To include only a set of files with tar, you can use the following one liner. This example will tar all files with the java extension in the archive with the name test.
find . -name '*.java' | tar czvf test.tar.gz --files-from -
This tutorials shows how to restore all tabs that were open when you closed Firefox.
Go to about:config, this should be typed in the address bar.
Go to the section with that starts with browser.sessionstore and set the values to the whatever you like.
For some applications it is useful to determine the uncompressed size of a file that has been compressed by the gzip algorithm. From the command line this can be done by using the -l option of the gzip program. But this is less straightforward using the Java API's. The GZIPInputStream class does not provide a method to query the original file size. However the information is present in the GZIP file for files that were originally smaller than 4 Gb and can be extracted.
To create a table in latex one can use the tabular environment and surround it with a table block to add a caption and make it floating.
The table below starts with a column that is left-aligned, then there is a a column that will be in bold and is centered and finally there is an italic column that is right-aligned.
\begin{table}
\begin{tabular}{l>{\bfseries}c>{\italic}r}
apple & red & round\\
melon & green & round\\
cookie & brown & square\\
\end{tabular}
\caption{Some objects, their color and their shape.}
\end{table}