Archive for July, 2012

Create LaTex PDF files in Notepad++

July 29th, 2012

Suppose the MiKTeX is installed under: C:\Program Files\MiKTeX 2.9\.

Start notepad++, press F5, enter this:
"C:\Program Files\MiKTeX 2.9\miktex\bin\x64\pdflatex.exe" -output-directory="$(CURRENT_DIRECTORY)" -interaction=nonstopmode "$(FULL_CURRENT_PATH)"
in the input box. Click on “Save”, input a name for the shutcut like “LaTex To Pdf”, choose the shortcut (for example Ctrl+Shift+Alt+L), and press “OK”.

Now we can run the the command by shortcut Ctrl+Shift+Alt+L or by the menu Run -> LaTex To Pdf.

Here is a simple sample latex file:
Hallo, \textbf{\textit{\LaTeX}}!

make a program run at boot on linux

July 13th, 2012

just to remind myself:

put the command in file:

Memo of using analog to measure website traffic

July 6th, 2012

A sudden heavy load was detected on our server. On this server the only public service is https which serves a few websites. I check the auth logs and didn’t find anything abnormal. So I wonder it’s some sudden heavy requests were thrown on the apache server. I have never used any web log analyzer before, and googled a little and found analog should do the job for me. Here is just a memo of what I did today.

Install the analog package

On a debian/ubuntu server, one can easily install analog by:
#> (sudo) apt-get install analog
On windows, one can simply download the latest binary package, extract it, and then use it.

Basics of analog

Analog is a program that is used to analyze the apache logs and show the statics that may interest you.

To use analog, you need to provide it a config file, telling it where the logs are, and where to output the results, and what things should be in the results. The default config file in debian (if you install it by “apt-get”) will be /etc/analog.cfg. You can edit the file and then run analog without any parameter. Here is an example:

# tell analog where the log file is
LOGFILE /var/log/apache2/access.log
# tell analog where and the format to output the result
OUTFILE /home/me/host.stat.html
# the name of the host. this will be part of the title of the report.
# the link of the host.
# analog use some simple images to show the bars or to make the report more friendly. If you installed analog by "apt-get", there are under "/usr/share/analog/images/"; if you installed analog by download the binary package, the images directory is under the extracted root directory.
IMAGEDIR "/usr/share/analog/images/"

How to use a different config file and how to analyse more than one website

see this great article HOW-TO Use Analog for Virtual Hosts (Using Separate Logfiles)

How to show different sections or columns

analog can show the report by hourly, daily, monthly or yearly. Each can be a section in the report. And in each section, you can choose what things to show. Refer to & to see the things you can show.

One can find the detail document here: