Search This Blog

Friday, December 19, 2014

Mac OS X + Firefox + Flashgot + aria2c

Sample 1. Direct execution of aria2c

With this approach, aria2c runs background, so the download progress does not show up.

Executable path:
/opt/local/bin/aria2c

Command line arguments template:
-c -x 16 -s 16 [-d FOLDER] [-o FNAME] [--referer=REFERER] [--load-cookies=CFILE] [--input-file=UFILE] [URL]

Sample 2. Execution of aria2c within xterm

With this approach, aria2c runs within xterm, and the download progress can be seen at the window of xterm.

Executable path:
/opt/X11/bin/xterm

Command line arguments template:
-e  /opt/local/bin/aria2c -c -x 16 -s 16 [-d FOLDER] [-o FNAME] [--referer=REFERER] [--load-cookies=CFILE] [--input-file=UFILE] [URL]


Wednesday, November 19, 2014

OpenVPN for Raspberry Pi

http://readwrite.com/2014/04/10/raspberry-pi-vpn-tutorial-server-secure-web-browsing

* It’s possible to create just one client key for all of them, but in that case, only one device would be able to access the VPN at a time. ?

/etc/init.d/openvpn start

http://readwrite.com/2014/04/11/building-a-raspberry-pi-vpn-part-two-creating-an-encrypted-client-side#awesm=~oB89WBfWrt21bV

http://www.raspberrypi.org/forums/viewtopic.php?f=36&t=79814

https://openvpn.net/index.php/access-server/docs/admin-guides-sp-859543150/howto-connect-client-configuration/183-how-to-connect-to-access-server-from-a-mac.html

Create an account after the installation

1. Run a root shell to access /etc

$ sudo -s

2. Change directory to /etc/openvpn/easy-rsa

$ cd /etc/openvpn/easy-rsa

3. Set up the environment variables to create accounts

$ source ./vars

4. Create a user key pass

$ ./build-key-pass [user]

* Create PEM pass phrase and remember that
* Leave the challenge password blank
* Sign and commit the certificate
* This command will create 3 files in /etc/openvpn/easy-rsa/keys: user.crt, user.csr, and user.key

5. Create a des3 encrypted version of the key

$ openssl rsa -in [user].key -des3 -out [user].3des.key

* Create pass  phrase for the key and PEM pass phrase (same as the PEM pass phrase - mendatory?)

6. Create the ovpn file (openVPN configuration file for clients)

$ ./MakeOpenVPN.sh

* Enter the user name
* This command will create [user].ovpn

Tuesday, October 7, 2014

GNU octave legend font problem

GNU Octave has a problem in handling variable-width fonts in the plot legend. It seems that when Octave calculates the spacing between symbols (lines) and texts, it just take the fixed-width of Courier rather than the variable-width of Helvetica or Arial.

The following sites also reports that it was necessary to use fixed-width fonts to align in the legend.

http://engineeringliberty.wordpress.com/2011/10/07/making-great-plots-in-octave-and-matlab-too/

Sunday, September 28, 2014

Compile and install error of email 3.2.0-git

http://www.cleancode.org/projects/email

The current version of email 3.2.0-git has a problem in 'configure.in.' Some environment variables are defined out of scope, then prevent the installation process.

1. Problem

a. Download source code from GitHub

$ git clone https://github.com/deanproxy/eMail.git
$ cd eMail/
$ git clone https://github.com/deanproxy/dlib.git

b. Compile and install

$ ./configure
$ make
$ sudo make install

output

./install.sh --bindir "/usr/local/bin" --sysconfdir "/usr/local/etc" \
--mandir "/usr/local/share/man" --binext "" --version "" \
        --docdir "/usr/local/share/doc/"
error: You MUST specify the --version flag
make: *** [install] Error 2

This is because some environment variables, 'version' and 'cwd', is defined out of scope in 'configure.in'. Every check in 'configure.in' or 'configure.ac' must be between AC_INIT and AC_OUTPUT.
http://www.gnu.org/software/autoconf/manual/autoconf.html#Autoconf-Input-Layout

2. Solution

It is necessary to move these variable declarations into somewhere between AC_INIT and AC_OUTPUT. The revised 'configure.in' will look like the following:

#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
version=`cat VERSION`
cwd=`pwd`

AC_PREREQ(2.57)

AC_INIT(email, 3, )
AC_CONFIG_SRCDIR([src/addr_parse.c])
AC_CONFIG_HEADER([include/config.h])
AC_GNU_SOURCE

version=`cat VERSION`

cwd=`pwd`

# Checks for programs.
AC_PROG_CC
AC_PROG_MAKE_SET
...

a. Reconfiguration

$ make clean
$ autoconf

b. Compile and install again

$ ./configure
$ make
$ sudo make install

output

./install.sh --bindir "/usr/local/bin" --sysconfdir "/usr/local/etc" \
--mandir "/usr/local/share/man" --binext "" --version "3.2.0-git" \
        --docdir "/usr/local/share/doc/"
Installing email v3.2.0-git...
Binary directory: /usr/local/bin
Man directory: /usr/local/share/man
System configuration file directory: /usr/local/etc
Copying src/email to /usr/local/bin...
Creating Email Directory... 
Created '/usr/local/etc/email'... 
Copying Files to '/usr/local/etc/email' directory... 
Copying man pages to /usr/local/share/man/man1...
Copying email help documentation to /usr/local/share/doc//email-3.2.0-git... 
 Success!

#######################################################
# Done installing E-Mail client.                      #
# Please read README for information on setup and use.#
#                                                     #
# If you have any questions or concerns...            #
# Please e-mail: software@cleancode.org               #
#######################################################

Thursday, September 18, 2014

cygwin command-line package installation

setup-x86_64.exe -q -P packagename1,packagename2

The available packages can be found here: http://cygwin.com/packages/

Monday, September 15, 2014

OSX Octave Macports install for Mavericks

Successful install command combinations:

sudo port install octave +gcc49
sudo port install octave +atlas+docs+gcc49

Thursday, August 14, 2014

To redirect output when launching a program

2>/dev/null 1>/dev/null google-chrome &
2>/dev/null 1>&2 google-chrome &
 
Ref. http://stackoverflow.com/questions/18012930/how-to-redirect-all-output-to-dev-null 

Sunday, June 22, 2014

Macbook pro for eBay

I am selling a used 13-inch Apple Macbook pro, Mid 2009.

This Macbook pro works great.
It is in pretty good cometic condition.
I guess the battery lasts about an hour or less.

Here are some basic specifications.

CPU: 2.53 GHz Intel Core 2 Duo
RAM: 4 GB 1067 MHz DDR3
Video: NVIDIA GeForce 9400M 256MB
HDD: 320GB 7200rpm
CD/DVD: SuperDrive (CD and DVD Reader/Writer)

It shows that this Macbook is currently running OSX 10.9.1 Mavericks.
It also has 2.53 GHz Intel Core 2 Duo and 4GB 1067 MHz DDR3.

 Equipped with the NVIDIA GeForce 9400M 256 MB graphics card for 13-inch (1280x800)
 Equipped with the 320GB HD and SuperDrive that supports CD and DVD read/write
HDD model number is ST9320421AS, which is Seagate Momentus 7200.3 ST9320421AS 320GB 7200 RPM 16MB Cache SATA 3.0Gb/s 2.5" Internal Notebook Hard Drive.
 Currently equipped with 4GB
The current battery condition is 'Service Battery.' I think this Macbook lasts about an hour. 
The cycle count of the battery is 490 now. 
The max count limit would be 1,000 for 2009 mid macbook pro. (https://support.apple.com/kb/ht1519)

13-in Macbook pro

The keyboard is in pretty good shape.

The keyboard backlight is working great.

The Apple logo is glowing on the top cover.

Cosmetically pretty good condition with some minor wears. A small dent is on the left bottom side.

The bottom is also in pretty good condition.

MagSafe power port, ethernet port, Firewire 800 port, mini display port, 2 USB 2.0 ports, SD card slot, audio in/out port

Kensington lock slot and SuperDrive slot

Original box and MagSafe power cable set

Waterfield suede jacket for Macbook

The jacket is still good.

Original bundle disks for OSX 10.6 Snow Leopard and iLife
You can reinstall everything!

Sunday, April 20, 2014

Tuesday, March 11, 2014

Mean, median, myriad, and meridian computation

While the mean calculation is a trivial task, the median calculation is not trivial. It can be determined directly by sorting the samples, but the sorting process is computationally expensive *. Therefore, many researches have been done to develop fast algorithms to compute the median **. The myriad is more difficult to calculate than the median. The myriad can be obtained by minimizing the associated cost function, or by finding polynomial roots of the derivative polynomial of the cost function. The derivative polynomial is (2N-1)-th order polynomial, and the only real value satisfies the condition to be the myriad. The meridian is much more complicated than the others. Because the cost function has a finite number of local minima (input samples), multiple roots can be found through the derivative polynomial of the cost function ***. On the other hand, the meridian is one of the local minima of the cost function, so the meridian is one of the input samples. By evaluating the cost of every input sample, the meridian can be obtained.

* Kalluri, Sudhakar, and Gonzalo R. Arce. "Fast algorithms for weighted myriad computation by fixed-point search." Signal Processing, IEEE Transactions on 48.1 (2000): 159-171.
** ANSI C implementation of median search algorithms: http://ndevilla.free.fr/median/median.pdf
*** Aysal, Tuncer C., and Kenneth E. Barner. "Meridian filtering for robust signal processing." Signal Processing, IEEE Transactions on 55.8 (2007): 3949-3962.

Tuesday, March 4, 2014

ExifTool doesn't support DICOM writie!

ExifTool doesn't support DICOM writie. Therefore, exifTool in perl cannot write DICOM, and neither doescommand-line ExifTool.

The supported file types can be found here:
http://www.sno.phy.queensu.ca/~phil/exiftool/index.html

C/C++ DICOM tag edit sample codes can be found here:
http://devsample.org/index.php?option=com_content&task=view&id=45&Itemid=29
It requires dcmtk.

Sunday, February 23, 2014

Mint cond Lenovo USB 2.0 Super Multi-Burner Drive with LightScribe

I am selling MINT condition Lenovo USB 2.0 Super Multi-Burner Drive with LightScribe which came with Thinkpad x200. Since I bought it in 2010, I have rarely used. Even more, it is almost perfect cosmetically. Note that it was manufactured on December 24, 2009.

Part number: 41N5629
FRU number: 41N5630

Maximum write speed: 8x DVD 24x CD
Maximum rewrite speed: 8x DVD 24x CD
Maximum read speed: 8x DVD 24x CD
Media support: CD, Double-layer - DVD-RAM/R/RW

See the following picture for details of supported media.



I think that it is the same as the following model:
http://support.lenovo.com/en_US/product-and-parts/detail.page?&LegacyDocID=MIGR-67278

I tested its functionality for MS Windows and Apple OSX Mavericks and no problem was found. See the following pictures for details.

I put it into my Windows desktop. You can see green light on the top.

You can see the information about the burner, and is said that the device is working properly.

I tested with DVD-R to make sure that it is working.


4.38 GB DVD showed up in my Windows Explorer.

After formatting, it said 4.37 GB is free to write.

To check if it is working okay, I put two test data which are used to develop video decoders.
I tested it with my Macbook run by Mavericks. So, I am sure this one is working okay not only Windows 7 but also OSX Mavericks.

You can see the part number and FRU number on the back of the burner.

You can see what kind of media it supports on the front side of the burner. It supports CD, CD-RW, DVD, DVD-RW, and so on. You can find the media types in the link above. 

It came with a short USB cable. However, it fits in the pocket which came with the burner.


I tested the wall charger which came with the burner. It is working perfectly.

The charger looks like the photo above.

The pocket can hold the burner and the USB cable.

I am packing now with the original package.

I am packing for the USB cable and the wall charger.

It came with a couple of documents, but I don't think I read it. This one looks like an instruction for safety.

It looks like a manual.

It looks like another safety instruction.

I am not sure what important information I need to know for this burner. :D

It came with a device driver CD. But I've never used it. Default windows and OSX device drivers have been working okay.

I am putting the test DVD together, so that you can see. If you want, you can use this DVD-R. You can put more data or you might want to format it.

I put the burner at bottom.

I put the disks and document on top.

Above them, I put the wall charger and the USB cable.

I put the charger and cable into the pocket for safe delivery.

Thank you for watching! Happy shopping!

Tuesday, January 14, 2014

Sample size for Central Limit Theorem

The general rule in using central limit theorem is based on the sample size which is greater or equal to 30. However, the sample size would need to be greater than 30 or even smaller sample size would be enough to apply the central limit theorem. For instance, if a population distribution was bell-shaped, the distribution of sample means would become normal even with small sample size. On the other hand, in the case where the distribution is extremely skewed or has more than one mode, more samples may be required to obtain the normality of the distribution of sample means. For small samples size which is less than 30, a t-distribution can be assumed for the distribution of the sample means, if the population is normal. Note that the t-distribution approaches the normal distribution, as the number of degrees of freedom grows. Because of the fatter tails of the t-distribution, it assumes more outliers in the distribution.

http://ijims.ms.tku.edu.tw/PDF/M17N33.pdf
http://people.virginia.edu/~rwm3n/pdf/When%20do%20you%20use%20the%20t%20distribution.pdf
http://statistics.ucla.edu/system/resources/BAhbBlsHOgZmSSJVMjAxMi8wNS8zMC8xNV8zMV80Ml82MzFfUm9idXN0X1N0YXRpc3RpY2FsX01vZGVsaW5nX1VzaW5nX3RoZV90X0Rpc3RyaWJ1dGlvbi5wZGYGOgZFVA/Robust%20Statistical%20Modeling%20Using%20the%20t-%20Distribution.pdf

http://www.talkstats.com/showthread.php/24275-I-am-not-sure-how-Central-Limit-Theorem-and-the-t-distribution-fit-together.

http://www.stat.wisc.edu/~st571-1/07-normal-4.pdf

Blog Archive