login to mysql as root
mysql -uroot -p
then in mysql ran
create database mydatabase;
and give access to your user
grant all on mydatabase.* to myuser@localhost identified by "password";
of course if you already have a user, then you can just do:
grant all on mydatabase.* to myuser@localhost;
Thursday, September 20, 2007
Securing ssh access
When you create a new user like:
adduser myuser
You will end up with myuser having access to SSH. If you do not want that to happen, clear it up by doing this.
sudo vi /etc/ssh/sshd_config
You then have two options, either add:
AllowUsers mymainuser1 mymainuser2
or
DenyUsers myuser
After that restart ssh
sudo /etc/init.d/ssh restart
adduser myuser
You will end up with myuser having access to SSH. If you do not want that to happen, clear it up by doing this.
sudo vi /etc/ssh/sshd_config
You then have two options, either add:
AllowUsers mymainuser1 mymainuser2
or
DenyUsers myuser
After that restart ssh
sudo /etc/init.d/ssh restart
Friday, September 7, 2007
Hosting in Singapore to serve Jakarta
so to continue earlier test, I am going to hit the server in Singapore from Jakarta and from a server in US (in LA I think). We are getting a static file, about 150kB. Webserver is lighttpd/1.4.17.
From Jakarta:
Document Path: /4e47650f7bb99590ac5c20981e2bb56b/HAI160707-L-C1.jpg
Document Length: 157579 bytes
Concurrency Level: 1
Time taken for tests: 115.725180 seconds
Complete requests: 5
Failed requests: 0
Write errors: 0
Total transferred: 789090 bytes
HTML transferred: 787895 bytes
Requests per second: 0.04 [#/sec] (mean)
Time per request: 23145.036 [ms] (mean)
Time per request: 23145.036 [ms] (mean, across all concurrent requests)
Transfer rate: 6.65 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 24 161 129.6 219 316
Processing: 20960 22983 1305.9 23649 24215
Waiting: 25 100 100.6 108 230
Total: 20988 23144 1379.0 23819 24434
Percentage of the requests served within a certain time (ms)
50% 23545
66% 24093
75% 24093
80% 24434
90% 24434
95% 24434
98% 24434
99% 24434
100% 24434 (longest request)
Notice the transfer rate of only 6.65 kBps. Sad...
Now hitting the same resource from US:
Document Path: /4e47650f7bb99590ac5c20981e2bb56b/HAI160707-L-C1.jpg
Document Length: 157579 bytes
Concurrency Level: 1
Time taken for tests: 9.299231 seconds
Complete requests: 5
Failed requests: 0
Write errors: 0
Total transferred: 789090 bytes
HTML transferred: 787895 bytes
Requests per second: 0.54 [#/sec] (mean)
Time per request: 1859.846 [ms] (mean)
Time per request: 1859.846 [ms] (mean, across all concurrent requests)
Transfer rate: 82.80 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.5 0 1
Processing: 1794 1859 80.0 1872 1957
Waiting: 383 404 22.2 410 430
Total: 1795 1859 79.8 1872 1957
Percentage of the requests served within a certain time (ms)
50% 1809
66% 1935
75% 1935
80% 1957
90% 1957
95% 1957
98% 1957
99% 1957
100% 1957 (longest request)
Notice how much bigger the transfer rate is at 82 kBps. Basically, between US and Singapore is 10x faster than between Singapore and Jakarta. Unbelievable.
From Jakarta:
Document Path: /4e47650f7bb99590ac5c20981e2bb56b/HAI160707-L-C1.jpg
Document Length: 157579 bytes
Concurrency Level: 1
Time taken for tests: 115.725180 seconds
Complete requests: 5
Failed requests: 0
Write errors: 0
Total transferred: 789090 bytes
HTML transferred: 787895 bytes
Requests per second: 0.04 [#/sec] (mean)
Time per request: 23145.036 [ms] (mean)
Time per request: 23145.036 [ms] (mean, across all concurrent requests)
Transfer rate: 6.65 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 24 161 129.6 219 316
Processing: 20960 22983 1305.9 23649 24215
Waiting: 25 100 100.6 108 230
Total: 20988 23144 1379.0 23819 24434
Percentage of the requests served within a certain time (ms)
50% 23545
66% 24093
75% 24093
80% 24434
90% 24434
95% 24434
98% 24434
99% 24434
100% 24434 (longest request)
Notice the transfer rate of only 6.65 kBps. Sad...
Now hitting the same resource from US:
Document Path: /4e47650f7bb99590ac5c20981e2bb56b/HAI160707-L-C1.jpg
Document Length: 157579 bytes
Concurrency Level: 1
Time taken for tests: 9.299231 seconds
Complete requests: 5
Failed requests: 0
Write errors: 0
Total transferred: 789090 bytes
HTML transferred: 787895 bytes
Requests per second: 0.54 [#/sec] (mean)
Time per request: 1859.846 [ms] (mean)
Time per request: 1859.846 [ms] (mean, across all concurrent requests)
Transfer rate: 82.80 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.5 0 1
Processing: 1794 1859 80.0 1872 1957
Waiting: 383 404 22.2 410 430
Total: 1795 1859 79.8 1872 1957
Percentage of the requests served within a certain time (ms)
50% 1809
66% 1935
75% 1935
80% 1957
90% 1957
95% 1957
98% 1957
99% 1957
100% 1957 (longest request)
Notice how much bigger the transfer rate is at 82 kBps. Basically, between US and Singapore is 10x faster than between Singapore and Jakarta. Unbelievable.
Singapore Host fast enough for Indonesia?
Apparently not.
A good friend scored a VPS account in Indonesia so I can run some test.
From Indonesia to get resource in U.S. (mediatemple VPS)
Document Path: /POP0107-T.jpg
Document Length: 10648 bytes
Concurrency Level: 1
Time taken for tests: 111.340135 seconds
Complete requests: 20
Failed requests: 0
Write errors: 0
Total transferred: 217680 bytes
HTML transferred: 212960 bytes
Requests per second: 0.18 [#/sec] (mean)
Time per request: 5567.007 [ms] (mean)
Time per request: 5567.007 [ms] (mean, across all concurrent requests)
Transfer rate: 1.90 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 214 1085 2172.0 769 10216
Processing: 1500 4481 3309.3 3289 14195
Waiting: 194 464 282.8 440 1259
Total: 1779 5566 3679.1 5148 14984
Percentage of the requests served within a certain time (ms)
50% 5148
66% 6147
75% 7936
80% 8097
90% 12155
95% 14984
98% 14984
99% 14984
100% 14984 (longest request)
From Indonesia to get resource in Singapore (xssist VPS)
Document Path: /POP0107-T.jpg
Document Length: 10648 bytes
Concurrency Level: 1
Time taken for tests: 43.184310 seconds
Complete requests: 20
Failed requests: 0
Write errors: 0
Total transferred: 217700 bytes
HTML transferred: 212960 bytes
Requests per second: 0.46 [#/sec] (mean)
Time per request: 2159.216 [ms] (mean)
Time per request: 2159.216 [ms] (mean, across all concurrent requests)
Transfer rate: 4.91 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 18 310 241.6 329 889
Processing: 1169 1848 746.6 1650 4728
Waiting: 21 131 202.6 23 779
Total: 1369 2158 831.9 1999 5018
Percentage of the requests served within a certain time (ms)
50% 1999
66% 2219
75% 2509
80% 2599
90% 3208
95% 5018
98% 5018
99% 5018
100% 5018 (longest request)
Obviously moving server to Singapore helps a lot (cut down lag time by 50%) except that it still take 2 seconds to transfer 10kB, which is insanely slow.
A good friend scored a VPS account in Indonesia so I can run some test.
From Indonesia to get resource in U.S. (mediatemple VPS)
Document Path: /POP0107-T.jpg
Document Length: 10648 bytes
Concurrency Level: 1
Time taken for tests: 111.340135 seconds
Complete requests: 20
Failed requests: 0
Write errors: 0
Total transferred: 217680 bytes
HTML transferred: 212960 bytes
Requests per second: 0.18 [#/sec] (mean)
Time per request: 5567.007 [ms] (mean)
Time per request: 5567.007 [ms] (mean, across all concurrent requests)
Transfer rate: 1.90 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 214 1085 2172.0 769 10216
Processing: 1500 4481 3309.3 3289 14195
Waiting: 194 464 282.8 440 1259
Total: 1779 5566 3679.1 5148 14984
Percentage of the requests served within a certain time (ms)
50% 5148
66% 6147
75% 7936
80% 8097
90% 12155
95% 14984
98% 14984
99% 14984
100% 14984 (longest request)
From Indonesia to get resource in Singapore (xssist VPS)
Document Path: /POP0107-T.jpg
Document Length: 10648 bytes
Concurrency Level: 1
Time taken for tests: 43.184310 seconds
Complete requests: 20
Failed requests: 0
Write errors: 0
Total transferred: 217700 bytes
HTML transferred: 212960 bytes
Requests per second: 0.46 [#/sec] (mean)
Time per request: 2159.216 [ms] (mean)
Time per request: 2159.216 [ms] (mean, across all concurrent requests)
Transfer rate: 4.91 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 18 310 241.6 329 889
Processing: 1169 1848 746.6 1650 4728
Waiting: 21 131 202.6 23 779
Total: 1369 2158 831.9 1999 5018
Percentage of the requests served within a certain time (ms)
50% 1999
66% 2219
75% 2509
80% 2599
90% 3208
95% 5018
98% 5018
99% 5018
100% 5018 (longest request)
Obviously moving server to Singapore helps a lot (cut down lag time by 50%) except that it still take 2 seconds to transfer 10kB, which is insanely slow.
Monday, September 3, 2007
Setting up ImageMagick
Copied from
http://blog.wishlisting.com/?p=20
1. Install the libjpeg source (you may get errors copying man pages - ignore them I guess)
wget http://www.ijg.org/files/jpegsrc.v6b.tar.gz
tar -xzvf jpegsrc.v6b.tar.gz
cd jpeg-6b/
./configure --enable-shared
make
make test
make install
2. Install the libpng source
wget http://easynews.dl.sourceforge.net/sourceforge/libpng/libpng-1.2.16.tar.bz2
tar -xvjf libpng-1.2.16.tar.bz2
./configure
make
make check
make install
3. Install the freetype source
wget http://superb-west.dl.sourceforge.net/sourceforge/freetype/freetype-2.3.2.tar.bz2
tar -xjvf freetype-2.3.2.tar.bz2
cd freetype-2.3.2
make
make install
4. Install the Ghostscript source
wget http://umn.dl.sourceforge.net/sourceforge/ghostscript/ghostscript-8.54-gpl.tar.bz2
tar xjvf ghostscript-8.54-gpl.tar.bz2
cd ghostscript-8.54-gpl
./configure
make
make install
5. Install the Ghostscript fonts (thanks Hung)
wget http://internap.dl.sourceforge.net/sourceforge/gs-fonts/ghostscript-fonts-std-8.11.tar.gz
tar -xvzf ghostscript-fonts-std-8.11.tar.gz
cp -rv fonts /usr/local/share/ghostscript/
6. Install ImageMagick
wget ftp://ftp.fifi.org/pub/ImageMagick/ImageMagick-6.3.2-9.tar.bz2
tar -xjvf ImageMagick-6.3.2-9.tar.bz2
cd ImageMagick-6.3.2
./configure
make
make check
make install
http://blog.wishlisting.com/?p=20
1. Install the libjpeg source (you may get errors copying man pages - ignore them I guess)
wget http://www.ijg.org/files/jpegsrc.v6b.tar.gz
tar -xzvf jpegsrc.v6b.tar.gz
cd jpeg-6b/
./configure --enable-shared
make
make test
make install
2. Install the libpng source
wget http://easynews.dl.sourceforge.net/sourceforge/libpng/libpng-1.2.16.tar.bz2
tar -xvjf libpng-1.2.16.tar.bz2
./configure
make
make check
make install
3. Install the freetype source
wget http://superb-west.dl.sourceforge.net/sourceforge/freetype/freetype-2.3.2.tar.bz2
tar -xjvf freetype-2.3.2.tar.bz2
cd freetype-2.3.2
make
make install
4. Install the Ghostscript source
wget http://umn.dl.sourceforge.net/sourceforge/ghostscript/ghostscript-8.54-gpl.tar.bz2
tar xjvf ghostscript-8.54-gpl.tar.bz2
cd ghostscript-8.54-gpl
./configure
make
make install
5. Install the Ghostscript fonts (thanks Hung)
wget http://internap.dl.sourceforge.net/sourceforge/gs-fonts/ghostscript-fonts-std-8.11.tar.gz
tar -xvzf ghostscript-fonts-std-8.11.tar.gz
cp -rv fonts /usr/local/share/ghostscript/
6. Install ImageMagick
wget ftp://ftp.fifi.org/pub/ImageMagick/ImageMagick-6.3.2-9.tar.bz2
tar -xjvf ImageMagick-6.3.2-9.tar.bz2
cd ImageMagick-6.3.2
./configure
make
make check
make install
Subscribe to:
Posts (Atom)