Thursday, March 27, 2014

fix 32-bit application default 2GB limitation

ref: http://www.jvadillo.com/software/3gbproblem.html

http://www.dansdata.com/askdan00015.htm


Improving Windows XP memory management for large amounts of data
As mentioned in the Microsoft Help & Support page, there is a boot option called /3GB that reduces the amount of memory reseved to the system to the last 1GB, leaving 3 GB for user applications instead of 2GB.
Two actions have to be taken in order to have an application that can access more than 2GB of RAM:
1. Change your Windows XP boot.ini file to have the /3GB flag active. To do so open the C:\boot.ini file in a text editor:
[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional 3GB " /fastdetect /3GB
2. Change your executable application header activating the LARGEADDRESSAWARE flag.
This flag can be activated using a Visual Studio application called EDITBIN.EXE.To do so, just call the tool as follows:
editbin /LARGEADDRESSAWARE name_of_the_executable.exe
This action modifies the following fields of the PE header structure:
  • IMAGE_FILE_HEADER.Characteristics: IMAGE_FILE_LARGE_ADDRESS_AWARE bit (0x0020) set.
  • IMAGE_OPTIONAL_HEADER32 CheckSum is recomputed taking into account the modified field.

Sunday, March 2, 2014

SFTP jail


summary:

In /etc/ssh/sshd_config :

You need to configure OpenSSH to use its internal SFTP subsystem.
Subsystem sftp internal-sftp
Then, I configured chroot()ing in a match rule.
Match User ftpuser
         ChrootDirectory /var/www/html
         X11Forwarding no
         AllowTcpForwarding no
         ForceCommand internal-sftp



create user

useradd ftpuser -g apache
chown root:root /var/www/html
usermod -d / ftpuser


detail : http://www.debian-administration.org/articles/590