tag:blogger.com,1999:blog-18597347237070658272024-03-22T03:15:46.464+08:00XP-rienceSomething that I'd like to share with you!leorickhttp://www.blogger.com/profile/12860324908477273661noreply@blogger.comBlogger51125tag:blogger.com,1999:blog-1859734723707065827.post-60545056983441783262023-07-09T21:06:00.000+08:002023-07-09T21:06:48.240+08:00SSH private key authentication with WinSCP and PuTTY Gen<div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEjZ6U74QbyE03h1gTd3703oNyWHTtweMHK0o0UxQJu5V-LFdH6yzpjYQMQuum5g_H0kzYu4-hBzycOK7xMGJc_nvxvnFlyaU8IgSUpV57tEQb_-GGQS3LiCZBe8lN0wcsnQZPJ_DRUK3wk88uZjJddFg-smWCvQOJBWRRWpn5scNFPP7fa4EqbX3vMfAfGS" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="176" data-original-width="131" src="https://blogger.googleusercontent.com/img/a/AVvXsEjZ6U74QbyE03h1gTd3703oNyWHTtweMHK0o0UxQJu5V-LFdH6yzpjYQMQuum5g_H0kzYu4-hBzycOK7xMGJc_nvxvnFlyaU8IgSUpV57tEQb_-GGQS3LiCZBe8lN0wcsnQZPJ_DRUK3wk88uZjJddFg-smWCvQOJBWRRWpn5scNFPP7fa4EqbX3vMfAfGS=s16000" /></a></div><br />Simplify your login process by using SSH keys for authentication when you are connecting to your server.</div><div><br /></div><div>1st step is to run the PuTTYGen software and generate a key.</div><div><br /></div><div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEhinuSo4J2U-JaJCGC8tfd1uTex3L6iVuBdm5Ukdc-_cnNETvjqm2xxFxgiYoXBI-5M6WmtlyKWrBja_NgytXl_1Zo1HTfH5AUBKtftv74dnv4-JypNlxq7_eXbzAOoaunZJicgWwy8idPlsM8YqJgmuSM5r_7ldmMidO8xuxlWHJuPfEmk2xuJoK-IKKFN" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="601" data-original-width="816" height="295" src="https://blogger.googleusercontent.com/img/a/AVvXsEhinuSo4J2U-JaJCGC8tfd1uTex3L6iVuBdm5Ukdc-_cnNETvjqm2xxFxgiYoXBI-5M6WmtlyKWrBja_NgytXl_1Zo1HTfH5AUBKtftv74dnv4-JypNlxq7_eXbzAOoaunZJicgWwy8idPlsM8YqJgmuSM5r_7ldmMidO8xuxlWHJuPfEmk2xuJoK-IKKFN=w400-h295" width="400" /></a></div><br />Save the private key to a file.</div><div>Next, login into you server through SSH and create "~/.ssh" directory if it doesn't exists.</div><div>chmod the directory to 700.</div><div><pre>[applmgr@vm-centos7 ~]$ cd ~
[applmgr@vm-centos7 ~]$ mkdir -p .ssh
[applmgr@vm-centos7 ~]$ chmod 700 .ssh
[applmgr@vm-centos7 ~]$ ls -al
total 12
drwx------. 6 applmgr applmgr 119 Jul 9 20:27 .
drwxr-xr-x. 4 root root 36 Jul 9 20:05 ..
-rw-r--r--. 1 applmgr applmgr 18 Oct 31 2018 .bash_logout
-rw-r--r--. 1 applmgr applmgr 193 Oct 31 2018 .bash_profile
-rw-r--r--. 1 applmgr applmgr 231 Oct 31 2018 .bashrc
drwxrwxr-x. 3 applmgr applmgr 18 Jul 9 20:06 .cache
drwxrwxr-x. 3 applmgr applmgr 18 Jul 9 20:06 .config
drwxr-xr-x. 4 applmgr applmgr 39 Jul 4 19:01 .mozilla
drwx------. 2 applmgr applmgr 6 Jul 9 20:27 .ssh</pre></div><div>Create "authorized_keys" if it doesn't exists.</div><div>chmod it to 600 and edit the file, in my example, using "vi"</div><div><pre>[applmgr@vm-centos7 ~]$ cd .ssh/
[applmgr@vm-centos7 .ssh]$ touch authorized_keys
[applmgr@vm-centos7 .ssh]$ chmod 600 authorized_keys
[applmgr@vm-centos7 .ssh]$ vi authorized_keys
</pre></div><div><br /></div><div>Copy and paste (or add new line) the content of the public key into this file.</div><div><br /></div><div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEgD7SA7yuLbPLvwqrv3G-1PkgGdvPXuhKAunwl2caWFzzhcAbzgJgrzZ9_M5yuUM6KH7r2zqDQ_kI93GlCsUwtRSH0SsNguVKEbW4-eHz_-NF_2NNrrRzbmquzqPEuvoCA0VN0Mo82zpYVWLaVKy9z1bWk8V87t2P3AqLE8YWnxyRf4YPH6Q1gt0jeMhW22" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="232" data-original-width="961" height="96" src="https://blogger.googleusercontent.com/img/a/AVvXsEgD7SA7yuLbPLvwqrv3G-1PkgGdvPXuhKAunwl2caWFzzhcAbzgJgrzZ9_M5yuUM6KH7r2zqDQ_kI93GlCsUwtRSH0SsNguVKEbW4-eHz_-NF_2NNrrRzbmquzqPEuvoCA0VN0Mo82zpYVWLaVKy9z1bWk8V87t2P3AqLE8YWnxyRf4YPH6Q1gt0jeMhW22=w400-h96" width="400" /></a></div><br />Save the file and now run your WinSCP, enter hostname, username and click "Advanced ..."</div><div><br /></div><div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEjOtnbtzVVUPdRuh0Tbz2wAChZfu-xOcCPejX-e4f8dsyYVviP5zuzluTgZmk7suWnZu--SlKvJr_SNJdIZKjY-CElPBpNTRrQ3mv6SM5LL6EiqA2KhJC5nLznK8dqxuACpwxXaOU6N78DH1okhqHZ9bclepF_UHuHsj0Dxj41VWoItY2j9Jc9aYMmszHgk" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="254" data-original-width="635" height="160" src="https://blogger.googleusercontent.com/img/a/AVvXsEjOtnbtzVVUPdRuh0Tbz2wAChZfu-xOcCPejX-e4f8dsyYVviP5zuzluTgZmk7suWnZu--SlKvJr_SNJdIZKjY-CElPBpNTRrQ3mv6SM5LL6EiqA2KhJC5nLznK8dqxuACpwxXaOU6N78DH1okhqHZ9bclepF_UHuHsj0Dxj41VWoItY2j9Jc9aYMmszHgk=w400-h160" width="400" /></a></div><br />Under "SSH" > "Authentication", check the "Allow agent forwarding", and select the privates key file that you've saved just now.</div><div><br /></div><div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEgG154rjndg55O6HyRkZ07YwDlU_g8TjRxPiP3gJaMRjbpVURdICklzKhqVBaK8Vm3Wh-dcu4dPyUGbRtXcth8wzrKeTOt9DNw_q38axwEo7guhD5dNNl4yTMiMoGhC18BAjz0WQQTT5ER_6ZbZtFu9CppR7tu1Yqgrnr5MZad89hm46xVvNVK3mWkP3wJx" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="339" data-original-width="569" height="239" src="https://blogger.googleusercontent.com/img/a/AVvXsEgG154rjndg55O6HyRkZ07YwDlU_g8TjRxPiP3gJaMRjbpVURdICklzKhqVBaK8Vm3Wh-dcu4dPyUGbRtXcth8wzrKeTOt9DNw_q38axwEo7guhD5dNNl4yTMiMoGhC18BAjz0WQQTT5ER_6ZbZtFu9CppR7tu1Yqgrnr5MZad89hm46xVvNVK3mWkP3wJx=w400-h239" width="400" /></a></div><br />And "login".</div><div><br /></div><div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEg2QDlGu2DQsocq1kgf33wZhnLwFmW5F86p9FB2WEBBBAqq04Uv0Z-oc71HHglZKRpoUdKu32jtYIQhDePE5C673i04KOrXpI7oxoBgtO48BGMBEZsR7VmGZxQAO54yDd-CTPA7O8JVvDz4jzZUdn0dbCcgFzyClBCp5ad2cJZksrWZFmdybRHhxiBRKQQJ" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="382" data-original-width="546" height="224" src="https://blogger.googleusercontent.com/img/a/AVvXsEg2QDlGu2DQsocq1kgf33wZhnLwFmW5F86p9FB2WEBBBAqq04Uv0Z-oc71HHglZKRpoUdKu32jtYIQhDePE5C673i04KOrXpI7oxoBgtO48BGMBEZsR7VmGZxQAO54yDd-CTPA7O8JVvDz4jzZUdn0dbCcgFzyClBCp5ad2cJZksrWZFmdybRHhxiBRKQQJ" width="320" /></a></div><br /><br /></div><div><br /></div>leorickhttp://www.blogger.com/profile/12860324908477273661noreply@blogger.com0tag:blogger.com,1999:blog-1859734723707065827.post-47127848286835483592023-04-02T10:48:00.007+08:002023-07-09T14:22:03.680+08:00PostgreSQL installation & connecting it to to Oracle SQL Developer/HeidiSQL<style>
pre {padding:10px;border:1px solid #444;background-color:#444;color:#fff;overflow-x:scroll;overflow:auto;}
</style>
<p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLgoS7mxJs2MAfuczUbnDFw2UmIJX0t8ITniAZNEdp41fPDRzLSGAYRPLYbZNphJhOjgGiI_9B6zY59B_8Zb7vTqeW-_QKkpJ8QYvhjVzBcGviwWio4iOSqlDIQIm_iXwaXUi371XtCZJOMTM1uxMo90UzHBotpDimpW9h2NUsQ3o0O1hPUxyI7-OZVA/s600/PostgreSQL600x340.webp" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="340" data-original-width="600" height="181" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLgoS7mxJs2MAfuczUbnDFw2UmIJX0t8ITniAZNEdp41fPDRzLSGAYRPLYbZNphJhOjgGiI_9B6zY59B_8Zb7vTqeW-_QKkpJ8QYvhjVzBcGviwWio4iOSqlDIQIm_iXwaXUi371XtCZJOMTM1uxMo90UzHBotpDimpW9h2NUsQ3o0O1hPUxyI7-OZVA/s320/PostgreSQL600x340.webp" width="320" /></a></div>Install PostgreSQL DB, in my example here, installing it under Ubuntu by referring to below URL.<p></p><p><a href="https://www.digitalocean.com/community/tutorials/how-to-install-and-use-postgresql-on-ubuntu-20-04">https://www.digitalocean.com/community/tutorials/how-to-install-and-use-postgresql-on-ubuntu-20-04</a></p>
<p>Login to your shell and execute below command lines.</p>
<pre><code>$ sudo apt update</code></pre>
<pre><code>$ sudo apt install postgresql postgresql-contrib
</code></pre>
<p>Now enable remote access to your PostgreSQL by editing 2 files under "/etc/postgresql/12/main/".</p><p><a href="https://support.cpanel.net/hc/en-us/articles/4419265023383-How-to-enable-remote-PostgreSQL-access">https://support.cpanel.net/hc/en-us/articles/4419265023383-How-to-enable-remote-PostgreSQL-access</a><br /></p><p>Note that "12" is the version number. Change it according to the installed version number.</p>
<p>Edit "postgresql.conf" file and add...</p>
<pre><code>listen_addresses = '*'</code></pre>
<p>Edit "pg_hba.conf" file and add...</p>
<pre><code>host all all 0.0.0.0/0 md5
</code></pre>
<p>Now start your PostgreSQL DB using "systemsql" command.</p>
<pre><code>$ sudo systemctl start postgresql</code></pre><p>Before you can connect to the PostgreSQL , you need a user. Create PostgreSQL user "puser" with below command line.</p>
<pre><code>$ sudo -u postgres createuser --interactive</code></pre>
<p>And you also need a DB to start with. Create PostgreSQL DB named "pdbase" with below command line.</p>
<pre><code>$ sudo -u postgres createdb pdbase</code></pre>
<p>Create Linux user matching with the PostgreSQL user "puser".</p>
<pre><code>$ sudo adduser puser</code></pre>
<p>Switch user to "puser" and run "plsql" to login to the PostgreSQL DB.</p>
<pre><code>$sudo -u puser psql -d pdbase</code></pre>
<p>You should now get the "plsql" prompt as below indicating that you have successfully login to the your PostgreSQL DB.</p><pre><code>pdbase=#</code></pre><p>Use "\l" to list databases or use "\dt" to list tables, these is just to make sure the DB is running fine.</p><pre><code>pdbase=# \l</code></pre>
<p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRrRCk0hCdvAC7t60ZDHUzhoPMacSdXRJJa0m_cGcgbB4VmFNDXrQNx8k5eKWRPAfvtDusxFZ-X0jz5MSSf55ECmyHDuhuNtTiSqklM01QlCZ2uZ7sUsfVBCH74W-d3lEACBF6C05sE6o90z_iuC-T60oFbXbgDk6hsYEpdlwfeWHvn39srMY4wfl9VA/s867/list.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="222" data-original-width="867" height="82" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRrRCk0hCdvAC7t60ZDHUzhoPMacSdXRJJa0m_cGcgbB4VmFNDXrQNx8k5eKWRPAfvtDusxFZ-X0jz5MSSf55ECmyHDuhuNtTiSqklM01QlCZ2uZ7sUsfVBCH74W-d3lEACBF6C05sE6o90z_iuC-T60oFbXbgDk6hsYEpdlwfeWHvn39srMY4wfl9VA/s320/list.png" width="320" /></a></div>
<pre><code>pdbase=# \dt</code></pre><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpnn2j6S97ZkNDrW0OFZaZGGU2aFfMDkmUcR7okLyQR6WAA1fvm5jEgywBVykU28gHqnKJXlozEMImrLePh-ndugXl358_TOcFHGuyEY8yUV10KCoNSqjnzkd33b6RH03wS6DNtOVvZC374nL0QYxbty3M9AIsOlHmxF1UHoSzUYxvazmm3_MO-5Bssw/s326/dt.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="107" data-original-width="326" height="105" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpnn2j6S97ZkNDrW0OFZaZGGU2aFfMDkmUcR7okLyQR6WAA1fvm5jEgywBVykU28gHqnKJXlozEMImrLePh-ndugXl358_TOcFHGuyEY8yUV10KCoNSqjnzkd33b6RH03wS6DNtOVvZC374nL0QYxbty3M9AIsOlHmxF1UHoSzUYxvazmm3_MO-5Bssw/s320/dt.png" width="320" /></a></div><p></p><p>Now alter password for "puser", This password will be used to connect through remote connection such as Oracle SQL Developer or HeidlSQL.</p><pre><code>pdbase=# ALTER USER puser WITH PASSWORD 'mypass';</code></pre><h2 style="text-align: left;">Example connecting from SQL Developer</h2>
<p><a href="https://www.oracle.com/database/technologies/jdbc-migration.html">https://www.oracle.com/database/technologies/jdbc-migration.html</a></p><p>Please refer above URL to add JDBC driver to your SQL developer.</p><p>Fill up necessary info such as user/pass/host/port/db and hit Test/Connect.</p>
<p>
</p><div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/a/AVvXsEi7Yu0jGp-t9csBnQIwHonANPx3zb4zFhiOZtoAObcmWH9m_1eJKYPOblpFMi5m2eFL0e7MjLtt_FAYxlK4A2bryt1JJ5l1XLf8tAEE-o4Wbybd_tc5of2BOzid3mHmp2MZOnzlikap3rprcCYkbY3afbp2WVyKxqH2h-pYdLNlOzwtl2QbzJxMVgVg7w" style="margin-left: 1em; margin-right: 1em;">
<img alt="" data-original-height="360" data-original-width="577" height="200" src="https://blogger.googleusercontent.com/img/a/AVvXsEi7Yu0jGp-t9csBnQIwHonANPx3zb4zFhiOZtoAObcmWH9m_1eJKYPOblpFMi5m2eFL0e7MjLtt_FAYxlK4A2bryt1JJ5l1XLf8tAEE-o4Wbybd_tc5of2BOzid3mHmp2MZOnzlikap3rprcCYkbY3afbp2WVyKxqH2h-pYdLNlOzwtl2QbzJxMVgVg7w" width="320" />
</a>
</div>
<br /><h2 style="text-align: left;">Example connecting from HeidiSQL.</h2><div>Same goes to HeidiSQL, fill up necessary info such as user/pass/host/port/db and hit Open<br /><p>
</p><p>
</p><div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/a/AVvXsEhTnC4xL9uqYBJCTJFYZcJsWh6m9QVaaTr9ZM2EEt1lNuBsCdGQ2OXdK-AfQZTroara7VHUm9IYBVhhQvHZIGBQRBhoa8j3apzsNnpItQKB8kqaoHUQunUG8Jx1doWrW12IoCXPlWwcLiBCta5YYNNb9pMIphjYk91skb6WwEwgK226R2sAZVOqoUyG0g" style="margin-left: 1em; margin-right: 1em;">
<img alt="" data-original-height="442" data-original-width="727" height="244" src="https://blogger.googleusercontent.com/img/a/AVvXsEhTnC4xL9uqYBJCTJFYZcJsWh6m9QVaaTr9ZM2EEt1lNuBsCdGQ2OXdK-AfQZTroara7VHUm9IYBVhhQvHZIGBQRBhoa8j3apzsNnpItQKB8kqaoHUQunUG8Jx1doWrW12IoCXPlWwcLiBCta5YYNNb9pMIphjYk91skb6WwEwgK226R2sAZVOqoUyG0g=w400-h244" width="400" />
</a>
</div>
<br />
<br />
<p></p><p></p><p></p><p></p></div>leorickhttp://www.blogger.com/profile/12860324908477273661noreply@blogger.com0tag:blogger.com,1999:blog-1859734723707065827.post-77186003170411486792022-07-30T20:11:00.001+08:002022-07-30T20:11:09.387+08:00Red Hat OpenShift port forwarding to access MySQL at port 3306 <p></p><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: center;"><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEjDCmK4FNJamfMaJc6yyp-Q1bZm6dTYZBMa3TsdYlyTdNjUjFTvDmYf76wx9iyQcFytwf_8Ny8e28qer1L5RgkQAjfJfBuN-Na6TaBUJDTRrw5WgTQgpk8ZBxurtTcEmaRYaWQSrCm3z7jnipoGSSWt9iu-RfmEhGJVx4YR2vUVxxRPfFCjlEKHlKzkTg" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="320" data-original-width="766" height="134" src="https://blogger.googleusercontent.com/img/a/AVvXsEjDCmK4FNJamfMaJc6yyp-Q1bZm6dTYZBMa3TsdYlyTdNjUjFTvDmYf76wx9iyQcFytwf_8Ny8e28qer1L5RgkQAjfJfBuN-Na6TaBUJDTRrw5WgTQgpk8ZBxurtTcEmaRYaWQSrCm3z7jnipoGSSWt9iu-RfmEhGJVx4YR2vUVxxRPfFCjlEKHlKzkTg" width="320" /></a></div><br /></div><div>Still continuing from my first <a href="https://xp-rience.blogspot.com/2022/07/how-to-connect-phpmyadmin-to-mariadb.html">post </a>about Red Hat OpenShift, here is how to do port forwarding from your locahost port 3306 to MySQL hosted under Red Hat OpenShift. This is to enable the connection to the MySQL using your favorite MySQL client. I'm using <a href="https://www.heidisql.com/">HeidiSQL</a>.</div><div><br /></div>1st, OC login to your environment by copying the "oc login" command.<p></p><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEjW0-QX76Q6sJ90ULfQx_buX_VKW2qDyhijGQrl8ncpW4_o-jixljnGOMS9i1pGvrjogGThMExDzQVHmBi0eQgMhVDwUyCcGf9m7jjc6Y3y68wys6301G4cjRbVoOZicm10-PPMQ9tNz6Qeb-8okp_Me32D9S4lLWTDyZfzJmb-LoZYJ30spqvP6heVCw" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="245" data-original-width="505" height="155" src="https://blogger.googleusercontent.com/img/a/AVvXsEjW0-QX76Q6sJ90ULfQx_buX_VKW2qDyhijGQrl8ncpW4_o-jixljnGOMS9i1pGvrjogGThMExDzQVHmBi0eQgMhVDwUyCcGf9m7jjc6Y3y68wys6301G4cjRbVoOZicm10-PPMQ9tNz6Qeb-8okp_Me32D9S4lLWTDyZfzJmb-LoZYJ30spqvP6heVCw" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div>Copy the token displayed.</div><div><br /></div><div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEjiq72tTU6KcQt0jOMMf4mxoMK4zbTTV53AXUVJkOwoTBK6Kn-ai2ZNG9S0q-TYQLN-KyLBljhHr2qU-F1EQmeyAnTqZwCYNtK22x2rQqRHdNxU9WzccPYn_Lpz-5UCqEWo0ZmN8AlSkBDJykhTwxU3p0jyc2s8EYdiuj2UrZIodC_XzXeiEXxgv-OvVA" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="169" data-original-width="1310" height="82" src="https://blogger.googleusercontent.com/img/a/AVvXsEjiq72tTU6KcQt0jOMMf4mxoMK4zbTTV53AXUVJkOwoTBK6Kn-ai2ZNG9S0q-TYQLN-KyLBljhHr2qU-F1EQmeyAnTqZwCYNtK22x2rQqRHdNxU9WzccPYn_Lpz-5UCqEWo0ZmN8AlSkBDJykhTwxU3p0jyc2s8EYdiuj2UrZIodC_XzXeiEXxgv-OvVA=w640-h82" width="640" /></a></div><br />Open CMD prompt and paste the copied token, assuming that you have already installed the OC tool (OpenShift CLI)</div><div><br /></div><div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEhDQirD9s9a0KKYJDOhJpQGuxZHX7MBejXLImVTxs6OqWKg_BuOQOlLgaEUfLG9-zPpaPcYqJYIsdWv_IA_AnyFe8s07p7T4Zean2LAspApEa9cv-smhUOD1wmu1gDo4ouLV_Stukzj0WKrVd3XIXds5wNdFipB1HekXz9YC-UU1esin7cPWoJmaSmw1Q" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="214" data-original-width="1106" height="124" src="https://blogger.googleusercontent.com/img/a/AVvXsEhDQirD9s9a0KKYJDOhJpQGuxZHX7MBejXLImVTxs6OqWKg_BuOQOlLgaEUfLG9-zPpaPcYqJYIsdWv_IA_AnyFe8s07p7T4Zean2LAspApEa9cv-smhUOD1wmu1gDo4ouLV_Stukzj0WKrVd3XIXds5wNdFipB1HekXz9YC-UU1esin7cPWoJmaSmw1Q=w640-h124" width="640" /></a></div><p><br /></p><p>Now, list available pods that you have there.</p><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEgGcOHAqFIwaLhR4MgzOYNl57GTSec2MIK7GHENm50DuA5MN-omofGp7VmeVRIqcRbfLJ-V4uD1heRXyY9VGw9vLTqvPINTfO0sb4MJL0v5f8NwVIVkuHEjj3J56vWfTSu5axcoW9JoTyS8F8J-qIM9OFDpNgK5iKx3bgQWwt6wxoL3tKs1gW0WiQJIhg" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="157" data-original-width="594" height="106" src="https://blogger.googleusercontent.com/img/a/AVvXsEgGcOHAqFIwaLhR4MgzOYNl57GTSec2MIK7GHENm50DuA5MN-omofGp7VmeVRIqcRbfLJ-V4uD1heRXyY9VGw9vLTqvPINTfO0sb4MJL0v5f8NwVIVkuHEjj3J56vWfTSu5axcoW9JoTyS8F8J-qIM9OFDpNgK5iKx3bgQWwt6wxoL3tKs1gW0WiQJIhg=w400-h106" width="400" /></a></div><br />RSH into you MySQL using "oc rsh <podname>" as below. You should get the shell prompt.<br /><p></p><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEgkjz2YtvLfeZrh0R2wiOmFWbSv-_5fJFpcTPEi0yY2cxTpe3g9u4PJXQJS19JX2z1MeZHp9EiKhmSkXzjUPOqXZAoTYsuu69-FEi8kR_lXTS4o-62XNs88XvPct6tMZnT9POUF7iYxxMkUUyjXmbixv9QWtQKLQ2PSYL7gWxkDHbRkKMTa5c-xZLJIFQ" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="122" data-original-width="500" height="78" src="https://blogger.googleusercontent.com/img/a/AVvXsEgkjz2YtvLfeZrh0R2wiOmFWbSv-_5fJFpcTPEi0yY2cxTpe3g9u4PJXQJS19JX2z1MeZHp9EiKhmSkXzjUPOqXZAoTYsuu69-FEi8kR_lXTS4o-62XNs88XvPct6tMZnT9POUF7iYxxMkUUyjXmbixv9QWtQKLQ2PSYL7gWxkDHbRkKMTa5c-xZLJIFQ" width="320" /></a></div><br />Get user/pass/host/port values from the environment variables using "env|grep <string>" command.</div><div><p></p><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEhbDjJDe7zBLTy7CUWKAds-vZgXotxWDrsDhca4UZXnIbF6OLTm1Rz282BAF2O1T2jDWUIcUHx9JnbNdzaFpoA11LUSRNJ4b99ByC3odBv1XbOaP46t1aQ_pUcVwJDQcFUttujN3uz2HctJs9RYUZEXorXMUzW9hvQ21bZfV_KuAdBISirz7J7IciD6-Q" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="226" data-original-width="425" height="170" src="https://blogger.googleusercontent.com/img/a/AVvXsEhbDjJDe7zBLTy7CUWKAds-vZgXotxWDrsDhca4UZXnIbF6OLTm1Rz282BAF2O1T2jDWUIcUHx9JnbNdzaFpoA11LUSRNJ4b99ByC3odBv1XbOaP46t1aQ_pUcVwJDQcFUttujN3uz2HctJs9RYUZEXorXMUzW9hvQ21bZfV_KuAdBISirz7J7IciD6-Q" width="320" /></a></div><div><br /></div><div><ul style="text-align: left;"><li>MYSQL_PASSWORD = ************</li><li>MYSQL_USER = userBUW</li><li>MYSQL_SERVICE_HOST = 172.30.117.29</li><li>MYSQL_SERVICE_PORT = 3306</li></ul></div><br /></div><div>Exit RSH with "exit" command and start "oc port-forward <podname> <port>" command as below.<p></p><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEjsPbnceQhFSidMgCpWGGYjM3RSGtw9bzyHlRWJR1a4JqJZubB9Xb77FmeTctdMd_3NxkPcrSXeutiKjT1fqfHp_LtJo4sDHSKA0nInWZ0q1CgGbPz90nhB0SFcqcXnLhH_OdRkXb8n3iZoOtRGeZYxDtTgpM6nk8z636-HzRi0i_4xm5BNdBuZC9srCw" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="231" data-original-width="607" height="153" src="https://blogger.googleusercontent.com/img/a/AVvXsEjsPbnceQhFSidMgCpWGGYjM3RSGtw9bzyHlRWJR1a4JqJZubB9Xb77FmeTctdMd_3NxkPcrSXeutiKjT1fqfHp_LtJo4sDHSKA0nInWZ0q1CgGbPz90nhB0SFcqcXnLhH_OdRkXb8n3iZoOtRGeZYxDtTgpM6nk8z636-HzRi0i_4xm5BNdBuZC9srCw=w400-h153" width="400" /></a></div><br />Output "Forwarding from .... > 3306" indicates that the port forwarding is currently active. </div><div><br /></div><div>Now, try to access the MySQL using you favorite client. Example below is using <a href="https://www.heidisql.com/">HeidiSQL</a>.</div><div><p></p><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEi910_TUhqEry74dQ8mAMPU0NMoxU7sKfYSiDXPLFXawTRAvFELpd_GuuZhyNyCAVewF06WhlTzt5-ulSghL0wTSlUwdIZF56yS2btR2eDiZuhVTCZN5CZdxdgTVLT-QSYZyM-xaXJBSZwR82lg6Ev2g930KDJRis7jkVTT6IxG664LGJCmGvFmaaZWYQ" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="384" data-original-width="777" height="316" src="https://blogger.googleusercontent.com/img/a/AVvXsEi910_TUhqEry74dQ8mAMPU0NMoxU7sKfYSiDXPLFXawTRAvFELpd_GuuZhyNyCAVewF06WhlTzt5-ulSghL0wTSlUwdIZF56yS2btR2eDiZuhVTCZN5CZdxdgTVLT-QSYZyM-xaXJBSZwR82lg6Ev2g930KDJRis7jkVTT6IxG664LGJCmGvFmaaZWYQ=w640-h316" width="640" /></a></div><div><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEgrrkFNEHlOn4JOm1Xune2iIHajpe2UqNpPCBe8iP-D5whctb8oVtT3oX9YRh9aNI7EyaHXVwixIV3aD5jAMfJfq8em0Bp8ldvpORXvrbbvsXKiSRih6DxWta0hiWdWolyXcmIrJBt8dTvZyEla89_A8Y8_C-1Udt9d4mSupZd45wXRulDhzlNJ2J3DFw" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="262" data-original-width="691" height="242" src="https://blogger.googleusercontent.com/img/a/AVvXsEgrrkFNEHlOn4JOm1Xune2iIHajpe2UqNpPCBe8iP-D5whctb8oVtT3oX9YRh9aNI7EyaHXVwixIV3aD5jAMfJfq8em0Bp8ldvpORXvrbbvsXKiSRih6DxWta0hiWdWolyXcmIrJBt8dTvZyEla89_A8Y8_C-1Udt9d4mSupZd45wXRulDhzlNJ2J3DFw=w640-h242" width="640" /></a></div><br /><br /><p></p></div>leorickhttp://www.blogger.com/profile/12860324908477273661noreply@blogger.com0tag:blogger.com,1999:blog-1859734723707065827.post-45687174084789650342022-07-28T21:12:00.003+08:002022-07-28T21:12:33.285+08:00Setting up Joomla 4 and MySQL under Red Hat OpenShift<p style="text-align: left;"></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEioj_GWHRxKQdIsY6Yq9LnyBmtg7nj-NvKTlfv6lKqAzaBC0RHG5KAFFrAS4FfRsY3NscQGLIsUiapIvH3fCutsTy8YpJhZqO1dji8oeBv-bEeNbRZXa6qJA5yMaKYsY64leLJPUrBBMDZi5gdeC6p7QLJwjUdcO41dbKgVK_Usis-3sI08bDCTTIqnSQ/s443/Untitled.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="275" data-original-width="443" height="398" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEioj_GWHRxKQdIsY6Yq9LnyBmtg7nj-NvKTlfv6lKqAzaBC0RHG5KAFFrAS4FfRsY3NscQGLIsUiapIvH3fCutsTy8YpJhZqO1dji8oeBv-bEeNbRZXa6qJA5yMaKYsY64leLJPUrBBMDZi5gdeC6p7QLJwjUdcO41dbKgVK_Usis-3sI08bDCTTIqnSQ/w640-h398/Untitled.png" width="640" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div><p></p><p style="text-align: left;">Continue from my first <a href="https://xp-rience.blogspot.com/2022/07/how-to-connect-phpmyadmin-to-mariadb.html">post </a>about Red Hat OpenShift, here is how to setup Joomla 4/PHP/MySQL under Red Hat OpenShift.</p><h2 style="text-align: left;">MySQL </h2><p>Start by adding MySQL from template.</p><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEh1dxdB0a8HJHnbsXuisKc9MCYol_ltHJLjkqOO15l2Vcrv3ZJ2utLey1luVR_CRjUKIlUQCu9NFFTkTqHEAtTsDjazlbUntKKWUwzGhe4f--S_2vv0GaemZvPUIkwQr2Rdq_OhB6HB1rYHpV3cqHxVz9jeaFMqrDexi6RxKniOmrydkZwjt2sTdV0e-Q" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="479" data-original-width="1414" height="216" src="https://blogger.googleusercontent.com/img/a/AVvXsEh1dxdB0a8HJHnbsXuisKc9MCYol_ltHJLjkqOO15l2Vcrv3ZJ2utLey1luVR_CRjUKIlUQCu9NFFTkTqHEAtTsDjazlbUntKKWUwzGhe4f--S_2vv0GaemZvPUIkwQr2Rdq_OhB6HB1rYHpV3cqHxVz9jeaFMqrDexi6RxKniOmrydkZwjt2sTdV0e-Q=w640-h216" width="640" /></a></div><br />Most of the fields will be auto generated. Note that the database name is "sampledb"<p></p><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEgADU7za2VWDhVMI8g_5HVvKRZVCU24feT_0jVC34ghP0rpkQkuKSVDFtl2p1-zm-ZWgdekPQO4Q-Rc-xieYzIT3MDrzZ7j_egk0tWtkJIWpmMNSkw1Q0_eoZiKyiGDS8Qp9B_yWUs6vONE2PbP6Eky4Ux5t3S4jEhDPpotpZnPLhKgKmlQfFiw4Z6bnw" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="780" data-original-width="1007" height="495" src="https://blogger.googleusercontent.com/img/a/AVvXsEgADU7za2VWDhVMI8g_5HVvKRZVCU24feT_0jVC34ghP0rpkQkuKSVDFtl2p1-zm-ZWgdekPQO4Q-Rc-xieYzIT3MDrzZ7j_egk0tWtkJIWpmMNSkw1Q0_eoZiKyiGDS8Qp9B_yWUs6vONE2PbP6Eky4Ux5t3S4jEhDPpotpZnPLhKgKmlQfFiw4Z6bnw=w640-h495" width="640" /></a></div><p></p><p>Continue and wait for the pod to up & ready</p><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEgm-igA1TGACe4SgjULA-oaA_yzvTqnleZ1526FNsQ7_Fgv8uFC92lya5XwN0SS11VVFXykXEKJoKJQ66zlaMQDolq4vbBchsNFCj4KMHz4M381JIcG2mkqiKyw4WpTd7KyeZGL-IOc571yHfbGWw8fSU8EklbvjTvvPiLmIp0RaFTep529sWWy1nvBrA" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="244" data-original-width="203" height="200" src="https://blogger.googleusercontent.com/img/a/AVvXsEgm-igA1TGACe4SgjULA-oaA_yzvTqnleZ1526FNsQ7_Fgv8uFC92lya5XwN0SS11VVFXykXEKJoKJQ66zlaMQDolq4vbBchsNFCj4KMHz4M381JIcG2mkqiKyw4WpTd7KyeZGL-IOc571yHfbGWw8fSU8EklbvjTvvPiLmIp0RaFTep529sWWy1nvBrA=w166-h200" width="166" /></a></div><br /><p>Get your OC login. List down available pods. RSH into your MySQL (running) pod and grep the environment variables for MYSQL_SERVICE_HOST, MYSQL_USER & MYSQL_PASSWORD</p><p>get IP address</p><p><span style="font-family: courier; font-size: medium;">C:\Users\USER>oc get pods</span></p><p><span style="font-family: courier; font-size: medium;">NAME READY STATUS RESTARTS AGE</span></p><p><span style="font-family: courier; font-size: medium;">mysql-1-deploy 0/1 Completed 0 110s</span></p><p><span style="font-family: courier; font-size: medium;">mysql-1-mrqtl 1/1 <span style="background-color: #fcff01;">Running</span> 0 107s</span></p><p><span style="font-family: courier; font-size: medium;">C:\Users\USER>oc rsh mysql-1-mrqtl</span></p><p><span style="font-family: courier; font-size: medium;">sh-4.4$ env | grep MYSQL_SERVICE_HOST</span></p><p><span style="font-family: courier; font-size: medium;">MYSQL_SERVICE_HOST=<span style="background-color: #fcff01;">172.30.117.29</span></span></p><p><span style="font-family: courier; font-size: medium;">sh-4.4$ env | grep USER</span></p><p><span style="font-family: courier; font-size: medium;">MYSQL_USER=<span style="background-color: #fcff01;">userBUW</span></span></p><p><span style="font-family: courier; font-size: medium;">sh-4.4$ env | grep PASSWORD</span></p><p><span style="font-family: courier;"><span style="background-color: #fcff01; font-size: medium;"></span></span></p><p><span style="font-family: courier; font-size: medium;">MYSQL_PASSWORD=<span style="background-color: #fcff01;">XxXxXxXxXxXx</span></span></p><h2 style="text-align: left;">PHP</h2><p>Now add PHP images from template.</p><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEi--GI0mBt_erZC_gXr5MlOAcH8nb4mVif-3uqd_wiDCPv94ecnaJjE0WoQbAMDSirFe4ykut0BSnv2RX7-p9NMVzD-NJJhh49DsTpripJIcMrwTl1qDAiwvGGJobkSMm7noT9eHG2cR4s6mS5JGtdplC5wgtEhUfdQFXAeP2IwXeLE8x0tqX5tMVmQnA" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="554" data-original-width="1643" height="216" src="https://blogger.googleusercontent.com/img/a/AVvXsEi--GI0mBt_erZC_gXr5MlOAcH8nb4mVif-3uqd_wiDCPv94ecnaJjE0WoQbAMDSirFe4ykut0BSnv2RX7-p9NMVzD-NJJhh49DsTpripJIcMrwTl1qDAiwvGGJobkSMm7noT9eHG2cR4s6mS5JGtdplC5wgtEhUfdQFXAeP2IwXeLE8x0tqX5tMVmQnA=w640-h216" width="640" /></a></div><br />Use joomla4 PHP files from Github repository below.<p></p><p><span><a href="https://github.com/ermihusni/joomla4">https://github.com/ermihusni/joomla4</a></span></p><p><span>Note that I've tried the actual Joomla repository but somehow failed. You may try if you want to.</span></p><p><span><a href="https://github.com/joomla">https://github.com/joomla</a></span></p><p><span></span></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEjHn3FrSTnlqPu4b52Z7Iirx2lqGY_ZGXFH3IyMmZ_G-6_rG5Z3oKzvlzaXIwNg_t--9vihHHTMj-KLnXhQH2UOJbPixHJM5vGNjKB88iuKrhlSFhyISqaqx9ZKXknVO0thYlOnuOVLmJ6XQ5QzVapELxuEnrmpufRcIOlgOS8UfSKhDIp3Eh9OOHpO0A" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="561" data-original-width="898" height="400" src="https://blogger.googleusercontent.com/img/a/AVvXsEjHn3FrSTnlqPu4b52Z7Iirx2lqGY_ZGXFH3IyMmZ_G-6_rG5Z3oKzvlzaXIwNg_t--9vihHHTMj-KLnXhQH2UOJbPixHJM5vGNjKB88iuKrhlSFhyISqaqx9ZKXknVO0thYlOnuOVLmJ6XQ5QzVapELxuEnrmpufRcIOlgOS8UfSKhDIp3Eh9OOHpO0A=w640-h400" width="640" /></a></div><div><br /></div>Wait for the PHP pod to up & ready, and then open the PHP page to start Joomla setup.<div><br /><div class="separator" style="clear: both; text-align: center;"><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEjwO-zR8YncTnYHbpPvTfXvI7NCpkDqOr9PbE2zK0SQ3Gmwr3ZrkqRaLSDu11GOP6SekCdHwFgrCOQqjRcGFSLTsAgVi09mha3AB4DmDxU0sTN4FMd33jBbRhepteV3VonSTKeFJkq_o20chN9aah7guLEZcLb2H5epAJ-9ND6qj03mWa42cXcILXIVUw" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="416" data-original-width="617" height="216" src="https://blogger.googleusercontent.com/img/a/AVvXsEjwO-zR8YncTnYHbpPvTfXvI7NCpkDqOr9PbE2zK0SQ3Gmwr3ZrkqRaLSDu11GOP6SekCdHwFgrCOQqjRcGFSLTsAgVi09mha3AB4DmDxU0sTN4FMd33jBbRhepteV3VonSTKeFJkq_o20chN9aah7guLEZcLb2H5epAJ-9ND6qj03mWa42cXcILXIVUw=w320-h216" width="320" /></a></div></div><p></p><h2 style="text-align: left;">Joomla</h2><p>Insert "sampledb" as database name, the one that we've got from MySQL setup before.</p><p>Set the hostname, username & password from the MySQL server environment variable RSH grep before.</p><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEiPdcTL8Sgm8bysKPYC18Z9sDZ3i0dS7wETumtdgqlblCCir-HlkPM5fqqZV8hXyLB9xySVHHy63EXlLrIzkqJGxxfw2GEXUAS_hkU73C5HGDXGdHAPnUlv3u4WrfH6fbjQWU9AuVLVpyEprrhuBcCt0iZ0n--raXiSDE5R3MJkZXbMae7E14e-UCCB7A" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="589" data-original-width="784" height="482" src="https://blogger.googleusercontent.com/img/a/AVvXsEiPdcTL8Sgm8bysKPYC18Z9sDZ3i0dS7wETumtdgqlblCCir-HlkPM5fqqZV8hXyLB9xySVHHy63EXlLrIzkqJGxxfw2GEXUAS_hkU73C5HGDXGdHAPnUlv3u4WrfH6fbjQWU9AuVLVpyEprrhuBcCt0iZ0n--raXiSDE5R3MJkZXbMae7E14e-UCCB7A=w640-h482" width="640" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div><p></p><p><span> Confirm as the website owner by deleting the autogenerated file named "_Joomla*".</span></p><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEhVOZHqh-eqCXQoPAQqvRs3h3abydClXlomps95nPE2j4ElDAyeS4ffzH09HCbpxqkbxzxJw1T3mtIs8lt9mLOgf3Mpg9i60yI_vIzaVP7-HuhgED8jgcWfC-b6Zt2EP12bhu1JgPL4TmgfLsSDYkPCYoNt0W7Pyw_AXUDeohnxgnC5nHdQPHyTAchcWQ" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="331" data-original-width="851" height="248" src="https://blogger.googleusercontent.com/img/a/AVvXsEhVOZHqh-eqCXQoPAQqvRs3h3abydClXlomps95nPE2j4ElDAyeS4ffzH09HCbpxqkbxzxJw1T3mtIs8lt9mLOgf3Mpg9i60yI_vIzaVP7-HuhgED8jgcWfC-b6Zt2EP12bhu1JgPL4TmgfLsSDYkPCYoNt0W7Pyw_AXUDeohnxgnC5nHdQPHyTAchcWQ=w640-h248" width="640" /></a></div><div><br /></div>RSH into the pod and delete it from the "installation" directory.<br /><p></p><p><span style="font-family: courier;">C:\Users\USER>oc get pods</span></p><p><span style="font-family: courier;">NAME READY STATUS RESTARTS AGE</span></p><p><span style="font-family: courier;">joomla-001-1-build 0/1 Completed 0 3m50s</span></p><p><span style="font-family: courier;">joomla-001-d9ff8c8b6-dwsgd 1/1 Running 0 2m35s</span></p><p><span style="font-family: courier;">mysql-1-deploy 0/1 Completed 0 13m</span></p><p><span style="font-family: courier;">mysql-1-mrqtl 1/1 Running 0 13m</span></p><p><span style="font-family: courier;"><br /></span></p><p><span style="font-family: courier;">C:\Users\USER>oc rsh joomla-001-d9ff8c8b6-dwsgd</span></p><p><span style="font-family: courier;">sh-4.4$ cd installation/</span></p><p><span style="font-family: courier;"><br /></span></p><p><span style="font-family: courier;">sh-4.4$ ls</span></p><p><span style="font-family: courier;">INSTALL LICENSE.txt _JoomlahFHOLvETv9AotNDHiqiuN.txt ...</span></p><p><span style="font-family: courier;"><br /></span></p><p><span style="font-family: courier;">sh-4.4$ <span style="background-color: #fcff01;">rm _JoomlahFHOLvETv9AotNDHiqiuN.txt</span></span></p><p>Continue the setup and congratulation!</p><p><span><span></span></span></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEg7-ZCSIn7jRlwbfPj6vGCrEH_urQBFsYJcoJhPhskNwWvnvvRwQAk0KxqGamtLdTUOGcuZn-1LG8S4hjutYc5mMOoMZC-adNopcvlV4mA5lBsxV-XetIUMIKjCDd1RIQuqPaJT_K_1arFadeABC6ta3M6CIgr05efA3Y_WzRLAKdWnyhOz6loRl45N9A" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="814" data-original-width="832" height="627" src="https://blogger.googleusercontent.com/img/a/AVvXsEg7-ZCSIn7jRlwbfPj6vGCrEH_urQBFsYJcoJhPhskNwWvnvvRwQAk0KxqGamtLdTUOGcuZn-1LG8S4hjutYc5mMOoMZC-adNopcvlV4mA5lBsxV-XetIUMIKjCDd1RIQuqPaJT_K_1arFadeABC6ta3M6CIgr05efA3Y_WzRLAKdWnyhOz6loRl45N9A=w640-h627" width="640" /></a></div><br /><br /><p></p></div>leorickhttp://www.blogger.com/profile/12860324908477273661noreply@blogger.com0tag:blogger.com,1999:blog-1859734723707065827.post-41359060863099456212022-07-23T13:22:00.001+08:002022-07-23T13:22:30.957+08:00How to connect phpMyAdmin to MariaDB under Red Hat OpenShift<p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEgiFI_S50thQPM8sHHUw-VDgLLl0Yn2OC2XtlxR_Vyi2KePFY8SbQfFuaeWWrUjhiWXIYxrLpUUq0lxLviCIO5Vem_BCSXnwFKU1g6I1cXinKdV9ku4kDClF0qU1S5XQHstcVXalExgC483lWIGsDXFauXLAm_-WpY1s6TJlY8NAYvePc0kzoxdSvSV2A" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="669" data-original-width="1200" height="178" src="https://blogger.googleusercontent.com/img/a/AVvXsEgiFI_S50thQPM8sHHUw-VDgLLl0Yn2OC2XtlxR_Vyi2KePFY8SbQfFuaeWWrUjhiWXIYxrLpUUq0lxLviCIO5Vem_BCSXnwFKU1g6I1cXinKdV9ku4kDClF0qU1S5XQHstcVXalExgC483lWIGsDXFauXLAm_-WpY1s6TJlY8NAYvePc0kzoxdSvSV2A" width="320" /></a></div><br />It is a container platform built for an open hybrid cloud.<p></p><p>Get your trial account from <a href="https://www.redhat.com/en/technologies/cloud-computing/openshift">https://www.redhat.com/en/technologies/cloud-computing/openshift</a> if you haven't do so.</p><p>Like me, I'm getting myself a developer sandbox with a trial length of 30 days just to understand how to play around with it.</p><p>First step is to add a database:</p><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEhA_HCrwmsdRUZmvBZM8iycGx5Rmq2C4Fh2pEGDqHoKqRYmrcWeMWzw56R8b49CGyRbgayTastmSepCKDYGoefr71hQemBZF5aRXOiwdA3mkMzmG4ik6jAzIHJPcQcz1Ort2xNpRHzpQMZt1orXr7t7tACFHWCT4O1y6-kV6TQCkgmF49oU4Ikb5xhozA" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="686" data-original-width="1542" height="284" src="https://blogger.googleusercontent.com/img/a/AVvXsEhA_HCrwmsdRUZmvBZM8iycGx5Rmq2C4Fh2pEGDqHoKqRYmrcWeMWzw56R8b49CGyRbgayTastmSepCKDYGoefr71hQemBZF5aRXOiwdA3mkMzmG4ik6jAzIHJPcQcz1Ort2xNpRHzpQMZt1orXr7t7tACFHWCT4O1y6-kV6TQCkgmF49oU4Ikb5xhozA=w640-h284" width="640" /></a></div><br />Pick MariaDB (Ephemeral), it is a database without persistent storage & data stored will be lost upon pod destruction. Good enough for testing:<div><br /><div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEguSUtQ3ICJFWAipbFN6v8x2NVZYDlGH3UXPl9hQ4REAyZWC0yMH_9lZDAcQtKzWvRap_3XiD3sYkiOkBNGcjzkQ0gvH0qwlzmE3mHv2R38VJ6ZeiL2J21tS3-t6ucawcH7NlXRMjzYSn1ZeJSihilLnb1LJ_lanE6jYRXWMVq-EEF3kg7cJ1FQXEJiww" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="690" data-original-width="1542" height="286" src="https://blogger.googleusercontent.com/img/a/AVvXsEguSUtQ3ICJFWAipbFN6v8x2NVZYDlGH3UXPl9hQ4REAyZWC0yMH_9lZDAcQtKzWvRap_3XiD3sYkiOkBNGcjzkQ0gvH0qwlzmE3mHv2R38VJ6ZeiL2J21tS3-t6ucawcH7NlXRMjzYSn1ZeJSihilLnb1LJ_lanE6jYRXWMVq-EEF3kg7cJ1FQXEJiww=w640-h286" width="640" /></a></div><br />Hit "Create" to continue:</div></div><div><br /></div><div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEiKy_8mefD7lTeurZajKrbPOakP1L8fUcZwwMDG80ZTU7bDKfxHPyoMfLP-BBVmogiuHoKa-SmaC4Kkiuh3OfHn3VpHsu5ainU9XOTssX2GEULbz2C3F2MxeMnj5dQkDDpkfdWB7CaUa-21rgOGA2F2rAUsOZ6_v6XCdc_lelbW8l5-vrmiyQLemtnz_g" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="690" data-original-width="1542" height="286" src="https://blogger.googleusercontent.com/img/a/AVvXsEiKy_8mefD7lTeurZajKrbPOakP1L8fUcZwwMDG80ZTU7bDKfxHPyoMfLP-BBVmogiuHoKa-SmaC4Kkiuh3OfHn3VpHsu5ainU9XOTssX2GEULbz2C3F2MxeMnj5dQkDDpkfdWB7CaUa-21rgOGA2F2rAUsOZ6_v6XCdc_lelbW8l5-vrmiyQLemtnz_g=w640-h286" width="640" /></a></div><br /><div>For phpMyAdmin we will be using docker image from <a href="https://hub.docker.com/r/startxfr/openshift-phpmyadmin/">https://hub.docker.com/r/startxfr/openshift-phpmyadmin/</a></div><div><br /></div><div>Copy the docker image name below:</div><blockquote><div><span style="font-family: courier;">startxfr/openshift-phpmyadmin</span></div></blockquote><p> <a href="https://blogger.googleusercontent.com/img/a/AVvXsEgMwUam5GzKIlaM43mNvCp82DhFYX-2rf6jBc0K7l6uuAeEO9VTAF0aWT1z2UU0Xi0lERDPrWrsrJrbwJKZt_dLIkQhd0AFusCA489EqZjwtS91_jVnKDUllTuyUHmjGHdKORqgnJJAsWfQExDfZD_gL7n2Zfnyhy7GcSgbBuJNZ6agEAnRh-6j7q0UHA" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img alt="" data-original-height="420" data-original-width="981" height="274" src="https://blogger.googleusercontent.com/img/a/AVvXsEgMwUam5GzKIlaM43mNvCp82DhFYX-2rf6jBc0K7l6uuAeEO9VTAF0aWT1z2UU0Xi0lERDPrWrsrJrbwJKZt_dLIkQhd0AFusCA489EqZjwtS91_jVnKDUllTuyUHmjGHdKORqgnJJAsWfQExDfZD_gL7n2Zfnyhy7GcSgbBuJNZ6agEAnRh-6j7q0UHA=w640-h274" width="640" /></a></p></div><div>Now, add "Container Images" for phpMyAdmin</div><div><br /></div><div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEhjbVfk-onYc4rniiveLQVkMZ4Z1gYPTQTI4IeV0p0dTBn06C71dx02a1nwbDrQGtCY6LeV9-fEKlS_rw0s0z9J6eBNQTt1gsObon5WnpaHseQcSeSbEVQD7RCHRLWS9CRRl21M6irmgOlT72zi2dvOWpmao6POv4KyOniK5rpg1zctLTIWIhevbtfmjQ" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="691" data-original-width="1542" height="286" src="https://blogger.googleusercontent.com/img/a/AVvXsEhjbVfk-onYc4rniiveLQVkMZ4Z1gYPTQTI4IeV0p0dTBn06C71dx02a1nwbDrQGtCY6LeV9-fEKlS_rw0s0z9J6eBNQTt1gsObon5WnpaHseQcSeSbEVQD7RCHRLWS9CRRl21M6irmgOlT72zi2dvOWpmao6POv4KyOniK5rpg1zctLTIWIhevbtfmjQ=w640-h286" width="640" /></a></div><br />Paste the docker image name & hit "Create"</div><div><br /></div><div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEhzYj0gPNMtwK7CfWeBENC0-vkU_V4U_Be85dgzxZapxByWf6SSNSlcnnJmUK4eb9gHgt11RThEtgdebLqhYtR3VvpSjaHb2D3VLx0zPFCIqdTRXG6uqEGnymQUvSNrWOhWcAxakPueduyJrqnFvYRC6WS8ZR34WRnIV9zU3l3-pzhcNyQi1iYNNWdfAA" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="690" data-original-width="1542" height="286" src="https://blogger.googleusercontent.com/img/a/AVvXsEhzYj0gPNMtwK7CfWeBENC0-vkU_V4U_Be85dgzxZapxByWf6SSNSlcnnJmUK4eb9gHgt11RThEtgdebLqhYtR3VvpSjaHb2D3VLx0zPFCIqdTRXG6uqEGnymQUvSNrWOhWcAxakPueduyJrqnFvYRC6WS8ZR34WRnIV9zU3l3-pzhcNyQi1iYNNWdfAA=w640-h286" width="640" /></a></div><br />Now, get back to the MariaDB and verify the environment settings.</div><div><br /></div><div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEh7-Aq5zdpemlZ34gKfCVae7aWCuuS9JZ5HRl_7H4VYk83V7CUyXv-aM_MJdCvWY2VBgVmZzFuyrVvSj96jDrroT7QwTSxx4Cgw_1mtIQymNblnT4XJObWTcvghBYZ-ta-R8XeFvNbQhMdTEqIzREtq3AoOIxYNPiIvt4OTt4C2kkOZaAputZER6un1RA" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="690" data-original-width="1542" height="286" src="https://blogger.googleusercontent.com/img/a/AVvXsEh7-Aq5zdpemlZ34gKfCVae7aWCuuS9JZ5HRl_7H4VYk83V7CUyXv-aM_MJdCvWY2VBgVmZzFuyrVvSj96jDrroT7QwTSxx4Cgw_1mtIQymNblnT4XJObWTcvghBYZ-ta-R8XeFvNbQhMdTEqIzREtq3AoOIxYNPiIvt4OTt4C2kkOZaAputZER6un1RA=w640-h286" width="640" /></a></div><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEh3iRmHZWQoBJrA3ISjxQyLa0DxuUtfIDb9_VDZJ-FlwnA5Mm5KbCFsQD1yrMmhVk1aZjlXipzptI1E9LOy-RKc2-e4LxxORb5Ydkvust6yw6x0WwhsrG5wN--65esYKlJFUMxxmjtaF-tREBGInBkw8FDdbRJ79W8HPXYY4ZIlqmpTRB9kRRw2vC--7g" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="685" data-original-width="1540" height="284" src="https://blogger.googleusercontent.com/img/a/AVvXsEh3iRmHZWQoBJrA3ISjxQyLa0DxuUtfIDb9_VDZJ-FlwnA5Mm5KbCFsQD1yrMmhVk1aZjlXipzptI1E9LOy-RKc2-e4LxxORb5Ydkvust6yw6x0WwhsrG5wN--65esYKlJFUMxxmjtaF-tREBGInBkw8FDdbRJ79W8HPXYY4ZIlqmpTRB9kRRw2vC--7g=w640-h284" width="640" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEi_RYagPtNHFWT_ztPVEoW4tyKKNU6GigFowKtx3AomRN3VZ-BhhmXOBVworhkhzA16OGP7ci-cy1nlEMUa9tD49RFbHTnm1gcYVKaiuRi6ntfPTI6VOHia-gL4S_4KFkAj462iiinw24ZlmPw2ZszHL5hdOYOjFdzc7lvv6_gRqUBAWmpg9SIqZTS8Ag" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="682" data-original-width="1534" height="284" src="https://blogger.googleusercontent.com/img/a/AVvXsEi_RYagPtNHFWT_ztPVEoW4tyKKNU6GigFowKtx3AomRN3VZ-BhhmXOBVworhkhzA16OGP7ci-cy1nlEMUa9tD49RFbHTnm1gcYVKaiuRi6ntfPTI6VOHia-gL4S_4KFkAj462iiinw24ZlmPw2ZszHL5hdOYOjFdzc7lvv6_gRqUBAWmpg9SIqZTS8Ag=w640-h284" width="640" /></a></div><div class="separator" style="clear: both; text-align: center;"></div></div><p> </p><blockquote><div><div class="separator" style="clear: both; text-align: center;"></div></div><div><div><span style="font-family: courier;">sh-4.4$ env|grep MARIA</span></div><div><span style="font-family: courier;">MARIADB_SERVICE_HOST=172.30.1.41</span></div><div><span style="font-family: courier;">MARIADB_PORT=tcp://172.30.1.41:3306</span></div><div><span style="font-family: courier;">MARIADB_PORT_3306_TCP_ADDR=172.30.1.41</span></div><div><span style="font-family: courier;">MARIADB_PORT_3306_TCP_PROTO=tcp</span></div><div><span style="font-family: courier;">MARIADB_SERVICE_PORT_MARIADB=3306</span></div><div><span style="font-family: courier;">MARIADB_PORT_3306_TCP=tcp://172.30.1.41:3306</span></div><div><span style="font-family: courier;">MARIADB_SERVICE_PORT=3306</span></div><div><span style="font-family: courier;">MARIADB_PORT_3306_TCP_PORT=3306</span></div><div><span style="font-family: courier;">sh-4.4$ </span></div></div></blockquote><div><div></div></div><div><br /></div><div>Verify the ConfigMap. This is where the database username & password being shared to the ConfigMap. From below we can see that they are being shared to mariadb, database-user & database-password.</div><div><br /></div><div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEjZ9jDNRbi7Wz2N4y1ceg4k-ltfYRVx71dNBw-YePFfM-pYKncDrpyip51Ed6MmFKYgMIpPZLBqnJoCqrNTcTtVXKWUJeqpLzLIuYFWMaMwocihcgOXzpCf_XYPb7A4Yg2bhkR5YMFCAnq066G40LU-uiLu-0a1xwsWmFty9HVEISRqfmzIn5iRBVbjCA" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="845" data-original-width="1542" height="350" src="https://blogger.googleusercontent.com/img/a/AVvXsEjZ9jDNRbi7Wz2N4y1ceg4k-ltfYRVx71dNBw-YePFfM-pYKncDrpyip51Ed6MmFKYgMIpPZLBqnJoCqrNTcTtVXKWUJeqpLzLIuYFWMaMwocihcgOXzpCf_XYPb7A4Yg2bhkR5YMFCAnq066G40LU-uiLu-0a1xwsWmFty9HVEISRqfmzIn5iRBVbjCA=w640-h350" width="640" /></a></div><br />Now check the environment variables use by the phpMyAdmin to connect to the MariaDB</div><div><br /></div><div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEg_GxY7ZGLmOGI6By3OF6VfYTQNZ4vD0hqnkFtR3JNzx5S1KbGEUew_G6Xktvx8A2NC-zwKw3hwG6uX5b2a59FZGQyk-1B499Wu2kv2pxn6gAfnWj5ZxtzpFwTLYctPQoNkMJnsYTw2Trzg6qd1OGyW1WnFFwzV5WH_DyBnu-tu-WU_NoM0YU2YD7qqng" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="680" data-original-width="1537" height="284" src="https://blogger.googleusercontent.com/img/a/AVvXsEg_GxY7ZGLmOGI6By3OF6VfYTQNZ4vD0hqnkFtR3JNzx5S1KbGEUew_G6Xktvx8A2NC-zwKw3hwG6uX5b2a59FZGQyk-1B499Wu2kv2pxn6gAfnWj5ZxtzpFwTLYctPQoNkMJnsYTw2Trzg6qd1OGyW1WnFFwzV5WH_DyBnu-tu-WU_NoM0YU2YD7qqng=w640-h284" width="640" /></a></div><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEgDIgmIg7yGknSRZoi2zcYiy0trxtUcufN5L9QEUelg66lnE-bz5zP2RDyvrgg0BUprMvzetk58WDqYNKnyUoZ-i_a062bEBodHMLvrDN2g6ry3ECBhO1Z_5JicDnuigFCkfIZbkBMhs4gCzSccZ3y-bB4jWZ04YvGy1_R3H91EwRdsnlFAjqhUZfFGXQ" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="684" data-original-width="1531" height="286" src="https://blogger.googleusercontent.com/img/a/AVvXsEgDIgmIg7yGknSRZoi2zcYiy0trxtUcufN5L9QEUelg66lnE-bz5zP2RDyvrgg0BUprMvzetk58WDqYNKnyUoZ-i_a062bEBodHMLvrDN2g6ry3ECBhO1Z_5JicDnuigFCkfIZbkBMhs4gCzSccZ3y-bB4jWZ04YvGy1_R3H91EwRdsnlFAjqhUZfFGXQ=w640-h286" width="640" /></a></div><div><br /></div><div>Look into the "config.inc.php" file on how it is getting the database user & password from the environment variables.</div><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEgEpTwnIKMJvm08Zn6_aRRhj7WsuME23w5NmS_mcQH4q6gAbRWuOzRZ4BcnvAg4bAd88fxw68O9R3NCAo3Z0RDnKgKg_F8lW5yHPJve5ru3MYxtTbUBl430L-u8Mwaj7Tyl897jUqoCxzxVCS8oaK5LKq5j5eULNmGBMuXjE9LSl7Bt0X25xlO_K6ecvA" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="683" data-original-width="1533" height="286" src="https://blogger.googleusercontent.com/img/a/AVvXsEgEpTwnIKMJvm08Zn6_aRRhj7WsuME23w5NmS_mcQH4q6gAbRWuOzRZ4BcnvAg4bAd88fxw68O9R3NCAo3Z0RDnKgKg_F8lW5yHPJve5ru3MYxtTbUBl430L-u8Mwaj7Tyl897jUqoCxzxVCS8oaK5LKq5j5eULNmGBMuXjE9LSl7Bt0X25xlO_K6ecvA=w640-h286" width="640" /></a></div><br />Scroll down until to get see below section</div><div><br /></div><div><div></div><blockquote><div><span style="font-family: courier; font-size: x-small;">if(getenv('<span style="background-color: #fcff01;">MARIADB_SERVICE_USER</span>') != '') {</span></div><div><span style="font-family: courier; font-size: x-small;">$i++;</span></div><div><span style="font-family: courier; font-size: x-small;"> $cfg['Servers'][$i]['extension'] = 'mysqli';</span></div><div><span style="font-family: courier; font-size: x-small;"> $cfg['Servers'][$i]['auth_type'] = 'config';</span></div><div><span style="font-family: courier; font-size: x-small;"> $cfg['Servers'][$i]['host'] = getenv('MARIADB_SERVICE_HOST');</span></div><div><span style="font-family: courier; font-size: x-small;"> $cfg['Servers'][$i]['port'] = getenv('MARIADB_SERVICE_PORT');</span></div><div><span style="font-family: courier; font-size: x-small;"> $cfg['Servers'][$i]['user'] = getenv('<span style="background-color: #fcff01;">MARIADB_SERVICE_USER</span>');</span></div><div><span style="font-family: courier; font-size: x-small;"> $cfg['Servers'][$i]['password'] = getenv('<span style="background-color: #fcff01;">MARIADB_SERVICE_PWD</span>');</span></div><div><span style="font-family: courier; font-size: x-small;"> $cfg['Servers'][$i]['compress'] = false;</span></div><div><span style="font-family: courier; font-size: x-small;"> $cfg['Servers'][$i]['AllowNoPassword'] = false;</span></div><div><span style="font-family: courier; font-size: x-small;">}</span></div></blockquote><div></div></div><div><br /></div><div>So we now know that phpMyAdmin is getting database username & password from MARIADB_SERVICE_USER for database username & MARIADB_SERVICE_PWD as database password.</div><div><br /></div><div>Add both MARIADB_SERVICE_USER and MARIADB_SERVICE_PWD to phpMyAdmin environment variables by linking them to ConfigMap.</div><div><br /></div><div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEjfcBMsrGtX5J_u_1pXMnXgx9kmb4yPjHcVyCT3cIgMS4dyScAoS4liqRHvfS7KZRBOEL68gveIBxVqlODNr8iHxIgeRcJlSV5oucJXCDqG99Ax7ynSifbSntExYXjin-VSDEQuNjDYIS683bg0kCUzadfhodlTgmTpyh0PBX9zABZUqFLp41XFaszzVA" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="682" data-original-width="1534" height="284" src="https://blogger.googleusercontent.com/img/a/AVvXsEjfcBMsrGtX5J_u_1pXMnXgx9kmb4yPjHcVyCT3cIgMS4dyScAoS4liqRHvfS7KZRBOEL68gveIBxVqlODNr8iHxIgeRcJlSV5oucJXCDqG99Ax7ynSifbSntExYXjin-VSDEQuNjDYIS683bg0kCUzadfhodlTgmTpyh0PBX9zABZUqFLp41XFaszzVA=w640-h284" width="640" /></a></div><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEgSIzXLeWD-MMTyIl1ENbsmboLwi_5Nn4R1hTFOiXVZbGQjaiKevV7WjWifrAkJ-FAoJEg_l2gTg5FFQlIdsnjq31MlEutrkQCeZkYKavaYLviYCp2o417TsYqAlmwt5vqIFP1AWG7VbAkADj2NQKC7pXweCTjqB8CZto1bkCjkjzfY23dvBVxzBQ3c-w" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="679" data-original-width="1534" height="284" src="https://blogger.googleusercontent.com/img/a/AVvXsEgSIzXLeWD-MMTyIl1ENbsmboLwi_5Nn4R1hTFOiXVZbGQjaiKevV7WjWifrAkJ-FAoJEg_l2gTg5FFQlIdsnjq31MlEutrkQCeZkYKavaYLviYCp2o417TsYqAlmwt5vqIFP1AWG7VbAkADj2NQKC7pXweCTjqB8CZto1bkCjkjzfY23dvBVxzBQ3c-w=w640-h284" width="640" /></a></div><br /><div>Now try to open the phpMyAdmin web page.</div><div><br /></div><div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEg1XuFwIDLYDGTI5Dxp_PTOcgbL5LWUL4F0IhyV5X4PTYzuw44qzwWuG_T1D_3E_VO_ClF37jOHJwq3GQ4lbnLUtb6RnVjzmfGyN8l9z2kEt61Ep48E1f9fVEM5UKLqifgVZCEoWjChpesG04NM43sGsqvUk4pcxt45rjbn9Jlrm4HtKff-Cc5GtKMjnA" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="686" data-original-width="1542" height="284" src="https://blogger.googleusercontent.com/img/a/AVvXsEg1XuFwIDLYDGTI5Dxp_PTOcgbL5LWUL4F0IhyV5X4PTYzuw44qzwWuG_T1D_3E_VO_ClF37jOHJwq3GQ4lbnLUtb6RnVjzmfGyN8l9z2kEt61Ep48E1f9fVEM5UKLqifgVZCEoWjChpesG04NM43sGsqvUk4pcxt45rjbn9Jlrm4HtKff-Cc5GtKMjnA=w640-h284" width="640" /></a></div><br /></div></div><div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEixS64tMaZy3g39Eh_xhF8c5lGtCoELaqMGKmt5UrMYSuCn4v5EWvJwEapjW7eYd9_7RDgOW6nE-trgAsL99l3TBfCTL0V_kyIgceBZyAazh_TGT_h_hAu-3mTvHGFO1ICdqR4tXS-W55KoStsFuGzc86IuqmEtFGRQawDrqEyHYWqnWImDi9STyJZpog" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="686" data-original-width="1535" height="286" src="https://blogger.googleusercontent.com/img/a/AVvXsEixS64tMaZy3g39Eh_xhF8c5lGtCoELaqMGKmt5UrMYSuCn4v5EWvJwEapjW7eYd9_7RDgOW6nE-trgAsL99l3TBfCTL0V_kyIgceBZyAazh_TGT_h_hAu-3mTvHGFO1ICdqR4tXS-W55KoStsFuGzc86IuqmEtFGRQawDrqEyHYWqnWImDi9STyJZpog=w640-h286" width="640" /></a></div><br />Good luck trying!</div>leorickhttp://www.blogger.com/profile/12860324908477273661noreply@blogger.com0tag:blogger.com,1999:blog-1859734723707065827.post-12065687914465732372021-10-28T20:28:00.002+08:002023-07-09T14:24:10.879+08:00Mounting a Clonezilla image to a running OS<style>
pre{padding:10px;border:1px solid #444;background-color:#444;color:#fff;overflow-x:scroll;overflow:auto;}
</style>
<p>I have a Clonezilla image of Ubuntu OS and wanted to extract just a directory of important files from it. I'm trying to avoid restoring the whole image into a physical or virtual machine. What I can do is to extract the raw image file from the Clonezilla image itself and mount it onto a running OS. Below are the steps.</p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEge-1Qt4hyphenhyphenOFCOm1cpkdq3bbzhcxrqE5nGMmxfV-UT0nV2muQgl1SZJdsiCNo0RBNUTzmCIg6eANCU6Tt7eYI0sxXy94BnWygf3Cpm_MIvWfFJM5cAIhFST7PwCiNnovzCCk-rybhUsCJYR/s308/CZLogo2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="308" data-original-width="280" height="308" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEge-1Qt4hyphenhyphenOFCOm1cpkdq3bbzhcxrqE5nGMmxfV-UT0nV2muQgl1SZJdsiCNo0RBNUTzmCIg6eANCU6Tt7eYI0sxXy94BnWygf3Cpm_MIvWfFJM5cAIhFST7PwCiNnovzCCk-rybhUsCJYR/s0/CZLogo2.png" width="280" /></a></div>
<p>
</p>
<p>Extract the compressed raw image file(s) from the Clonezilla image. The easiest way to do this is by using 7-zip, open and extract under Windows (open and drag). Example below shows that I have 2 partitions stored in my Clonezilla image, "sdb1" & "sdb2". Copy out the compressed raw image partition file that you are interested in. For my case is "sdb2". Note that if you partition is too big, Clonezilla might split it and store more than than 1 file. They are differentiate by the same base name but different extension such as "*.aa", "*.ab" & "*.ac".</p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYfbDXEqdnW-4Zs3iqh7AETnPfxlStNcoUfBFt0TPDJdd3Q7IoT8x2Pj3iglmEhyolwagnjqrlE1s-sSjO09cNbtq7kG7tryQ4RJwffnuzDYXh5_lLBOZcNul-o7eW7ESUvymyGgPGXFS8/s806/a.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="506" data-original-width="806" height="201" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYfbDXEqdnW-4Zs3iqh7AETnPfxlStNcoUfBFt0TPDJdd3Q7IoT8x2Pj3iglmEhyolwagnjqrlE1s-sSjO09cNbtq7kG7tryQ4RJwffnuzDYXh5_lLBOZcNul-o7eW7ESUvymyGgPGXFS8/s320/a.png" width="320" /></a></div>
<p>
</p>
<p>Next is to decompress the file by issuing command below. [ ref = <a href="http://geekinlinux.blogspot.com/2015/05/mount-clonezilla-images-and-extract.html">link </a>].</p>
<p>
</p>
<pre class="brush:plain;"># cat sdb2.ext4-ptcl-img.gz.aa | gzip -d > sdb2.ext4-ptcl-img</pre>
<p>
</p>
<p>If you have more than 1 file, please issue command below. [ref = <a href="https://unix.stackexchange.com/questions/156653/how-to-mount-a-clonezilla-img-to-extract-files">link </a>].</p>
<p>
</p>
<pre class="brush:plain;"># cat sdb2.ext4-ptcl-img.gz.* | gzip -c -d > sdb2.ext4-ptcl-img</pre>
<p>
</p>
<p>Next is to restore the decompressed file back into raw image format. Use "partclone.restore" tool to do this.</p>
<p>
</p>
<pre class="brush:plain;"># partclone.restore -s sdb2.ext4-ptcl-img -o sdb2.ext4-ptcl-img_restore
Partclone v0.2.86 http://partclone.org
Starting to restore image (-) to device (file.img)
device (file.img) is mounted at
error exit</pre>
<p>If you encounter error above, it is probably because of the "partclone.restore" version mismatch. On the current OS we have "partclone.restore" v0.2.86. But when the ISO was created with Clonezilla, it was using different version of "partclone" and having incompatibility issue. You can try this trick by find the exact version of the "partclone.restore" copy from the Clonezilla image itself. It turns out for my case the "partclone.restore" version is newer which is v0.3.11.</p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8Gcs_ZnZSdHsbxyhqeXxixEwHXp3lwPs8Y0v1fGk7t1LD_s5OIx4THTVIPaLffdMo04bFQNcrYRa6BlWjNXoSDkBYEodHExAIU8WBymODRhKqOc1VrtnPARWIejaZolKoXsoIYhU35zT8/s806/b.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="506" data-original-width="806" height="201" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8Gcs_ZnZSdHsbxyhqeXxixEwHXp3lwPs8Y0v1fGk7t1LD_s5OIx4THTVIPaLffdMo04bFQNcrYRa6BlWjNXoSDkBYEodHExAIU8WBymODRhKqOc1VrtnPARWIejaZolKoXsoIYhU35zT8/s320/b.png" width="320" /></a></div>
<p>
</p>
<p>Copy the "partclone.restore" into the current OS and "chmod +x" it to make it executable. Run the extracted "partclone.restore". Use option -C to disable size checking, -O to override output file if it is already exists and -W to create special raw file for loop device.</p>
<p>
</p>
<pre class="brush:plain;">#./partclone.restore -C -s sdb2.ext4-ptcl-img -O sdb2.ext4-ptcl-img_restore
Partclone v0.3.11 http://partclone.org
Starting to restore image (sdb2.ext4-ptcl-img) to device (sdb2.ext4-ptcl-img_restore)
Calculating bitmap... Please wait...
done!
File system: EXTFS
Device size: 10.5 GB = 2560000 Blocks
Space in use: 6.9 GB = 1695256 Blocks
Free Space: 3.5 GB = 864744 Blocks
Block size: 4096 Byte
Elapsed: 00:00:20, Remaining: 00:00:00, Completed: 100.00%, Rate: 20.83GB/min,
current block: 2558079, total block: 2560000, Complete: 100.00%
Total Time: 00:00:20, Ave. Rate: 20.8GB/min, 100.00% completed!
Syncing... OK!
Partclone successfully restored the image (sdb2.ext4-ptcl-img) to the device (sdb2.ext4-ptcl-img_restore)
Cloned successfully.</pre>
<p>
</p>
<p>Now try to mount it with "-o loop" and "-t ext4" options.</p>
<p>
</p>
<pre class="brush:plain;"># mount -o loop -t ext4 sdb2.ext4-ptcl-img_restore temp</pre>
<p>
</p>
<p>If you encounter below error, look for a clue from "/var/log/syslog".</p>
<p>
</p>
<pre class="brush:plain;">mount: wrong fs type, bad option, bad superblock on /dev/loop0,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so.</pre>
<p>
</p>
<pre class="brush:plain;"># tail /var/log/syslog
Oct 20 05:10:18 xxx kernel: [34532.566686] EXT4-fs (loop0): bad geometry: block count 2560000 exceeds size of device (2558079 blocks)</pre>
<p>
</p>
<p>I've no exact answer for this but you can refer to this link for more answer on this [ <a href="https://askubuntu.com/questions/453114/restoring-clonezilla-images-cat-gzip-partclone-not-working">link </a>]. I believe because of the "sdb2.ext4-ptcl-img_restore" raw image file is not reaching the actual block count of 2560000. Thus from the URL, issue was solved by truncating it to 2560000 with -o option to treat SIZE as number of IO blocks instead of bytes.</p>
<p>
</p>
<pre class="brush:plain;"># truncate -o -s 2560000 sdb2.ext4-ptcl-img_restore</pre>
<p>
</p>
<p>Now, try to mount again.</p>
<p>
</p>
<pre class="brush:plain;"># mount -o loop -t ext4 sdb2.ext4-ptcl-img_restore temp</pre>
<p>
</p>
<p>Finnally, the image is now mounted.</p>
<p>
</p>
<pre class="brush:plain;"># lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
loop0 7:0 0 9.8G 0 loop /mnt/disk/temp</pre>leorickhttp://www.blogger.com/profile/12860324908477273661noreply@blogger.com0tag:blogger.com,1999:blog-1859734723707065827.post-39525647959495536862021-10-27T22:18:00.001+08:002021-10-27T22:18:47.259+08:00Ubuntu .desktop file shortcut or launchers not working<p>I encounter this issue while installing Intel Thermal Analysis Tool (TAT) under Ubuntu 20.04. The desktop launchers seems didn't installed correctly.</p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiV1oX2bRxVMbCovr-_OFzZKE_1sDztjOI7mzLO3_goL-qbEm8GKGL7M91kH5Heyzadsf8Dq6oXMJprtDURW5owNsuu84BRjxiJ7Ak3wU2lLx5j913syqNqiip2Om5l8f6wy0X9TKiQsOnP/s363/Snap+2021-10-25+at+13.05.27.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="363" data-original-width="190" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiV1oX2bRxVMbCovr-_OFzZKE_1sDztjOI7mzLO3_goL-qbEm8GKGL7M91kH5Heyzadsf8Dq6oXMJprtDURW5owNsuu84BRjxiJ7Ak3wU2lLx5j913syqNqiip2Om5l8f6wy0X9TKiQsOnP/s320/Snap+2021-10-25+at+13.05.27.png" width="167" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div>It will open an editor showing the content of the .desktop file if you try to launch it. To fix this, simply right click at the .desktop file and select "Allow Launching".<div><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBBcn7HGaFAmOD17SHDsnnIKiO_Q1ik5s9qjKcdi4bP4aC32h9hwxO7VOvrHTa8KVYnbed0ONsWHqXM0_JcpWYcfAN_2MIlI6TBe3BQaPKlTMFYEtA9focqwoSVR3E5lflELgNrGcFK1yS/s420/Snap+2021-10-25+at+13.05.43.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="361" data-original-width="420" height="275" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBBcn7HGaFAmOD17SHDsnnIKiO_Q1ik5s9qjKcdi4bP4aC32h9hwxO7VOvrHTa8KVYnbed0ONsWHqXM0_JcpWYcfAN_2MIlI6TBe3BQaPKlTMFYEtA9focqwoSVR3E5lflELgNrGcFK1yS/s320/Snap+2021-10-25+at+13.05.43.png" width="320" /></a></div><div><br /></div><div>Now as you can see, the icon has changed indicating the .desktop file is now launchable.</div><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCmT4Rss3nPOcx9814Ogfxz4tumDn7_PcX0F-26gtrgOIYIQPAALYCdaZPZp7jTHU0Z4H0DbMCfPpuZx2AGyy6jJ74st7gCCV3Ukp1QN2h_HoEfwnNuZCXTbgNRx6at2t1xCoR2spIBjt-/s359/Snap+2021-10-25+at+13.05.53.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="359" data-original-width="191" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCmT4Rss3nPOcx9814Ogfxz4tumDn7_PcX0F-26gtrgOIYIQPAALYCdaZPZp7jTHU0Z4H0DbMCfPpuZx2AGyy6jJ74st7gCCV3Ukp1QN2h_HoEfwnNuZCXTbgNRx6at2t1xCoR2spIBjt-/s320/Snap+2021-10-25+at+13.05.53.png" width="170" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: left;">There you go, the <span style="text-align: left;">Intel</span><span style="text-align: left;"> TAT is now running fine.</span></div><div class="separator" style="clear: both; text-align: center;"><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2QxGFcKhd8mdlNkON2o4zH1kGv5A2uau9xokEOOxpR23lSh3ANRqu-L7D8UfbTrXdy9nr2fm3cAlEGXg6aivNHwczyGiBcBpzUzkKydXHG97TtxcJUi7HcWhfEWBYMkIrfq9H-1YX8U4P/s1141/Snap+2021-10-25+at+12.54.44.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="435" data-original-width="1141" height="122" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2QxGFcKhd8mdlNkON2o4zH1kGv5A2uau9xokEOOxpR23lSh3ANRqu-L7D8UfbTrXdy9nr2fm3cAlEGXg6aivNHwczyGiBcBpzUzkKydXHG97TtxcJUi7HcWhfEWBYMkIrfq9H-1YX8U4P/s320/Snap+2021-10-25+at+12.54.44.png" width="320" /></a></div></div><p><br /></p></div>leorickhttp://www.blogger.com/profile/12860324908477273661noreply@blogger.com0tag:blogger.com,1999:blog-1859734723707065827.post-11700931071903701292021-08-27T20:38:00.000+08:002021-08-27T20:43:21.881+08:00Passwordless SSH login under Linux using RSA public-private key pairs<p>For some reason, we might want to have passwordless SSH access. This will be useful for automation scripts that are running without user intervention.</p><p>In order to do this, the remote SSH server needs to be able to identify the SSH client. This is where the “~/.ssh/authorized_keys” file comes into the picture. The idea is to generate an RSA key from the client side and copy it to the remote server “~/.ssh/authorized_keys” file. If everything is done correctly, the remote SSH server will then be able to identify the SSH client that matched the RSA key and allow passwordless SSH connection.</p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrEJ1StUuoKq5uJzzlccxY9LGNrRh4-mX0LzTot_y9a6NgJfBMd-FBA8yUAV7xE6rY4R4PdwsCdtXLD3VFWe-bf0txHBJeoa7D6QQD-1eHy-GpRcUTJeR624QAC0kfywARzO4SU8xAwW8L/s619/Snap+2021-08-27+at+20.31.25.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="338" data-original-width="619" height="175" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrEJ1StUuoKq5uJzzlccxY9LGNrRh4-mX0LzTot_y9a6NgJfBMd-FBA8yUAV7xE6rY4R4PdwsCdtXLD3VFWe-bf0txHBJeoa7D6QQD-1eHy-GpRcUTJeR624QAC0kfywARzO4SU8xAwW8L/s320/Snap+2021-08-27+at+20.31.25.png" width="320" /></a></div><br /><p>For example below we are using 2 OS for testing, local client is running CentOS and remote server is running Ubuntu. Normal SSH as below will require the user to enter a password.</p>
<pre class="brush:plain;">leorick@localhost ~]$ ssh leorick@192.168.100.17
leorick@192.168.100.17's password:
Welcome to Ubuntu 20.04.1 LTS (GNU/Linux 5.11.0-25-generic x86_64)
...
Your Hardware Enablement Stack (HWE) is supported until April 2025.
Last login: Fri Aug 27 04:49:52 2021 from 192.168.100.223
leorick@ubuntu:~$
</pre>
<p>First step, generate local "id_rsa.pub" from local CentOS client by issuing “ssh-keygen -t rsa” command.</p>
<pre class="brush:plain;">[leorick@localhost ~]$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/leorick/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/leorick/.ssh/id_rsa.
Your public key has been saved in /home/leorick/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:+7Ar4vN/uQlYinKVgP/UifRWYqGOaT+sysMST0vZbz0 leorick@localhost.localdomain
The key's randomart image is:
+---[RSA 3072]----+
| . |
| . o |
| . . o o . |
| . * * + |
| o= * S |
|. +..B = . |
| *.oo.B + . |
|..=o=.o. =o. |
| .o=o+E++o+. |
+----[SHA256]-----+
</pre>
<p>Next, send the “id_rsa.pub” file to the remote Ubuntu server using any method available. Example below is how to send the file using SCP.</p>
<pre class="brush:plain;">leorick@localhost ~]$ scp /home/leorick/.ssh/id_rsa.pub leorick@192.168.100.17:/home/leorick/.ssh/
leorick@192.168.100.17's password:
id_rsa.pub 100% 583 1.0MB/s 00:00
[leorick@localhost ~]$</pre>
<p>On the remote Ubuntu server, copy the content of the “id_rsa.pub” file into the “~/.ssh/authorized_keys” file of the particular user home directory that you are going to login with.</p>
<pre class="brush:plain;">leorick@ubuntu:~/.ssh$ pwd
/home/leorick/.ssh
leorick@ubuntu:~/.ssh$ cat id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCrLZsQkR2Sev5s/9cxf64vI1BiId+4CcHxmMIA5B+T2n+R1kZ4iA1u+tut3tKlWI9G9NQnH+yC6nJlBwtjf3szYyn66fIf3mxCwZ+ikFQt9eaOg7h2Wz/WKFx0MHnol3WgVkJwwJqWB0EUaLikJgU4IDjatBpp7X7U2nvVzDHMIIBnCuDYG3NL4nT1JacxZ4KeccRewJN7qWsb+kCJfcwKZRRyiSEvn+Fnk6RDrenSefm6mnxTQJ35kiVGQ2gkpiNzUcR+yrXkZQJyLQso7nEzjmob/ecRbxxj8nZtP2MbPxtU8tIEQjYwkbRuh7acFUw0I8Y4qBS4aKP01zZXrWz7WVoA86a2JvOgwIup0F8+sjXNxzbRR3rgQqV5AitpcwI7zhRVWsHQoL2+mCkIES0hHqEDHwuwnFYk81AOKIEoFRoPSk7wMons+C28uHH9ks5VJRYtty58Vrc6AMWjtVKSaiPRildUZSI7b/HQkQ3DVofpEPnmSJKhiuBEF4Fbk30= leorick@localhost.localdomain
leorick@ubuntu:~/.ssh$ cat id_rsa.pub > authorized_keys
</pre>
<p>Now login can be done without password.</p>
<pre class="brush:plain;">[leorick@localhost ~]$ ssh leorick@192.168.100.17
Welcome to Ubuntu 20.04.1 LTS (GNU/Linux 5.11.0-25-generic x86_64)
...
Your Hardware Enablement Stack (HWE) is supported until April 2025.
Last login: Fri Aug 27 04:50:57 2021 from 192.168.100.223
leorick@ubuntu:~$</pre>
<p>.</p>
leorickhttp://www.blogger.com/profile/12860324908477273661noreply@blogger.com0tag:blogger.com,1999:blog-1859734723707065827.post-13402080874928859712021-08-21T23:02:00.003+08:002023-07-09T16:35:33.659+08:00Bash - progress bar<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggXILi0WfoTuSV_rTeDkNuBlb2pMG0SzcNAuv_UkwfntG7w58JTvUt2sU8WUcXeGF_RV6UyRYuK6seoxyoxtDeQTax42ATcuuFJQNLk1gPoat3C-92hByL0zm8o_ZdFy13EIqgkun5TFRf/s672/Snap+2021-08-21+at+23.05.45.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="230" data-original-width="672" height="110" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggXILi0WfoTuSV_rTeDkNuBlb2pMG0SzcNAuv_UkwfntG7w58JTvUt2sU8WUcXeGF_RV6UyRYuK6seoxyoxtDeQTax42ATcuuFJQNLk1gPoat3C-92hByL0zm8o_ZdFy13EIqgkun5TFRf/s320/Snap+2021-08-21+at+23.05.45.png" width="320" /></a></div><br />
<div class="separator" style="clear: both; text-align: center;"><iframe allowfullscreen="" class="BLOG_video_class" height="266" src="https://www.youtube.com/embed/hguzCN7mB_Y" width="320" youtube-src-id="hguzCN7mB_Y"></iframe></div><br /><div class="separator" style="clear: both; text-align: center;"><br /></div>Example on using bash loop to draw an ASCII progress bar with BASH.<div><br /></div><div>The dispProgBar function takes 2 arguments, current progress and total progress number. In this example it starts with 1 until 10000. </div><div><br /></div><div>dispProgBar will then calculate percentage of progress and current bar length.</div><div><br /></div><div>1st loop will draw current progress bar with a dark block (ASCII 219).</div><div><br /></div><div>2nd loop will draw remaining progress bar with a light graphic character (ASCII 176).</div><div><br /></div><div>At the end of the progress bar it will send "\r" to go back to the beginning of the line without printing a newline.<br /><pre class="brush:plain;">#!/bin/bash
function dispProgBar(){
curProg=$1
totalProg=$2
barFullLen=50
((perc = $curProg * 100 / $totalProg))
((barLen = $curProg * $barFullLen / $totalProg))
printf "%3s%% [" $perc
for (( c=1; c<=$barLen; c++ )); do
echo -ne "█"
done
for (( c=$barLen; c<$barFullLen; c++ )); do
echo -ne "░"
done
echo -en "]\r"
if [ $curProg -ge $totalProg ]; then
echo ""
fi
}
for i in {1..10000}
do
dispProgBar $i 10000
done
</pre></div>leorickhttp://www.blogger.com/profile/12860324908477273661noreply@blogger.com0tag:blogger.com,1999:blog-1859734723707065827.post-52158623335081704492021-04-23T20:30:00.005+08:002021-04-23T21:29:35.729+08:00Bash trap - signal trapping with Unix shell<img border="0" data-original-height="175" data-original-width="250" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVcoUml5zqhg0InbEpWbe5PSbRsi-T8f9H4fBlh7mT5DyXF-xniDwwSc0B10XDufo9kC6451LwpxAdupB0ScgbBHVQNacZKNj5NDtJw5njvc-sCnxWB2fGSykYbJklnIqUc6QJIYg1lYyj/s0/bash-icon.png" />
<br />
Linux/Unix shell/Bash trap command
"Trap" can be used to execute a function/command on receiving certain signal.
To list down all available signals, do "trap -l"
<pre class="brush:plain;"># trap -l
1) SIGHUP 2) SIGINT 3) SIGQUIT 4) SIGILL 5) SIGTRAP
6) SIGABRT 7) SIGBUS 8) SIGFPE 9) SIGKILL 10) SIGUSR1
11) SIGSEGV 12) SIGUSR2 13) SIGPIPE 14) SIGALRM 15) SIGTERM
16) SIGSTKFLT 17) SIGCHLD 18) SIGCONT 19) SIGSTOP 20) SIGTSTP
21) SIGTTIN 22) SIGTTOU 23) SIGURG 24) SIGXCPU 25) SIGXFSZ
26) SIGVTALRM 27) SIGPROF 28) SIGWINCH 29) SIGIO 30) SIGPWR
31) SIGSYS 34) SIGRTMIN 35) SIGRTMIN+1 36) SIGRTMIN+2 37) SIGRTMIN+3
38) SIGRTMIN+4 39) SIGRTMIN+5 40) SIGRTMIN+6 41) SIGRTMIN+7 42) SIGRTMIN+8
43) SIGRTMIN+9 44) SIGRTMIN+10 45) SIGRTMIN+11 46) SIGRTMIN+12 47) SIGRTMIN+13
48) SIGRTMIN+14 49) SIGRTMIN+15 50) SIGRTMAX-14 51) SIGRTMAX-13 52) SIGRTMAX-12
53) SIGRTMAX-11 54) SIGRTMAX-10 55) SIGRTMAX-9 56) SIGRTMAX-8 57) SIGRTMAX-7
58) SIGRTMAX-6 59) SIGRTMAX-5 60) SIGRTMAX-4 61) SIGRTMAX-3 62) SIGRTMAX-2
63) SIGRTMAX-1 64) SIGRTMAX
</pre>
Please refer to <a href="https://www.computerhope.com/unix/utrap.htm">https://www.computerhope.com/unix/utrap.htm</a> for more information on this.
Example common usage in a shell script, to perform cleanup when EXIT signal detected.
Maybe to delete certain temporary files upon receiving CTRL+C.
Example script
<pre class="brush:plain;">#!/bin/bash
cleanup(){
echo
echo "running cleanup here"
echo "delete temporary files?"
echo
}
trap cleanup EXIT
read -p "Press enter to continue"
read -p "Press enter to continue again"
read -p "Press enter to continue again"
</pre>
When run, on receiving CTRL+C while the script is running (before the last line) will trigger the "cleanup" function.
<pre class="brush:plain;"># ./test.sh
Press enter to continue
Press enter to continue again^C
running cleanup here
delete temporary files?
</pre>leorickhttp://www.blogger.com/profile/12860324908477273661noreply@blogger.com0tag:blogger.com,1999:blog-1859734723707065827.post-36250124194588049522021-04-20T20:38:00.001+08:002021-04-23T21:26:33.705+08:00Bash select - Creating simple menu with the Unix shell "select" loop<img border="0" data-original-height="175" data-original-width="250" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZv0CABb7kA1i7s_Zf5rHl9JjAX_Rw_rxd8wKfiwvm8x2Pdwx71Dz0DBV2COOMsY3zTSe5SGzxyUeagaomA2MStDlat-EosVQDEmJZDuoJfzZysu8ZfexQ7MhC-1A30C-JEdSRX2CTH1Tg/s0/bash-icon.png" /><br />
Bash select command creates a menu from a list of items.
The syntax is quite similar as the "for loop".
Please refer to link below for more info
<a href="https://linuxize.com/post/bash-select/">https://linuxize.com/post/bash-select/</a>
<a href="https://linuxhint.com/bash_select_command/">https://linuxhint.com/bash_select_command/</a>
Lets do a quick test. Create a simple for loop as below and run it.
<pre class="brush:plain;">#!/bin/bash
for i in the quick brown fox jumps over the lazy dog
do
echo $i
done
</pre>
You will get a list of word as below.
<pre class="brush:plain;"># ./test.sh
the
quick
brown
fox
jumps
over
the
lazy
dog
</pre>
Now modify the script as below. Replace "for" with "select".
Add "break" just under the "echo" line.
<pre class="brush:plain;">#!/bin/bash
select i in the quick brown fox jumps over the lazy dog
do
echo word selection = $i
break
done
</pre>
Now run the script and you will get below output.
<pre class="brush:plain;"># ./test.sh
1) the
2) quick
3) brown
4) fox
5) jumps
6) over
7) the
8) lazy
9) dog
#? 6
word selection = over
</pre>
Note that, without "break", the script will keep on prompting the selection until you hit CTRL+C.leorickhttp://www.blogger.com/profile/12860324908477273661noreply@blogger.com0tag:blogger.com,1999:blog-1859734723707065827.post-15187164490103430472021-04-19T22:14:00.005+08:002021-04-23T21:29:55.060+08:00Bash array - how to use arrays in Unix shell<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXbNlss-OpVvpXeaYyPAcNfoRr5TZxgn8UwWucjV_wm1PBTvbo2-hODdMfD5C-jMI5oM9pF5tcxx6aJiuUzh3tyR0LDB_EaLeTkDJkzQX-Ps7wt81VJ7miikEdV6R17_XuZE-7PiUr7XMk/s250/bash-icon.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="175" data-original-width="250" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXbNlss-OpVvpXeaYyPAcNfoRr5TZxgn8UwWucjV_wm1PBTvbo2-hODdMfD5C-jMI5oM9pF5tcxx6aJiuUzh3tyR0LDB_EaLeTkDJkzQX-Ps7wt81VJ7miikEdV6R17_XuZE-7PiUr7XMk/s0/bash-icon.png" /></a></div><br /><div><br /></div>
Unix shell do support array. Yes, it does.
Please refer to <a href="https://opensource.com/article/18/5/you-dont-know-bash-intro-bash-arrays">https://opensource.com/article/18/5/you-dont-know-bash-intro-bash-arrays</a> OR <a href="https://www.tutorialspoint.com/unix/unix-using-arrays.htm">https://www.tutorialspoint.com/unix/unix-using-arrays.htm</a> for more info on this.
To define an array, do;
<pre class="brush:plain;">myArray=(the quick brown fox jumps over the lazy dog)
</pre>
But how to read an array?. Lets try this;
<pre class="brush:plain;">#!/bin/bash
myArray=(the quick brown fox jumps over the lazy dog)
echo $myArray
</pre>
Run it ...
<pre class="brush:plain;"># ./test.sh
the
</pre>
It will only echo the 1st word from the array.
Lets try another example.
<pre class="brush:plain;">#!/bin/bash
myArray=(the quick brown fox jumps over the lazy dog)
echo ${myArray[0]}
echo ${myArray[1]}
echo ${myArray[2]}
echo ${myArray[3]}
echo ${myArray[4]}
echo ${myArray[5]}
echo ${myArray[6]}
echo ${myArray[7]}
echo ${myArray[8]}
echo ${myArray[9]}
</pre>
Run it ...
<pre class="brush:plain;"># ./test.sh
the
quick
brown
fox
jumps
over
the
lazy
dog
</pre>
Now, It will print all array content.
Note that, it won't give any alert if the index is out of bound, for this example = "${myArray[9]}"
Lets do a proper way to read an array by using "for loop";
<pre class="brush:plain;">#!/bin/bash
myArray=(the quick brown fox jumps over the lazy dog)
for i in ${myArray[@]}
do
echo $i
done
</pre>
Run it ...
<pre class="brush:plain;"># ./test.sh
the
quick
brown
fox
jumps
over
the
lazy
dog
</pre>
You will get above output.
Adding an "!" to the array name will change the loop from looping through the values to looping through the indices.
<pre class="brush:plain;">#!/bin/bash
myArray=(the quick brown fox jumps over the lazy dog)
for i in ${!myArray[@]}
do
echo $i
done
</pre>
Run it ...
<pre class="brush:plain;"># ./test.sh
0
1
2
3
4
5
6
7
8
</pre>
Example below is using "while loop" to loop through the array.
<pre class="brush:plain;">#!/bin/bash
myArray=(the quick brown fox jumps over the lazy dog)
index=0
while [ $index -lt ${#myArray[@]} ]
do
echo $index = ${myArray[index]}
index=`expr $index + 1`
done
</pre>
Run it ...
<pre class="brush:plain;"># ./test.sh
0 = the
1 = quick
2 = brown
3 = fox
4 = jumps
5 = over
6 = the
7 = lazy
8 = dog
</pre>
Here are some syntax list that might be useful.
<table border="1" style="border-collapse: collapse; width: 100%;">
<thead>
<tr>
<td>Syntax</td>
<td>Result</td>
</tr>
</thead>
<tbody>
<tr>
<td>myArray=()</td>
<td>Create an empty array</td>
</tr>
<tr>
<td>myArray=(1 2 3)</td>
<td>Initialize array</td>
</tr>
<tr>
<td>${myArray[2]}</td>
<td>Retrieve all elements</td>
</tr>
<tr>
<td>${myArray[@]}</td>
<td>Retrieve all elements</td>
</tr>
<tr>
<td>${!myArray[@]}</td>
<td>Retrieve array indices </td>
</tr>
<tr>
<td>${#myArray[@]}</td>
<td>Calculate array size </td>
</tr>
<tr>
<td>myArray[0]=3 </td>
<td>Overwrite 1st element </td>
</tr>
<tr>
<td>myArray+=(4) </td>
<td>Append value(s) </td>
</tr>
<tr>
<td>${arr[@]:s:n} </td>
<td>Retrieve n elements starting at index s </td>
</tr>
</tbody>
</table>
leorickhttp://www.blogger.com/profile/12860324908477273661noreply@blogger.com0tag:blogger.com,1999:blog-1859734723707065827.post-58287936764911474202020-05-09T00:27:00.005+08:002020-05-20T20:29:29.160+08:00Linux dd multiple partitions into single image file<div class="separator" style="clear: both; text-align: left;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVJuOmfNxOUBx3bMe-pggvzH-wyelrdbHOjRw0OUYDPjoqGZrgA3JhyphenhyphenhdIqC4A2Ni6u1Wl9xfsvfM63IDxQ_oQfZxwRwCszfBY9_aQtKYLmZbeEjhWNK-wEXad__KidKnxrprv4nG_Z8x9/" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="152" data-original-width="377" height="81" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVJuOmfNxOUBx3bMe-pggvzH-wyelrdbHOjRw0OUYDPjoqGZrgA3JhyphenhyphenhdIqC4A2Ni6u1Wl9xfsvfM63IDxQ_oQfZxwRwCszfBY9_aQtKYLmZbeEjhWNK-wEXad__KidKnxrprv4nG_Z8x9/w200-h81/Snap+2020-05-08+at+23.55.08.png" width="200" /></a></div><div><br /></div>For example, USB 1 drive with 3 partitions to be written into a single image file.<div><div>List block devices</div><div><br /></div><div><div><font face="courier" size="2">[root@localhost ddtest]# lsblk</font></div><div><font face="courier" size="2">NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT</font></div><div><font face="courier" size="2">sdb 8:16 1 244M 0 disk</font></div><div><font face="courier" size="2">├─sdb1 8:17 1 30M 0 part /run/media/root/datapartition2</font></div><div><font face="courier" size="2">├─sdb2 8:18 1 40M 0 part /run/media/root/datapartition</font></div><div><font face="courier" size="2">└─sdb3 8:19 1 50M 0 part /run/media/root/datapartition1</font></div></div><div><br /></div><div>/dev/sdb1,2,3 = 30M,40M,50M in size</div><div>Umount them</div><div><br /></div><div><div><font face="courier" size="2">[root@localhost ddtest]# umount /dev/sdb*</font></div><div><br /></div></div><div>Confirm again</div><div><br /></div><div><div><font face="courier" size="2">[root@localhost ddtest]# lsblk</font></div><div><font face="courier" size="2">NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT</font></div><div><font face="courier" size="2">sdb 8:16 1 244M 0 disk</font></div><div><font face="courier" size="2">├─sdb1 8:17 1 30M 0 part</font></div><div><font face="courier" size="2">├─sdb2 8:18 1 40M 0 part</font></div><div><font face="courier" size="2">└─sdb3 8:19 1 50M 0 part</font></div></div><div><br /></div><div>Fdisk the drive to find its last partition end sector</div><div><br /></div><div><div><font face="courier" size="2">root@localhost ddtest]# fdisk -l /dev/sdb</font></div><div><font face="courier" size="2"><br /></font></div><div><font face="courier" size="2">Disk /dev/sdb: 255 MB, 255852544 bytes, 499712 sectors</font></div><div><font face="courier" size="2">Units = sectors of 1 * 512 = 512 bytes</font></div><div><font face="courier" size="2">Sector size (logical/physical): 512 bytes / 512 bytes</font></div><div><font face="courier" size="2">I/O size (minimum/optimal): 512 bytes / 512 bytes</font></div><div><font face="courier" size="2">Disk label type: dos</font></div><div><font face="courier" size="2">Disk identifier: 0xf4f4f4f4</font></div><div><font face="courier" size="2"><br /></font></div><div><font face="courier" size="2"> Device Boot Start End Blocks Id System</font></div><div><font face="courier" size="2">/dev/sdb1 2048 63487 30720 83 Linux</font></div><div><font face="courier" size="2">/dev/sdb2 63488 145407 40960 83 Linux</font></div><div><font face="courier" size="2">/dev/sdb3 145408 <span style="background-color: #f4a900;">247807</span> 51200 83 Linux</font></div></div><div><br /></div><div>Calculate dd count over 1MB with formula below</div><div>(<last partition end sector> + 1) / 2048</div><div>For this USB we have (<span style="background-color: #f4a900;">247807 </span>+ 1) / 2048 = <span style="background-color: #e67c73;">121</span></div><div>Ref = <a href="https://superuser.com/questions/1343561/is-there-a-way-to-dd-multiple-partitions-into-one-raw-image-file-in-such-a-way-t">https://superuser.com/questions/1343561/is-there-a-way-to-dd-multiple-partitions-into-one-raw-image-file-in-such-a-way-t</a></div><div><br /></div><div>Now dd the whole /dev/sdb to test.iso with count of <span style="background-color: #e67c73;">121</span> times of 1MBytes</div><div><br /></div><div><div><font face="courier" size="2">[root@localhost ddtest]# dd if=/dev/sdb of=test.iso bs=1M count=<span style="background-color: #e67c73;">121</span> status="progress" conv=sync,noerror</font></div><div><font face="courier" size="2">121+0 records in</font></div><div><font face="courier" size="2">121+0 records out</font></div><div><font face="courier" size="2">126877696 bytes (127 MB) copied, 37.6761 s, 3.4 MB/s</font></div></div><div><br /></div><div>Check the test.iso file size</div><div><br /></div><div><div><font face="courier" size="2">[root@localhost ddtest]# ls -alh</font></div><div><font face="courier" size="2">-rw-r--r--. 1 root root 121M May 8 23:37 test.iso</font></div></div><div><br /></div><div>Test the ISO file by restoring the ISO to another USB drive.</div><div>Plug out USB 1 and plug in USB 2 and check lsblk</div><div><br /></div><div><div><font face="courier" size="2">[root@localhost ddtest]# lsblk</font></div><div><font face="courier" size="2">NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT</font></div><div><font face="courier" size="2">sdb 8:16 1 3.7G 0 disk</font></div></div><div><br /></div><div>Dd the test.iso file to /dev/sdb</div><div><br /></div><div><div><font face="courier" size="2">[root@localhost ddtest]# dd if=test.iso of=/dev/sdb bs=1M conv=sync,noerror</font></div><div><font face="courier" size="2">121+0 records in</font></div><div><font face="courier" size="2">121+0 records out</font></div><div><font face="courier" size="2">126877696 bytes (127 MB) copied, 25.2433 s, 5.0 MB/s</font></div></div><div><br /></div><div>Check lsblk again</div><div><br /></div><div><div><font face="courier" size="2">[root@localhost ddtest]# lsblk</font></div><div><font face="courier" size="2">NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT</font></div><div><font face="courier" size="2">sdb 8:16 1 3.7G 0 disk</font></div><div><font face="courier" size="2">├─sdb1 8:17 1 30M 0 part</font></div><div><font face="courier" size="2">├─sdb2 8:18 1 40M 0 part</font></div><div><font face="courier" size="2">└─sdb3 8:19 1 50M 0 part</font></div></div><div><br /></div><div>Now we have 3 partitions restored identical to USB 1</div><div>Try to mount and check partition content</div><div><br /></div><div><div><font face="courier" size="2">[root@localhost ddtest]# mount /dev/sdb1 1</font></div><div><font face="courier" size="2">[root@localhost ddtest]# mount /dev/sdb2 2</font></div><div><font face="courier" size="2">[root@localhost ddtest]# mount /dev/sdb3 3</font></div><div><font face="courier" size="2">[root@localhost ddtest]# ls 1</font></div><div><font face="courier" size="2">WinSCP-5.17.5-Setup.exe</font></div><div><font face="courier" size="2">[root@localhost ddtest]# ls 2</font></div><div><font face="courier" size="2">WinSCP-5.17.5-Setup.exe</font></div><div><font face="courier" size="2">[root@localhost ddtest]# ls 3</font></div><div><font face="courier" size="2">WinSCP-5.17.5-Setup.exe</font></div></div><div><br /></div><div>Check lsblk</div><div><br /></div><div><div><font face="courier" size="2">[root@localhost ddtest]# lsblk</font></div><div><font face="courier" size="2">NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT</font></div><div><font face="courier" size="2">sdb 8:16 1 3.7G 0 disk</font></div><div><font face="courier" size="2">├─sdb1 8:17 1 30M 0 part /root/Desktop/temp/ddtest/1</font></div><div><font face="courier" size="2">├─sdb2 8:18 1 40M 0 part /root/Desktop/temp/ddtest/2</font></div><div><font face="courier" size="2">└─sdb3 8:19 1 50M 0 part /root/Desktop/temp/ddtest/3</font></div></div><div><br /></div><div>It also works with Windows tools such as Rufus...</div><div><br /></div><div><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj62iQ9kc19YEZHNWPl51kgRvhn4sSzdRSm5NUovfLmjFSiNmgiOlP8V-sN5aW6SiLYLR4wnkjKmXKw8UMhlbV_9sXu1151yE-y0I5QVUaoCMzAwm0G9TDLumOI61S68XEIFXjF0gCDBGdc/" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="702" data-original-width="483" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj62iQ9kc19YEZHNWPl51kgRvhn4sSzdRSm5NUovfLmjFSiNmgiOlP8V-sN5aW6SiLYLR4wnkjKmXKw8UMhlbV_9sXu1151yE-y0I5QVUaoCMzAwm0G9TDLumOI61S68XEIFXjF0gCDBGdc/s320/Snap+2020-05-09+at+12.27.52.png" /></a></div><div><br /></div><div>Or Win32 Disk Imager, but only if the device exists under the drop button circled below</div><div><br /></div><div class="separator" style="clear: both; text-align: left;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjoPhZxfP3_BZmKHJy-fM19WnO_IO06UglQ_iWU-jf_QUxsgHJKcvTbIfhjyvKm2eElgYQkoNSZw6HmoYg96u4x41_MwSPNeebZkBn-9IA-bDhyphenhyphenvkdAbq2ULGJDQ2am5tdQjhrPapYArWFc/" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="351" data-original-width="499" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjoPhZxfP3_BZmKHJy-fM19WnO_IO06UglQ_iWU-jf_QUxsgHJKcvTbIfhjyvKm2eElgYQkoNSZw6HmoYg96u4x41_MwSPNeebZkBn-9IA-bDhyphenhyphenvkdAbq2ULGJDQ2am5tdQjhrPapYArWFc/s320/Snap+2020-05-09+at+12.27.01.png" width="320" /></a></div><div><br /></div>How the partitions look like under Windows Disk Management<br /><br /><div class="separator" style="clear: both; text-align: left;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkhSpC8tZ5SWI9GA15303k6LE1H15_ha6t-Uio8q1kB1vuusjT7-sVLzfBEnkOzicjwAWia6clqWkrucvKkc9t4QUAhNPCBr0qy_zf-LRmU7URRuuxQe1uZQRKnAoVuSGqoPeSc6YBXjHZ/" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="141" data-original-width="455" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkhSpC8tZ5SWI9GA15303k6LE1H15_ha6t-Uio8q1kB1vuusjT7-sVLzfBEnkOzicjwAWia6clqWkrucvKkc9t4QUAhNPCBr0qy_zf-LRmU7URRuuxQe1uZQRKnAoVuSGqoPeSc6YBXjHZ/s320/Snap+2020-05-09+at+12.28.59.png" width="320" /></a></div><div><br /></div><div>Just to add, if you are having missing partition from Gparted you can try to zeroing the 1st sector of 512 bytes (MBR)</div></div><div>Ref = <a href="https://www.cyberciti.biz/faq/linux-clearing-out-master-boot-record-dd-command/">https://www.cyberciti.biz/faq/linux-clearing-out-master-boot-record-dd-command/</a></div><div><br /></div><div><font face="courier" size="2">[root@localhost ddtest]# dd if=/dev/zero of=/dev/sdc bs=512 count=1</font></div><div><div><font face="courier" size="2">1+0 records in</font></div><div><font face="courier" size="2">1+0 records out</font></div><div><font face="courier" size="2">512 bytes (512 B) copied, 0.00308483 s, 166 kB/s</font></div></div><div><br /></div><div class="separator" style="clear: both; text-align: left;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-INPa0bXhelx319exctjvHi8yYUPKmzFOah_6RP0qcpmKxJTuVe-kMDg6gg1JsXmwcRgOE6qaw7wZ_3F_Nd4WzxIlChPn7AWA7QumI5rNhH9DvpO6HXggd8S6T1aFwh_ujKtr-a4z8OAT/" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="550" data-original-width="787" height="280" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-INPa0bXhelx319exctjvHi8yYUPKmzFOah_6RP0qcpmKxJTuVe-kMDg6gg1JsXmwcRgOE6qaw7wZ_3F_Nd4WzxIlChPn7AWA7QumI5rNhH9DvpO6HXggd8S6T1aFwh_ujKtr-a4z8OAT/w400-h280/Snap+2020-05-09+at+22.56.00.png" width="400" /></a></div><div><br /></div><div><br /></div><div><br /></div>leorickhttp://www.blogger.com/profile/12860324908477273661noreply@blogger.com0tag:blogger.com,1999:blog-1859734723707065827.post-80218180211112665112020-05-07T21:07:00.002+08:002020-05-07T21:08:14.653+08:00Nginx PHP-FPM setup under Kali LinuxAnother Nginx PHP-FPM setup post similar to previous post [ <a href="https://xp-rience.blogspot.com/2020/04/nginx-php-fpm-setup-under-centos-7.html">here</a> ]<div><br /></div><div>To start with, install Nginx...</div><div><br /></div><div><font face="courier">root@kali:~# apt-get -y install nginx</font></div><div><br /></div><div>Start Nginx</div><div><br /></div><div><div><font face="courier">root@kali:~# service nginx start</font></div></div><div><br /></div><div>Install PHP-FPM, note the version</div><div><br /></div><div><font face="courier">root@kali:~# apt-get -y install php-fpm</font></div><div><br /></div><div>Edit default configuration</div><div><br /></div><div><font face="courier">root@kali:~# vi /etc/nginx/sites-available/default</font></div><div><br /></div><div>Add index.php into server block</div><div><br /></div><div><div><font face="courier">index index.html index.htm index.nginx-debian.html <span style="background-color: #fce8b2;">index.php</span>;</font></div></div><div><br /></div><div>Add location block</div><div><br /></div><div><div><font face="courier">location ~ \.php$ {</font></div><div><font face="courier"><span style="white-space: pre;"> </span>include snippets/fastcgi-php.conf;</font></div><div><font face="courier"><span style="white-space: pre;"> </span>fastcgi_pass unix:/run/php/php7.3-fpm.sock;</font></div><div><font face="courier">}</font></div></div><div><br /></div><div>Restart Nginx</div><div><br /></div><div><font face="courier">root@kali:~# service nginx restart</font></div><div><br /></div><div>Edit php.ini, note the PHP-FPM version, add cgi.fix_pathinfo=0</div><div><br /></div><div><font face="courier">root@kali:~# vi /etc/php/<span style="background-color: #fce8b2;">7.3</span>/fpm/php.ini</font></div><div><br /></div><div><div><font face="courier">; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI. PHP's</font></div><div><font face="courier">; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok</font></div><div><font face="courier">; what PATH_INFO is. For more information on PATH_INFO, see the cgi specs. Setting</font></div><div><font face="courier">; this to 1 will cause PHP CGI to fix its paths to conform to the spec. A setting</font></div><div><font face="courier">; of zero causes PHP to behave as before. Default is 1. You should fix your scripts</font></div><div><font face="courier">; to use SCRIPT_FILENAME rather than PATH_TRANSLATED.</font></div><div><font face="courier">; http://php.net/cgi.fix-pathinfo</font></div><div><font face="courier" style="background-color: #fce8b2;">cgi.fix_pathinfo=0</font></div></div><div><br /></div><div>Restart PHP-FPM</div><div><br /></div><div><font face="courier">root@kali:~# service php7.3-fpm restart</font></div><div><br /></div><div><div>Create a PHP test page "test.php" as content below and save it to /var/www/html/</div><div><br /></div><div><font face="courier"><?php</font></div><div><font face="courier">phpinfo();</font></div><div><font face="courier">?></font></div></div><div><br /></div><div>run the PHP file = http://<your host>/test.php</div><div><br /></div><div class="separator" style="clear: both; text-align: left;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7QLm6vih25qRKekdJnTQABKHS3nfjVe-TCRSLZ49wHX1_eha34u2hwa_m1gllrVg0cuYw_pIq8l-xXRG5lz61D1pvhWu2igZBp7RTbVDbfE69DZiUvMOJdudqgkF5DXHzX3omnCpqN4rj/" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="464" data-original-width="629" height="148" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7QLm6vih25qRKekdJnTQABKHS3nfjVe-TCRSLZ49wHX1_eha34u2hwa_m1gllrVg0cuYw_pIq8l-xXRG5lz61D1pvhWu2igZBp7RTbVDbfE69DZiUvMOJdudqgkF5DXHzX3omnCpqN4rj/w200-h148/Snap+2020-05-07+at+20.59.27.png" width="200" /></a></div><div><br /></div><div><br /></div><div><br /></div><div><br /></div><div><br /></div>leorickhttp://www.blogger.com/profile/12860324908477273661noreply@blogger.com0tag:blogger.com,1999:blog-1859734723707065827.post-45176379372434148752020-04-20T21:54:00.000+08:002020-04-20T21:54:38.476+08:00Nginx PHP-FPM setup under Centos 7<span style="font-family: inherit;"><span style="background-color: white; color: #111111;">Nginx (</span><span style="background-color: white; color: #111111;">pronounced as Engine-X</span><span style="background-color: white; color: #111111;">) is a </span><span style="background-color: white; color: #111111;">web and reverse proxy server </span><span style="background-color: white; color: #111111;">well known for its speed and capability to handle large number of requests</span></span><br />
<span style="background-color: white; color: #111111;"><span style="font-family: inherit;"><br />
</span></span> <span style="font-family: inherit;"><span style="background-color: white; color: #111111;">While </span><span style="background-color: white; color: #111111;">PHP-FPM (</span><span style="background-color: white; color: #111111;">PHP-FastCGI process manager</span><span style="background-color: white; color: #111111;">) is a </span><span style="background-color: white; color: #111111;">common gateway interface </span><span style="background-color: white; color: #111111;">between the web server and dynamic content serving programs. </span><span style="background-color: white; color: #111111;">It listens on a port or socket </span><span style="background-color: white; color: #111111;">and passes the request between the PHP and web server</span></span><br />
<span style="background-color: white; color: #111111;"><span style="font-family: inherit;"><br />
</span></span> <span style="background-color: white; color: #111111;"><span style="font-family: inherit;">To start with, install Nginx...</span></span><br />
<span style="background-color: white; color: #111111;"><span style="font-family: inherit;"><br />
</span></span> <span style="background-color: white;"><span style="color: #111111; font-family: "courier new" , "courier" , monospace;">[root@localhost ~]# yum install nginx -y</span></span><br />
<span style="background-color: white;"><span style="color: #111111; font-family: inherit;"><br />
</span></span> <span style="background-color: white;"><span style="color: #111111; font-family: inherit;">Start the service</span></span><br />
<span style="background-color: white;"><span style="color: #111111; font-family: inherit;"><br />
</span></span> <span style="font-family: "courier new" , "courier" , monospace;"><span style="background-color: white;"><span style="color: #111111;">[root@localhost </span></span><span style="background-color: white; color: #111111;">~</span><span style="background-color: white;"><span style="color: #111111;">]# service nginx start</span></span></span><br />
<span style="background-color: white;"><span style="color: #111111; font-family: inherit;"><br />
</span></span> <span style="color: #111111; font-family: inherit;"><span style="background-color: white;">Now test the Nginx by opening its default </span>web page http://<your host>/</span><br />
<span style="color: #111111; font-family: inherit;"><br />
</span> <br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtpdZMWhXJGWbmFuAqGOVsXXrUPI4eRy_KRgKIL47Dq4TP6Mu48iKbtaS4MzqLsYvcWITtpu6ZIZPfvvn90kSN2fCthAPPzwrRg-Eazh_z28UEh5a2XeeeyXSnGSgsSniBc1YxCb5xjFBE/s1600/Snap+2020-04-20+at+21.18.34.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: inherit;"><img border="0" data-original-height="622" data-original-width="922" height="430" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtpdZMWhXJGWbmFuAqGOVsXXrUPI4eRy_KRgKIL47Dq4TP6Mu48iKbtaS4MzqLsYvcWITtpu6ZIZPfvvn90kSN2fCthAPPzwrRg-Eazh_z28UEh5a2XeeeyXSnGSgsSniBc1YxCb5xjFBE/s640/Snap+2020-04-20+at+21.18.34.png" width="640" /></span></a></div>
<span style="color: #111111; font-family: inherit;"><br />
</span> <span style="color: #111111; font-family: inherit;">Find Nginx web directory by checking service status</span><br />
<span style="color: #111111; font-family: inherit;"><br />
</span> <span style="color: #111111; font-family: "courier new" , "courier" , monospace;">[root@localhost ~]# service nginx status</span><br />
<span style="color: #111111; font-family: inherit;"><br />
</span> <span style="color: #111111; font-family: "courier new" , "courier" , monospace;">Apr 20 20:42:56 localhost.localdomain nginx[5942]: nginx: the configuration file <span style="background-color: yellow;">/etc/nginx/nginx.conf</span> syntax is ok</span><br />
<span style="color: #111111; font-family: "courier new" , "courier" , monospace;"></span><br />
<span style="color: #111111; font-family: "courier new" , "courier" , monospace;">Apr 20 20:42:56 localhost.localdomain nginx[5942]: nginx: configuration file <span style="background-color: yellow;">/etc/nginx/nginx.conf</span> test is successful</span><br />
<span style="color: #111111; font-family: inherit;"><br />
</span> <span style="color: #111111; font-family: inherit;">Grep "root" from the "nginx.conf" file</span><br />
<span style="color: #111111; font-family: inherit;"><br />
</span> <span style="color: #111111; font-family: "courier new" , "courier" , monospace;">[root@localhost ~]# grep root /etc/nginx/nginx.conf</span><br />
<span style="color: #111111;"><span style="font-family: "courier new" , "courier" , monospace;">root /usr/share/nginx/html;</span></span><br />
<span style="color: #111111; font-family: inherit;"><br />
</span> <span style="color: #111111; font-family: inherit;">Create a PHP test page "test.php" as content below and save it to /usr/share/nginx/html/</span><br />
<span style="color: #111111; font-family: inherit;"><br />
</span> <span style="color: #111111; font-family: "courier new" , "courier" , monospace;"><?php</span><br />
<span style="color: #111111; font-family: "courier new" , "courier" , monospace;">phpinfo();</span><br />
<span style="color: #111111; font-family: "courier new", courier, monospace;">?></span><span style="color: #111111; font-family: "courier new" , "courier" , monospace;"></span><br />
<span style="color: #111111; font-family: inherit;"><br />
</span> <span style="color: #111111;"><span style="font-family: inherit;">Try to run the PHP file = http://<your host>/test.php</span></span><br />
<span style="color: #111111; font-family: inherit;"><br />
</span> <span style="color: #111111; font-family: inherit;">As we know it won't parse. It will just download or show the PHP file content. This is expected since we didn't link Nginx with PHP-FPM yet.</span><br />
<span style="color: #111111; font-family: inherit;"><br />
</span> <span style="color: #111111; font-family: inherit;">Install PHP-FPM</span><br />
<span style="color: #111111; font-family: inherit;"><br />
</span> <span style="color: #111111; font-family: "courier new" , "courier" , monospace;">[root@localhost ~]# yum install php-fpm -y</span><br />
<span style="color: #111111; font-family: inherit;"><br />
</span> <span style="color: #111111; font-family: inherit;">Check the PHP-FPM installation</span><br />
<span style="color: #111111; font-family: inherit;"><br />
</span> <span style="color: #111111; font-family: "courier new" , "courier" , monospace;">[root@localhost ~]# service php-fpm status</span><br />
<span style="color: #111111; font-family: inherit;"><br />
</span> <span style="font-family: inherit;"><span style="color: #111111;">Locate the PHP=FPM "www.conf</span><span style="color: #111111;">" file</span></span><br />
<span style="color: #111111;"><span style="font-family: inherit;"><br />
</span></span> <span style="color: #111111; font-family: "courier new" , "courier" , monospace;">[root@localhost ~]# locate www.conf</span><br />
<span style="color: #111111; font-family: "courier new", courier, monospace;">/etc/php-fpm.d/www.conf</span><br />
<span style="color: #111111; font-family: inherit;"><br />
</span> <span style="font-family: inherit;"><span style="color: #111111;">Edit the "</span><span style="color: #111111;">/etc/php-fpm.d/www.conf" change listen ip:port to socket</span></span><br />
<span style="color: #111111;"><span style="font-family: inherit;"><br />
</span></span> <span style="color: #111111; font-family: "courier new" , "courier" , monospace;">; The address on which to accept FastCGI requests.</span><br />
<span style="color: #111111; font-family: "courier new" , "courier" , monospace;">; Valid syntaxes are:</span><br />
<span style="color: #111111; font-family: "courier new" , "courier" , monospace;">; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific address on</span><br />
<span style="color: #111111; font-family: "courier new" , "courier" , monospace;">; a specific port;</span><br />
<span style="color: #111111; font-family: "courier new" , "courier" , monospace;">; 'port' - to listen on a TCP socket to all addresses on a</span><br />
<span style="color: #111111; font-family: "courier new" , "courier" , monospace;">; specific port;</span><br />
<span style="color: #111111; font-family: "courier new" , "courier" , monospace;">; '/path/to/unix/socket' - to listen on a unix socket.</span><br />
<span style="color: #111111; font-family: "courier new" , "courier" , monospace;">; Note: This value is mandatory.</span><br />
<span style="background-color: yellow; color: #111111; font-family: "courier new" , "courier" , monospace;">;listen = 127.0.0.1:9000</span><br />
<span style="background-color: yellow; color: #111111; font-family: "courier new", courier, monospace;">listen = /run/php-fpm/php-fpm.sock</span><br />
<span style="color: #111111; font-family: inherit;"><br />
</span> <span style="color: #111111; font-family: inherit;">Restart PHP-FPM</span><br />
<span style="color: #111111; font-family: inherit;"><br />
</span> <span style="color: #111111; font-family: "courier new" , "courier" , monospace;">[root@localhost ~]# service php-fpm restart</span><br />
<span style="color: #111111; font-family: inherit;"><br />
</span> <span style="color: #111111; font-family: inherit;">Backup and edit /etc/nginx/nginx.conf</span><br />
<span style="color: #111111; font-family: inherit;">Under server scope {} block, add location scope {} block to enable PHP-FPM to parsePHP file</span><br />
<span style="color: #111111; font-family: inherit;"><br />
</span> <span style="color: #111111; font-family: "courier new" , "courier" , monospace;">server {</span><br />
<span style="color: #111111; font-family: "courier new" , "courier" , monospace;"><span style="white-space: pre;"> </span>listen 80 default_server;</span><br />
<span style="color: #111111; font-family: "courier new" , "courier" , monospace;"><span style="white-space: pre;"> </span>listen [::]:80 default_server;</span><br />
<span style="color: #111111; font-family: "courier new" , "courier" , monospace;"><span style="white-space: pre;"> </span>server_name _;</span><br />
<span style="color: #111111; font-family: "courier new" , "courier" , monospace;"><span style="white-space: pre;"> </span>root /usr/share/nginx/html;</span><br />
<span style="color: #111111; font-family: "courier new" , "courier" , monospace;"><br />
</span> <span style="color: #111111; font-family: "courier new" , "courier" , monospace;"><span style="white-space: pre;"> </span># Load configuration files for the default server block.</span><br />
<span style="color: #111111; font-family: "courier new" , "courier" , monospace;"><span style="white-space: pre;"> </span>include /etc/nginx/default.d/*.conf;</span><br />
<span style="color: #111111; font-family: "courier new" , "courier" , monospace;"><br />
</span> <span style="color: #111111; font-family: "courier new" , "courier" , monospace;"><span style="white-space: pre;"> </span>#location / {</span><br />
<span style="color: #111111; font-family: "courier new" , "courier" , monospace;"><span style="white-space: pre;"> </span>#}</span><br />
<span style="color: #111111; font-family: "courier new" , "courier" , monospace;"><br />
</span> <span style="background-color: #cfe2f3; color: #111111; font-family: "courier new" , "courier" , monospace;"><span style="white-space: pre;"> </span>location ~* \.php$ {</span><br />
<span style="color: #111111; font-family: "courier new" , "courier" , monospace;"><span style="background-color: #cfe2f3; white-space: pre;"> </span><span style="background-color: yellow;">fastcgi_pass unix:/run/php-fpm/php-fpm.sock;</span></span><br />
<span style="background-color: #cfe2f3; color: #111111; font-family: "courier new" , "courier" , monospace;"><span style="white-space: pre;"> </span>include fastcgi_params;</span><br />
<span style="background-color: #cfe2f3; color: #111111; font-family: "courier new" , "courier" , monospace;"><span style="white-space: pre;"> </span>fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;</span><br />
<span style="background-color: #cfe2f3; color: #111111; font-family: "courier new" , "courier" , monospace;"><span style="white-space: pre;"> </span>fastcgi_param SCRIPT_NAME $fastcgi_script_name;</span><br />
<span style="background-color: #cfe2f3; color: #111111; font-family: "courier new" , "courier" , monospace;"><span style="white-space: pre;"> </span>}</span><br />
<span style="color: #111111; font-family: "courier new" , "courier" , monospace;"><br />
</span> <span style="color: #111111; font-family: "courier new" , "courier" , monospace;"><span style="white-space: pre;"> </span>error_page 404 /404.html;</span><br />
<span style="color: #111111; font-family: "courier new" , "courier" , monospace;"><span style="white-space: pre;"> </span>location = /40x.html {</span><br />
<span style="color: #111111; font-family: "courier new" , "courier" , monospace;"><span style="white-space: pre;"> </span>}</span><br />
<span style="color: #111111; font-family: "courier new" , "courier" , monospace;"><br />
</span> <span style="color: #111111; font-family: "courier new" , "courier" , monospace;"><span style="white-space: pre;"> </span>error_page 500 502 503 504 /50x.html;</span><br />
<span style="color: #111111; font-family: "courier new" , "courier" , monospace;"><span style="white-space: pre;"> </span>location = /50x.html {</span><br />
<span style="color: #111111; font-family: "courier new" , "courier" , monospace;"><span style="white-space: pre;"> </span>}</span><br />
<span style="color: #111111; font-family: "courier new" , "courier" , monospace;"></span><br />
<span style="color: #111111; font-family: "courier new" , "courier" , monospace;">}</span><br />
<span style="color: #111111; font-family: inherit;"><br />
</span> <span style="color: #111111; font-family: inherit;">Make sure this line is pointing to correct Unix socket</span><br />
<span style="font-family: inherit;"><br />
</span> <span style="background-color: yellow; color: #111111; font-family: "courier new" , "courier" , monospace;">fastcgi_pass unix:/run/php-fpm/php-fpm.sock;</span><br />
<span style="font-family: inherit;"><br />
</span> <span style="color: #111111; font-family: inherit;"></span><br />
<span style="color: #111111; font-family: inherit;">Restart both Nginx and PHP-FPM</span><br />
<span style="color: #111111; font-family: inherit;"><br />
</span> <span style="color: #111111; font-family: "courier new" , "courier" , monospace;">[root@localhost ~]# service nginx restart</span><br />
<span style="color: #111111; font-family: "courier new" , "courier" , monospace;">Redirecting to /bin/systemctl restart nginx.service</span><br />
<span style="color: #111111; font-family: inherit;"><br />
</span> <span style="color: #111111; font-family: "courier new" , "courier" , monospace;">[root@localhost ~]# service php-fpm restart</span><br />
<span style="color: #111111; font-family: "courier new", courier, monospace;">Redirecting to /bin/systemctl restart php-fpm.service</span><span style="color: #111111; font-family: "courier new" , "courier" , monospace;"></span><br />
<span style="font-family: inherit;"><br />
</span> <span style="color: #111111;"><span style="font-family: inherit;">Try to run the PHP file = http://<your host>/test.php again</span></span><br />
<span style="color: #111111;"><span style="font-family: inherit;"><br />
</span></span> <br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDPsXwxZ6uHuKCGMBLheok7q4dOkzyxrJZW5ZZ4NHqLs951eZbz7TVsqc09dJj4A2BQdYUZu2Bdy7jro9tAEV6z0snPR6MwAm2mM0CZ4ruVUkD43kbI1NvcVdVQ_NRQkhdrr8NK_NySZTD/s1600/Snap+2020-04-20+at+21.43.58.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: inherit;"><img border="0" data-original-height="622" data-original-width="981" height="404" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDPsXwxZ6uHuKCGMBLheok7q4dOkzyxrJZW5ZZ4NHqLs951eZbz7TVsqc09dJj4A2BQdYUZu2Bdy7jro9tAEV6z0snPR6MwAm2mM0CZ4ruVUkD43kbI1NvcVdVQ_NRQkhdrr8NK_NySZTD/s640/Snap+2020-04-20+at+21.43.58.png" width="640" /></span></a></div>
<span style="color: #111111;"><span style="font-family: inherit;"><br />
</span></span> <br />
<div style="height: 0px;">
<span style="font-family: inherit;"><br />
x</span></div>
leorickhttp://www.blogger.com/profile/12860324908477273661noreply@blogger.com0tag:blogger.com,1999:blog-1859734723707065827.post-50670212542095100522020-04-19T22:25:00.001+08:002020-06-06T20:36:58.110+08:00Minimal PHP/Apache Docker setup<h3>
Why Docker?</h3>
The portability of the containers, can be deployed anywhere<br />
Efficient system resource usage compare to VM<br />
<h3>
How to Dockerize your php application?</h3>
<div>
<div>
Assuming your OS already have a good and working Docker installation</div>
<div>
Let us use single page PHP applications below, index.php inside a webfolder directory</div>
index.php content;<br />
<br />
<span style="background-color: #fff2cc; font-family: "courier new", courier, monospace;"><?php</span><br />
<span style="background-color: #fff2cc; font-family: "courier new", courier, monospace;">phpinfo();</span><br />
<span style="background-color: #fff2cc; font-family: "courier new", courier, monospace;">?></span></div>
<div>
<br />
<span style="background-color: #cfe2f3; font-family: "courier new", courier, monospace;">[root@localhost php_docker]# tree .</span><br />
<span style="background-color: #cfe2f3; font-family: "courier new", courier, monospace;">.</span><br />
<span style="background-color: #cfe2f3; font-family: "courier new", courier, monospace;">└── webfolder</span><br />
<span style="background-color: #cfe2f3; font-family: "courier new", courier, monospace;"><span style="white-space: pre;"> </span>└── index.php</span></div>
<div>
<h3>
Create a Dockerfile</h3>
<div>
Dockerfile in a list of instruction/command call to assemble the image<br />
<br />
<span style="background-color: #cfe2f3; font-family: "courier new", courier, monospace;">[root@localhost php_docker]# tree .</span><br />
<span style="background-color: #cfe2f3; font-family: "courier new", courier, monospace;">.</span><br />
<span style="background-color: #cfe2f3; font-family: "courier new", courier, monospace;">├── Dockerfile</span><br />
<span style="background-color: #cfe2f3; font-family: "courier new", courier, monospace;">└── webfolder</span><br />
<span style="background-color: #cfe2f3; font-family: "courier new", courier, monospace;"><span style="white-space: pre;"> </span>└── index.php</span><br />
<br />
Content of the Dockerfile;</div>
</div>
<div>
<br /></div>
<div>
<div>
<span style="background-color: #fff2cc; font-family: "courier new", courier, monospace;">FROM php:7.4-apache</span></div>
<div>
<span style="background-color: #fff2cc; font-family: "courier new", courier, monospace;">COPY webfolder/ /var/www/html/</span></div>
<div>
<span style="background-color: #fff2cc; font-family: "courier new", courier, monospace;">EXPOSE 80</span><br />
<br />
Explanation for each line<br />
<br />
<span style="background-color: #fff2cc; font-family: "courier new", courier, monospace;">FROM php:7.4-apache</span><br />
<ul>
<li>php:7.4-apache based image selection</li>
</ul>
<span style="background-color: #fff2cc; font-family: "courier new", courier, monospace;">COPY webfolder/ /var/www/html/</span><br />
<ul>
<li>copy webfolder content into container /var/www/html/</li>
<li>Apache2 default web directory</li>
</ul>
<span style="background-color: #fff2cc; font-family: "courier new", courier, monospace;">EXPOSE 80</span><br />
<ul>
<li>expose port 80 to the host</li>
</ul>
Next lets build the docker image<br />
<br />
<span style="background-color: #f4cccc; font-family: "courier new", courier, monospace;">[root@localhost php_docker]# docker build --rm -t myphpdocker .</span><br />
<br />
docker build [OPTIONS] PATH | URL | -<br />
--rm = Remove intermediate containers after a successful build<br />
-t = Name and optionally a tag in the 'name:tag' format<br />
myphpdocker = docker container name<br />
. (single dot) = build path<br />
<br />
Check the built image<br />
<br />
<span style="background-color: #f4cccc; font-family: "courier new", courier, monospace;">[root@localhost php_docker]# docker image ls</span><br />
<br />
<span style="background-color: #d9ead3; font-family: "courier new", courier, monospace;">REPOSITORY TAG IMAGE ID CREATED SIZE</span><br />
<span style="background-color: #d9ead3; font-family: "courier new", courier, monospace;">myphpdocker latest 0c1fe5b1aa9e 47 minutes ago 414 MB</span><br />
<br />
Next is to run the docker<br />
<br />
docker run [OPTIONS] IMAGE[:TAG|@DIGEST] [COMMAND] [ARG...]<br />
-t = Allocate a pseudo-TTY<br />
-i = Keep STDIN open even if not attached<br />
-it = For interactive processes (like a shell), you must use -i -t together<br />
-p = Publish a container's port(s) to the host<br />
-d = Run container in background and print container ID<br />
<br />
Lets try the interactive mode first<br />
<br />
<span style="background-color: #f4cccc; font-family: "courier new", courier, monospace;">[root@localhost php_docker]# docker run -p 80:80 -it myphpdocker</span><br />
<br />
Apache log appear on the terminal.<br />
Open your browser and head to "http:/<host ip>/"<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjnRIDdKPPhMMXbwMcEooi1lB9tFgkBpG68EDQbAtCsmiw-98Rz6UkLRAixDUGLu4_ADXBnLL_TA0DCeeq3Oa4LzhI-9ro0KVKrUt3xffgI4QNxysHTLz6_QTl-nQ1yHYaT08E-2mxJa4d/s1600/Snap+2020-04-19+at+22.18.52.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="621" data-original-width="1482" height="267" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjnRIDdKPPhMMXbwMcEooi1lB9tFgkBpG68EDQbAtCsmiw-98Rz6UkLRAixDUGLu4_ADXBnLL_TA0DCeeq3Oa4LzhI-9ro0KVKrUt3xffgI4QNxysHTLz6_QTl-nQ1yHYaT08E-2mxJa4d/s640/Snap+2020-04-19+at+22.18.52.png" width="640" /></a></div>
<br />
Now try the detach mode<br />
<br />
<span style="background-color: #f4cccc; font-family: "courier new", courier, monospace;">[root@localhost php_docker]# docker run -p 80:80 -d myphpdocker</span><br />
<br />
Check the running container<br />
<br />
<span style="background-color: #f4cccc; font-family: "courier new", courier, monospace;">[root@localhost php_docker]# docker ps</span><br />
<br />
<span style="background-color: #d9ead3; font-family: "courier new", courier, monospace;">CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES</span><br />
<span style="background-color: #d9ead3; font-family: "courier new", courier, monospace;">4619304831d4 myphpdocker "docker-php-entryp..." 6 seconds ago Up 5 seconds 0.0.0.0:80->80/tcp frosty_tesla</span></div>
</div>
<div>
<br /></div>
leorickhttp://www.blogger.com/profile/12860324908477273661noreply@blogger.com0tag:blogger.com,1999:blog-1859734723707065827.post-61560387866291823652020-04-15T21:00:00.001+08:002020-04-15T21:00:55.629+08:00vLan on Realtek PCIe GBE FamilyDownload "Diagnostic Program for Win7/Win8/Win10" and install<br />
<br />
<a href="https://www.realtek.com/en/component/zoo/category/network-interface-controllers-10-100-1000m-gigabit-ethernet-pci-express-software">https://www.realtek.com/en/component/zoo/category/network-interface-controllers-10-100-1000m-gigabit-ethernet-pci-express-software</a><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_I3oaVE9HC5McL0CImdTwoV_eArspBdh-URkB2A-CfmlY9abtX0sCfIf8nCZScCe4RS-DtdOgDCoUbm0ZOhEr-BNxS9D0iT9NcAfda6zddFPiWFx5XVtcKb61mPhvJknYCpKdVbUKCrSk/s1600/Snap+2020-04-15+at+20.49.24.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="565" data-original-width="878" height="411" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_I3oaVE9HC5McL0CImdTwoV_eArspBdh-URkB2A-CfmlY9abtX0sCfIf8nCZScCe4RS-DtdOgDCoUbm0ZOhEr-BNxS9D0iT9NcAfda6zddFPiWFx5XVtcKb61mPhvJknYCpKdVbUKCrSk/s640/Snap+2020-04-15+at+20.49.24.png" width="640" /></a></div>
<br />
Select the Realtek NIC > VLAN and add accordinglyleorickhttp://www.blogger.com/profile/12860324908477273661noreply@blogger.com0tag:blogger.com,1999:blog-1859734723707065827.post-42949437565571425322015-11-13T21:46:00.001+08:002015-11-13T21:46:30.143+08:00HDD become write-protected<span itemprop="articleBody text"></span><br />
From <a href="http://www.pcworld.com/article/245174/restore_access_to_a_write_protected_hard_drive.html">PCWorld ...</a><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRSYIK3ZCA_54srelnJl6Vf29RuQVztkknd6sRVX0ub-YirMOn21StaJ20KAjoAUm8fldlVnnZiBj9TFX4X0ougUFPEj6vYoDZ9uoWUg8BXtNlFFx5mNRjhZFTfBlotnaW1n6dceJ_IWZQ/s1600/image0.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="204" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRSYIK3ZCA_54srelnJl6Vf29RuQVztkknd6sRVX0ub-YirMOn21StaJ20KAjoAUm8fldlVnnZiBj9TFX4X0ougUFPEj6vYoDZ9uoWUg8BXtNlFFx5mNRjhZFTfBlotnaW1n6dceJ_IWZQ/s320/image0.png" width="320" /></a></div>
<br />
<br />
1. Open a Command prompt by clicking <em>Start</em>, typing <strong>command</strong>, and clicking <em>Command Prompt</em>.<br />
2. Type <strong>diskpart</strong> and press <strong>Enter</strong>.<br />
3. Type <strong>list volume</strong> and press <strong>Enter</strong>.<br />
<aside class="nativo-promo smartphone tablet desktop" id=""> </aside>
4. Type <strong>select volume #</strong>, where # is the number of the drive that's giving you the "write-protected" error. In my case, I ended up typing <strong>select volume 3</strong>.<br />
5. Type <strong>attributes disk clear readonly</strong> and press <strong>Enter</strong>.<br />
6. Type <strong>exit</strong> and press <strong>Enter</strong>.<br />
leorickhttp://www.blogger.com/profile/12860324908477273661noreply@blogger.com0tag:blogger.com,1999:blog-1859734723707065827.post-66971925810477873832011-08-08T00:07:00.000+08:002011-08-08T00:07:39.766+08:00Wireless bridge with Riger DB108-WLFrom my previous post, I've successfully connected my TV the my PC but I want more. I trying to connect my TV to my home main network. But this time I got 2 nearly identical modems (diff. firmware maybe), Riger DB108-WL. This model has a feature call wireless bridge and decided to try it out.<br />
<br />
After several hours of trial and error, finally, I got it. Below are my settings/configurations that might help others.<br />
<br />
Only modem B is connected to the internet through ADSL.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5O6basl1ByD_WD36BOvv7b3ZdbQ-WEld933KghwT3d6ja0Xh8SlpGxBWMgHl7yIOQNUhkZSGi5rQgTs0qTVonZLkGg8GJ2NKqYPMwHVBeFsVOeLkNELndKbEa9F8iDTUBiR6Yb5VlGcJ1/s1600/wireless_bridge.gif" imageanchor="1" style=""><img border="0" height="320" width="280" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5O6basl1ByD_WD36BOvv7b3ZdbQ-WEld933KghwT3d6ja0Xh8SlpGxBWMgHl7yIOQNUhkZSGi5rQgTs0qTVonZLkGg8GJ2NKqYPMwHVBeFsVOeLkNELndKbEa9F8iDTUBiR6Yb5VlGcJ1/s320/wireless_bridge.gif" /></a></div><br />
<table style="width:100%;"><tr>
<th>Modem A Setting</th>
<th>Modem B Setting</th>
<th>*</th>
</tr>
<tr>
<td><br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1rky7JWoW5K5D6w6JBme-ytbQgpdc5eZUeld4JGlfqhLbnb1iWzpVDLL5qo0QhO_cDPxYVicsBc9mbvGX0GDAMXg_kDYzor1J4-r8Utf3xIW2SZbyh4O52xi67YMSaoznXtPPUpMmxwSv/s1600/modem_tv_side.jpg" imageanchor="1" style=""><img border="0" height="150" width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1rky7JWoW5K5D6w6JBme-ytbQgpdc5eZUeld4JGlfqhLbnb1iWzpVDLL5qo0QhO_cDPxYVicsBc9mbvGX0GDAMXg_kDYzor1J4-r8Utf3xIW2SZbyh4O52xi67YMSaoznXtPPUpMmxwSv/s200/modem_tv_side.jpg" /></a></div></td>
<td><br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbNZWWQp-jlP217pNrhpdHts_soBJiL3kn177sHYFinDePqtss_OkNaTiyrKqvhE0YGVTWLRV1GscTclVqVtF11B0S7St8AHJHmFkKwk3h4qz-QU8u2GQPA73tQFBUzNrsK-s1o7rmj-1R/s1600/db108-wl.JPG" imageanchor="1" style=""><img border="0" height="150" width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbNZWWQp-jlP217pNrhpdHts_soBJiL3kn177sHYFinDePqtss_OkNaTiyrKqvhE0YGVTWLRV1GscTclVqVtF11B0S7St8AHJHmFkKwk3h4qz-QU8u2GQPA73tQFBUzNrsK-s1o7rmj-1R/s200/db108-wl.JPG" /></a></div></td>
<td><br />
*<br />
</td>
</tr>
<tr>
<td><br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2PvRXV1Sv5qy1CQSecK76XvDhX9kzT06Ajfda3ZoTCYgiogKJdzKbktVoaRqeXl4f2IpDFIycxcduWVPRrrJshrt-wSJSQ0tJjw-3AOQcShT4Qz2gXRsLPlcFsFKzzoQLxAkJf8Njxut-/s1600/modem_b_chan.GIF" imageanchor="1" style=""><img border="0" height="150" width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2PvRXV1Sv5qy1CQSecK76XvDhX9kzT06Ajfda3ZoTCYgiogKJdzKbktVoaRqeXl4f2IpDFIycxcduWVPRrrJshrt-wSJSQ0tJjw-3AOQcShT4Qz2gXRsLPlcFsFKzzoQLxAkJf8Njxut-/s200/modem_b_chan.GIF" /></a></div></td>
<td><br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfZtGF4yIVzL0Bufd0EqdIj7Rro3qKCUsn-fA77lBY3XIxnX9K-T77epkb2imLE_8mr7ACr5kDaE5U2nyR7Zg8E82JXCKqBVUqG0tmQRbF4X3vZm-oArmvvvgRKacb6OjVHsvIaG8yBgSM/s1600/modem_a_chan.GIF" imageanchor="1" style=""><img border="0" height="150" width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfZtGF4yIVzL0Bufd0EqdIj7Rro3qKCUsn-fA77lBY3XIxnX9K-T77epkb2imLE_8mr7ACr5kDaE5U2nyR7Zg8E82JXCKqBVUqG0tmQRbF4X3vZm-oArmvvvgRKacb6OjVHsvIaG8yBgSM/s200/modem_a_chan.GIF" /></a></div></td>
<td><br />
Make sure both modems are on the same channel<br />
</td>
</tr>
<tr>
<td><br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrXiWV9GgKHf_Im0Yd2dbcNRqe-T1PDRzQlqBgyYeNwY333UwP-PS999AekT7Eoo-08WKehqM1cUKTX0CZnM-ITazF11A6YDuKMdFH7JviSWAhIpKhtzzpZh9dEsMhqO8rLCIsVHiMGO2Q/s1600/modem_b_sec.GIF" imageanchor="1" style=""><img border="0" height="150" width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrXiWV9GgKHf_Im0Yd2dbcNRqe-T1PDRzQlqBgyYeNwY333UwP-PS999AekT7Eoo-08WKehqM1cUKTX0CZnM-ITazF11A6YDuKMdFH7JviSWAhIpKhtzzpZh9dEsMhqO8rLCIsVHiMGO2Q/s200/modem_b_sec.GIF" /></a></div></td>
<td><br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOCBuGC_hRCQaMf2_fod2WwhdHN__TsCQSVoqYYkqeGmz6KJGwLtNe6OBPwTJk2AObOCT99GI_cfkxqMrTbUDj04fE9Pgk6cMYdh-RTzgcujuqyn9-FiCgLZSjGrlWEcslkF5SxKLDpwR5/s1600/modem_a_sec.GIF" imageanchor="1" style=""><img border="0" height="150" width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOCBuGC_hRCQaMf2_fod2WwhdHN__TsCQSVoqYYkqeGmz6KJGwLtNe6OBPwTJk2AObOCT99GI_cfkxqMrTbUDj04fE9Pgk6cMYdh-RTzgcujuqyn9-FiCgLZSjGrlWEcslkF5SxKLDpwR5/s200/modem_a_sec.GIF" /></a></div></td>
<td><br />
Make sure they have same security settings.<br />
</td>
</tr>
<tr>
<td><br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdE476qTJ_akXtcDhfbzJitqAc6uxZt4RexR_LqqB209DqAUqzXRwBmITbaYGB4Kc4z-UDjVIyFuUQm9eumk_QuX1GSCA37Jy99a9-EntPyqYIfFM3N01iuMa3OpbajqJhpFrhkUsXF5bf/s1600/modem_b_bridge.GIF" imageanchor="1" style=""><img border="0" height="150" width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdE476qTJ_akXtcDhfbzJitqAc6uxZt4RexR_LqqB209DqAUqzXRwBmITbaYGB4Kc4z-UDjVIyFuUQm9eumk_QuX1GSCA37Jy99a9-EntPyqYIfFM3N01iuMa3OpbajqJhpFrhkUsXF5bf/s200/modem_b_bridge.GIF" /></a></div></td>
<td><br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgW8MsKObnZ6KOjMZlyOQMFTVdL7JFd4fodBJDI9oV7lB5cU07QMsVLhPqjDZbQibyNmtEX_KIhcAi-Orehvf1uTeSzgb-tc-yAD0ZqFNBBn9ng91V3UMwKTeOmXQtds3N5fKwHG0IeuvY0/s1600/modem_a_bridge.GIF" imageanchor="1" style=""><img border="0" height="150" width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgW8MsKObnZ6KOjMZlyOQMFTVdL7JFd4fodBJDI9oV7lB5cU07QMsVLhPqjDZbQibyNmtEX_KIhcAi-Orehvf1uTeSzgb-tc-yAD0ZqFNBBn9ng91V3UMwKTeOmXQtds3N5fKwHG0IeuvY0/s200/modem_a_bridge.GIF" /></a></div></td>
<td><br />
Set modem A AP mode as access point, modem B AP mode as wireless bridge,<br />
</td>
</tr>
</table>At the wireless bridge setting. make sure modem A has modem B BSSID (MAC address of the wireless access point) and same goes to modem B (add modem A BSSID). Try to use the "Bridge Restrict: Enable(Scan)" drop button to scan for available modems.<br />
<br />
After all settings are there, save and reboot both modems.<br />
<br />
If all goes well, any device connected to modem b will be bridged to modem A (IP assign by modem A DHCP).<br />
<br />
I notice at this point (when the bridge is on) modem B IP is no longer available. I could not find it anymore. The only way to find it (to enter the modem console for example) is to reset it. The modem B LAN port would not help since anything connected to modem B Ethernet port will be bridge to modem A.leorickhttp://www.blogger.com/profile/12860324908477273661noreply@blogger.com2tag:blogger.com,1999:blog-1859734723707065827.post-75801496044779393562011-07-28T20:13:00.000+08:002011-07-28T20:13:52.730+08:00Signing Java JAR FilesFrom coderanch (<a href="http://www.coderanch.com/t/407490/java/java/why-jarsigner">http://www.coderanch.com/t/407490/java/java/why-jarsigner</a>)<br />
<br />
<i>Signing a jar is basically used to verify a trusted source. When you sign a jar with your digital signature (based on your private key), you place a mark into the jar file that could not have been done by anyone but you.<br />
<br />
The signature is also a checksum of the Jar file, so if the jar get corrupted or modified in transit, the signature is invalid.<br />
<br />
On the other side, your public key is placed into the keystore of the system that trust you. This will be used to verify your signature.<br />
<br />
Currently, I believe this is mainly used for applets. Using signed jar files, and setting security properties on client browsers, applets can have access to disk, network, and other stuff that they don't normally have access to.</i><br />
<br />
<b>Step 1 - Create Key</b><br />
<pre class="brush:plain;">keytool -genkey -keystore <keystorefile> -alias <aliasname>
</pre>example<br />
<pre class="brush:plain;">C:\folder>keytool -genkey -keystore mykeystore -alias myalias
Enter keystore password:
Re-enter new password:
What is your first and last name?
[Unknown]: MyName
What is the name of your organizational unit?
[Unknown]: MyOrg
What is the name of your organization?
[Unknown]: MyOrg
What is the name of your City or Locality?
[Unknown]: MyCity
What is the name of your State or Province?
[Unknown]: MyProvince
What is the two-letter country code for this unit?
[Unknown]: my
Is CN=MyName, OU=MyOrg, O=MyOrg, L=MyCity, ST=MyProvince, C=my correct?
[no]: yes
Enter key password for <myalias>
(RETURN if same as keystore password):
Re-enter new password:
</pre><br />
<b>Step 2 - Export Cert</b><br />
<pre class="brush:plain;">keytool -export -keystore <keyStoreFile> -alias <aliasName> > <certFile>
</pre>example<br />
<pre class="brush:plain;">C:\folder>keytool -export -keystore mykeystore -alias mylias > mycert
Enter keystore password: mypassword
</pre><br />
<b>Step 3 - Signing JAR</b><br />
<pre class="brush:plain;">jarsigner -keystore <keyStoreFile> -storepass <password> <jarFile> <aliasName>
</pre>example<br />
<pre class="brush:plain;">C:\folder>jarsigner -keystore mykeystore -storepass password my.jar myalias
Warning:
The signer certificate will expire within six months.
</pre><br />
<b>Step 4 - Verify</b><br />
<pre class="brush:plain;">jarsigner -verify -verbose -certs <jarFile>
</pre>example<br />
<pre class="brush:plain;">C:\folder>jarsigner -verify -verbose -certs my.jar
...
sm 236 Sun Feb 06 21:57:00 SGT 2011 images/remove.png
X.509, CN=MyName, OU=MyOrg, O=MyOrg, L=MyCity, ST=MyProvince, C=my
[certificate will expire on 10/26/11 7:46 PM]
...
s = signature was verified
m = entry is listed in manifest
k = at least one certificate was found in keystore
i = at least one certificate was found in identity scope
jar verified.
Warning:
This jar contains entries whose signer certificate will expire within six months.
</pre>leorickhttp://www.blogger.com/profile/12860324908477273661noreply@blogger.com0tag:blogger.com,1999:blog-1859734723707065827.post-21956027514933077212011-07-20T00:51:00.001+08:002011-07-20T00:52:52.242+08:00Samsung LED TV Network Connection<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiy2aDR1dYjus1iCD6RLz17k7ddcUQBAAyjskJFchbY37QePt516TZQJWWaumvebUC9edwdpFx8eVzc3-jYUgbktg_xWEoy8ZTEcDDEqpXnq2tNdi4nA33NQ3p_h77F2G26XWAfiKzvB4Ao/s1600/the_tv.jpg" imageanchor="1"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiy2aDR1dYjus1iCD6RLz17k7ddcUQBAAyjskJFchbY37QePt516TZQJWWaumvebUC9edwdpFx8eVzc3-jYUgbktg_xWEoy8ZTEcDDEqpXnq2tNdi4nA33NQ3p_h77F2G26XWAfiKzvB4Ao/s320/the_tv.jpg" width="320" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1qw4ZymQNDxhzmLBwmka2DfUvQoK_E7t1trsmppM9ZWT0aP9HZc3YUD1KYfeTs-BwH_GABn-Jj70-cz_DmmoteKjOrQidefODSaCMckpWpGz5fFfdRJ9ntap_HzH68zaUyqe8MB1iKv45/s1600/tv_back.jpg" imageanchor="1"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1qw4ZymQNDxhzmLBwmka2DfUvQoK_E7t1trsmppM9ZWT0aP9HZc3YUD1KYfeTs-BwH_GABn-Jj70-cz_DmmoteKjOrQidefODSaCMckpWpGz5fFfdRJ9ntap_HzH68zaUyqe8MB1iKv45/s320/tv_back.jpg" width="320" /></a><br />
<br />
Last week, I bought Samsung UA40D5000PR LED Backlit TV. It comes with wireless LAN adapter support but need to have Samsung LinkStick Wireless USB 2.0 Adapter in order for it to works. It also has an Ethernet port for wired network connection.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGchPbHvMcv3a9x1vs5cd8w-30kOdHJ3-qJtY7Dm9T7zx_VmASI38SeLdrS-LsPfb-tvrvUbGPT_mYzJb13CTRT_o4wT2LuLhvT6CY5e7wd8ieaqjCYpGk-JuFdvzjAha1MVT4LlHy5Kgt/s1600/linkstick.jpg" imageanchor="1"><img border="0" height="234" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGchPbHvMcv3a9x1vs5cd8w-30kOdHJ3-qJtY7Dm9T7zx_VmASI38SeLdrS-LsPfb-tvrvUbGPT_mYzJb13CTRT_o4wT2LuLhvT6CY5e7wd8ieaqjCYpGk-JuFdvzjAha1MVT4LlHy5Kgt/s320/linkstick.jpg" width="234" /></a><br />
<br />
To utilize the network feature, I probably need to buy the LinkStick or lay a network cable from the TV along the way to my computer room.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEic6AR_iQFznqz1K91B14D69PU_wAUjzTNUtlpxzcYX7C5rQnGnNvyzDjHWELra6Fvv-rsvIZaZDSd7vXes2qQdspQ5QRk5ATV1VO1iWvQEgQQx_-ZRzA-AuK8W-JE0R-5U2n5I4wyPOIV0/s1600/dsl605ew.jpg" imageanchor="1"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEic6AR_iQFznqz1K91B14D69PU_wAUjzTNUtlpxzcYX7C5rQnGnNvyzDjHWELra6Fvv-rsvIZaZDSd7vXes2qQdspQ5QRk5ATV1VO1iWvQEgQQx_-ZRzA-AuK8W-JE0R-5U2n5I4wyPOIV0/s320/dsl605ew.jpg" width="320" /></a><br />
<br />
So I'll go with the 3rd option, using old ADSL modem (Aztech DSL605EW) with built-in wireless and 4 Ethernet ports. This is the same modem that I used in previous <a href="http://xp-rience.blogspot.com/2011/01/wireless-adsl-modem-to-access-point.html">blog post</a>, broken ADSL circuit.<br />
<br />
Reset the modem to factory default setting and set your wireless security accordingly.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQfmBRYnISDkIl5Y9ZGUmgFGbdZPg_E_BtRo1LeNi_ZAC6zsLkJrOy6A1vT9FljKoNy0MIf92Qf3QLdDsVk6o3j9RiEpCJZLLD0PeyNXcY6TflFjt1AqcGSarz7MnNJWXD2pHDIvvQ9CDG/s1600/len_conn.jpg" imageanchor="1"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQfmBRYnISDkIl5Y9ZGUmgFGbdZPg_E_BtRo1LeNi_ZAC6zsLkJrOy6A1vT9FljKoNy0MIf92Qf3QLdDsVk6o3j9RiEpCJZLLD0PeyNXcY6TflFjt1AqcGSarz7MnNJWXD2pHDIvvQ9CDG/s320/len_conn.jpg" width="320" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8FQUJhQT1zJq9RklnQJxZPF2vwlH6h8Ktr4k3M_PYGuE0VIJJpDFq-XOUNjIR7Zf513d_wlOB7CsGUCA9QdshsDfgmF1wsTM67_3V4HUwxl5n6KMYZWZSqKkDo4TnSSKr-nCyMUDft8zy/s1600/set_ip1.jpg" imageanchor="1"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8FQUJhQT1zJq9RklnQJxZPF2vwlH6h8Ktr4k3M_PYGuE0VIJJpDFq-XOUNjIR7Zf513d_wlOB7CsGUCA9QdshsDfgmF1wsTM67_3V4HUwxl5n6KMYZWZSqKkDo4TnSSKr-nCyMUDft8zy/s320/set_ip1.jpg" width="320" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWcZkSoEdSjd3mRujiy5ZTjs_tdGyDz_Z9rOvHIgFZo2UHbZm3JN7pO52Lvyybs2kX9teHIl8X6b-ROh92PcNWHq6m09hcXZJVSM-T7t23E-YzHYv-l2YGdVIY11bbq-RqJa20h4xacTUh/s1600/set_ip2.jpg" imageanchor="1"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWcZkSoEdSjd3mRujiy5ZTjs_tdGyDz_Z9rOvHIgFZo2UHbZm3JN7pO52Lvyybs2kX9teHIl8X6b-ROh92PcNWHq6m09hcXZJVSM-T7t23E-YzHYv-l2YGdVIY11bbq-RqJa20h4xacTUh/s320/set_ip2.jpg" width="320" /></a><br />
<br />
Hook up the TV with the ADSL modem through an Ethernet cable. Set the TV network configuration; let the modem DHCP assign the IP.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLwpXNp3E3_Qbx-yGS6MmSWaXX0i3747pD3YFQrk6nYSeM_hjrQVep2T6Bw2OxcXFbGOvm_5d0em4OnXZoMlZ1-8Jm-BfUCyVNvgNKQyOkQJ5tsTZcPwheTvKicLzra3JKegiIubx0ehjm/s1600/all_share_scr_shot.jpg" imageanchor="1"><img border="0" height="187" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLwpXNp3E3_Qbx-yGS6MmSWaXX0i3747pD3YFQrk6nYSeM_hjrQVep2T6Bw2OxcXFbGOvm_5d0em4OnXZoMlZ1-8Jm-BfUCyVNvgNKQyOkQJ5tsTZcPwheTvKicLzra3JKegiIubx0ehjm/s320/all_share_scr_shot.jpg" width="320" /></a><br />
<br />
At PC, download Samsung AllShare software, install it and follow the instruction to add video files to it's library.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOUXB7gtQQr4iml3I44aq9l3irfs0G-655Eic5xy3k2oeojo1WruPnpZjE_luI4m53fe5h5MdAuDDXp1Ria_6M7QNB5MwZjdRDfMABPmqIX2-wLYaa9nDtQ7sVCJexDO4oeSDxS6ORvMDH/s1600/connect.png" imageanchor="1"><img border="0" height="217" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOUXB7gtQQr4iml3I44aq9l3irfs0G-655Eic5xy3k2oeojo1WruPnpZjE_luI4m53fe5h5MdAuDDXp1Ria_6M7QNB5MwZjdRDfMABPmqIX2-wLYaa9nDtQ7sVCJexDO4oeSDxS6ORvMDH/s320/connect.png" width="320" /></a><br />
<br />
Next is to connect from PC (from another floor) to the ADSL modem<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhj4HKO6DbwjfJ9GUP4K4uY_M5IPjOOz-PZiyeuPQ6jZhKBJrcyD9NWCgDFZgaKMDB517feS8oHa4FWdJADdTbINM6iICCklYsErjqSHxn2BnuT3TwakOzCpbKaUZQgZKPitcMpq6tzEHh-/s1600/iw4.jpg" imageanchor="1"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhj4HKO6DbwjfJ9GUP4K4uY_M5IPjOOz-PZiyeuPQ6jZhKBJrcyD9NWCgDFZgaKMDB517feS8oHa4FWdJADdTbINM6iICCklYsErjqSHxn2BnuT3TwakOzCpbKaUZQgZKPitcMpq6tzEHh-/s320/iw4.jpg" width="320" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvok1NNQZHliNCgCBQFcbytLYeteE8Lw6z8eSog05OZot4in5eLPjt6uc2dEhyc0W4UU3xaaYFUAMGA3PQHFtaMMCqRK49aR5sojI0iAZhtTSOWcA9CUFnLsvlvgQJxYbwY-URA16dGalP/s1600/iw1.jpg" imageanchor="1"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvok1NNQZHliNCgCBQFcbytLYeteE8Lw6z8eSog05OZot4in5eLPjt6uc2dEhyc0W4UU3xaaYFUAMGA3PQHFtaMMCqRK49aR5sojI0iAZhtTSOWcA9CUFnLsvlvgQJxYbwY-URA16dGalP/s320/iw1.jpg" width="320" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSSdOWsvSCICuObMGmYDzMwDkmyZ4PVovuYDSXlqNbyBQ9texZk52yOwJJlcvifkOFVFgztmwXlJvn-YTfkFQ1b2R-9NTyQQ4piIEMUmiZ6FjqTeXi3AmJzyvKvCuSJ0qs89mF-HN53Is9/s1600/iw2.jpg" imageanchor="1"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSSdOWsvSCICuObMGmYDzMwDkmyZ4PVovuYDSXlqNbyBQ9texZk52yOwJJlcvifkOFVFgztmwXlJvn-YTfkFQ1b2R-9NTyQQ4piIEMUmiZ6FjqTeXi3AmJzyvKvCuSJ0qs89mF-HN53Is9/s320/iw2.jpg" width="320" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPUf5mON2dksoA2UL4RdFUEByykXVNTn3CnzxzEpDuHLtlHU46g8gAEqhNwsCA8ENogInjGQ0NFgc0kcjOFdRz5opcuQevyqjg6mwHAxwnlV9Wom1PMTY6gxalGQrJVlVl5vC5BBLuKxkO/s1600/iw3.jpg" imageanchor="1"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPUf5mON2dksoA2UL4RdFUEByykXVNTn3CnzxzEpDuHLtlHU46g8gAEqhNwsCA8ENogInjGQ0NFgc0kcjOFdRz5opcuQevyqjg6mwHAxwnlV9Wom1PMTY6gxalGQrJVlVl5vC5BBLuKxkO/s320/iw3.jpg" width="320" /></a><br />
<br />
It works. This would be my temporary method to link my TV to my PC.<br />
<br />
My next step is to link the TV to not only my PC, but to my home network which linked to my Network Attached Storage that supports DLNA for media sharing. That would be fun.<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3zMVKf6YBLxmkz-I373hMhcn_QbyCMl7JKopuLj5ErmgeFjwXnY6UC0lbisJScyKGKEuq3LH4bvKaB8FeY_JMitrkjmNJ9RV96Mn8ictrq1WeTSrA-UqJ5Nnz3zcPdQGT7s1AzBmWhiOc/s1600/HL280E_main.gif" imageanchor="1"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3zMVKf6YBLxmkz-I373hMhcn_QbyCMl7JKopuLj5ErmgeFjwXnY6UC0lbisJScyKGKEuq3LH4bvKaB8FeY_JMitrkjmNJ9RV96Mn8ictrq1WeTSrA-UqJ5Nnz3zcPdQGT7s1AzBmWhiOc/s320/HL280E_main.gif" width="226" /></a><br />
<br />
I’m not planning to use WiFi since we have a lot of Wifi Hunter here. I’ll rather go with homeplug but not sure which model/speed to choose. I can see 85Mbps, 200Mbps, 500Mbps and 1000Mbps on the market. Any suggestion?leorickhttp://www.blogger.com/profile/12860324908477273661noreply@blogger.com4tag:blogger.com,1999:blog-1859734723707065827.post-7527403968138863642011-01-02T00:40:00.001+08:002011-01-02T00:50:03.577+08:00Garmin Mobile PC and Nokia E72Referring to <a href="http://tinggiisland.blogspot.com/2010/07/garmin-mobile-pc.html">Tinggi Island Travel</a> and <a href="http://www.noeman.org/gsm/garmin-tutorials/151815-how-use-your-nokia-phone-gps-receiver-garmin-mobile-pc.html">Noeman.org</a> on how to link between Garmin Mobile PC and Nokia phone, here is my version of setup and configuration using Nokia E72.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirN49dPhN2XhsKxJu6oO0evQlIh5ZQexJRLKeiXCox2fI3yHlZvXcWaNSGLwEz2BQio6jnpIhWm9yNFjP0pNNkFlyyBRWOc9Gxi341FNXHSJdq4j6h8NFPZm-2wVlvD88jtRGBBmCI0QEJ/s1600/finally.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirN49dPhN2XhsKxJu6oO0evQlIh5ZQexJRLKeiXCox2fI3yHlZvXcWaNSGLwEz2BQio6jnpIhWm9yNFjP0pNNkFlyyBRWOc9Gxi341FNXHSJdq4j6h8NFPZm-2wVlvD88jtRGBBmCI0QEJ/s200/finally.jpg" width="150" /></a><br />
<br />
Step 1 - install Garmin Mobile PC.<br />
Step 2 - install ExtGps from <a href="http://www.google.com.my/search?hl=&q=extgps&sourceid=navclient-ff&rlz=1B3GGGL_enMY331MY331&ie=UTF-8">Symarctic</a> (to your Phone).<br />
Step 3 - start ExtGps (at your Phone).<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhM-ZDXVSbdCmrEkroUdjvG7LCxJazjnzRb-vF2JuSICuzBkYneZGmVCQUyvTO3z6ULpCcjIUJ0AXbLNQbYesSDMcog0fmZstE9nUsH1WIeqwRC6uKMJPw6KYWgwSU4H6UuAz316Skkn7vr/s1600/extgps_1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhM-ZDXVSbdCmrEkroUdjvG7LCxJazjnzRb-vF2JuSICuzBkYneZGmVCQUyvTO3z6ULpCcjIUJ0AXbLNQbYesSDMcog0fmZstE9nUsH1WIeqwRC6uKMJPw6KYWgwSU4H6UuAz316Skkn7vr/s200/extgps_1.jpg" width="196" /></a><br />
<br />
Step 4 - Open bluetooth setting from systray icon.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEbXrCYy-Ipj8c1zWWQq3yo-sKWgdL5HkihD3yMbJ2YeBci2ypVNnGYL3wlnwAMcyyuSp-HS9198DmbTcePceiQCosEj8xu0UUQu49ABvQdZ3-nK7RANXwlQE0st-VUGR-Yk6n3R24uPAb/s1600/bt_conf_1.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="120" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEbXrCYy-Ipj8c1zWWQq3yo-sKWgdL5HkihD3yMbJ2YeBci2ypVNnGYL3wlnwAMcyyuSp-HS9198DmbTcePceiQCosEj8xu0UUQu49ABvQdZ3-nK7RANXwlQE0st-VUGR-Yk6n3R24uPAb/s200/bt_conf_1.gif" width="200" /></a><br />
<br />
Step 5 - select your phone, I assume that it has been paired with your PC.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizQvvwOiQK5BplWYRo12pAKJl-KSD5qV-K_eDrggSc2lJBSZEe8_s9pPlmxPyB97BI9YXXgHBntAmeWBNseI_CA29BLX6f-1rjBhzeFxYEG_twHEixL6Gks8XQUMDj9onLOoLzceMOYlAt/s1600/bt_conf_2.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizQvvwOiQK5BplWYRo12pAKJl-KSD5qV-K_eDrggSc2lJBSZEe8_s9pPlmxPyB97BI9YXXgHBntAmeWBNseI_CA29BLX6f-1rjBhzeFxYEG_twHEixL6Gks8XQUMDj9onLOoLzceMOYlAt/s200/bt_conf_2.gif" width="162" /></a><br />
<br />
Step 6 - go to the services tab and find SPP, tick the check box and note down the comport number.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLEwlPmLm_wWQAJtLvTEeusBCaU9KJOiM7zdB-c5Qzt5FvRdDq5Y70jkX3JNAOxAOhysovvfaNnMxQMer4NnLYFP3Ufkrt8hkIvuDvgy8npzhYbzx8kDl4esA13PQ3ytG0Av3M8nyZJ6-1/s1600/bt_conf_3.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLEwlPmLm_wWQAJtLvTEeusBCaU9KJOiM7zdB-c5Qzt5FvRdDq5Y70jkX3JNAOxAOhysovvfaNnMxQMer4NnLYFP3Ufkrt8hkIvuDvgy8npzhYbzx8kDl4esA13PQ3ytG0Av3M8nyZJ6-1/s200/bt_conf_3.gif" width="162" /></a><br />
<br />
Step 7 - start Garmin Mobile PC and click at the satellite icon.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKGxCHpKygaHzkoSDYylbEeb1jeL09xhjLRTRpC2JyvGduSob1ZwTbco0VZWoZW1C1zYwXh46iSzwY4RBbFBLAX6ldYlWdfmZ7fQfK0WZrmuCVYT8n_A-SuiBcjBBWvlPWUAFwXx4fpQGK/s1600/gmpc_1.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="113" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKGxCHpKygaHzkoSDYylbEeb1jeL09xhjLRTRpC2JyvGduSob1ZwTbco0VZWoZW1C1zYwXh46iSzwY4RBbFBLAX6ldYlWdfmZ7fQfK0WZrmuCVYT8n_A-SuiBcjBBWvlPWUAFwXx4fpQGK/s200/gmpc_1.gif" width="200" /></a><br />
<br />
Step 8 - click disable to bring up the device selection radio button.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhK1KtjdSFGKrrbCSiesWiBkaiAtqKHVTJfzvWwynTUO1lPocuknU2IqQHjav1BjVE69XQWwLyX2_uMTqC4iFRVCanmGqvPMGr_xkRSufZSiXOfe5acLmdWAU_OUqPiqIk_AnpyI6myCCK0/s1600/gmpc_2.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="113" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhK1KtjdSFGKrrbCSiesWiBkaiAtqKHVTJfzvWwynTUO1lPocuknU2IqQHjav1BjVE69XQWwLyX2_uMTqC4iFRVCanmGqvPMGr_xkRSufZSiXOfe5acLmdWAU_OUqPiqIk_AnpyI6myCCK0/s200/gmpc_2.gif" width="200" /></a><br />
<br />
Step 9 - select the same comport from step 6.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPDdxecTPD8kXJ5E8QNXka43Z690BtcuZfMB3Lb1O1FynuEj4MO3Jkn-bMgCWblQQexkrqkMpsV2saGsGV47Y0CTl4Rq8zrrrSnxMOWIJ1FleeEHvPk0IbyVXC99j3vEh_7uG7IsH7r76E/s1600/gmpc_3.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="113" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPDdxecTPD8kXJ5E8QNXka43Z690BtcuZfMB3Lb1O1FynuEj4MO3Jkn-bMgCWblQQexkrqkMpsV2saGsGV47Y0CTl4Rq8zrrrSnxMOWIJ1FleeEHvPk0IbyVXC99j3vEh_7uG7IsH7r76E/s200/gmpc_3.gif" width="200" /></a><br />
<br />
Done, now you are ready to navigate with a larger display.<br />
Of course our could not travel with your desktop turn on.<br />
Get a notebook/netbook.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaqQjPJtonGaCO-bl4KBuyEFzJkBKEfwMDn2GR168N3y3GSiefckOOcb5IRitSN2EXD-zx26XH0juAt9wW-q4bNc9Yf72jVj6POkr1jeR_-HIBcv66vxDaFZ4Ws3R7R1tv04gwRNQafwEX/s1600/gmpc_5.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="113" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaqQjPJtonGaCO-bl4KBuyEFzJkBKEfwMDn2GR168N3y3GSiefckOOcb5IRitSN2EXD-zx26XH0juAt9wW-q4bNc9Yf72jVj6POkr1jeR_-HIBcv66vxDaFZ4Ws3R7R1tv04gwRNQafwEX/s200/gmpc_5.gif" width="200" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgA-UHMAKQFY8Uq4oa_B2UT6SUxN5rE2L_59E85O8MUUAbsSdmNWLq2wpq-vfBC8YKFkCDkxoVqNksWKkeuJcRI4DYQLOyf5RnkzHPv57uY2ze8zMDQbpGdXmMyAzwZi8rAQqAg2b5eX9tj/s1600/gmpc_4.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="113" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgA-UHMAKQFY8Uq4oa_B2UT6SUxN5rE2L_59E85O8MUUAbsSdmNWLq2wpq-vfBC8YKFkCDkxoVqNksWKkeuJcRI4DYQLOyf5RnkzHPv57uY2ze8zMDQbpGdXmMyAzwZi8rAQqAg2b5eX9tj/s200/gmpc_4.gif" width="200" /></a>leorickhttp://www.blogger.com/profile/12860324908477273661noreply@blogger.com1tag:blogger.com,1999:blog-1859734723707065827.post-61510368007478856032011-01-01T01:21:00.005+08:002011-07-16T23:17:29.898+08:00Using old Wireless ADSL Modem as a DIY Access Point<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiH0uqlGx1FLTmGmJMZWYJ2-7MDkBmX2OnWp6JtYFURxDGbC5g08QjP3ilDOe_Y47OinIBgs7yYYleXlHcWv9zFkUFv6ol1v2doRlfz7BBDooxWEEK-pSxzq2K0IgF7vOWXgjAs8LqbMJxd/s1600/curr_conf.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiH0uqlGx1FLTmGmJMZWYJ2-7MDkBmX2OnWp6JtYFURxDGbC5g08QjP3ilDOe_Y47OinIBgs7yYYleXlHcWv9zFkUFv6ol1v2doRlfz7BBDooxWEEK-pSxzq2K0IgF7vOWXgjAs8LqbMJxd/s200/curr_conf.png" width="98" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSi8d7NlrhuNW6d41jxvm4vJ4lnhOitpLG-LR8A9OzQK4WYoelg9BkaPsBY7huYQNZ7GOTaoWs0FGG1GJbpr5XGLqOExvVn_rhy_SXb6fQaLEzmL9IXbCuskyJYpL6A042V3VilYadxXoG/s1600/DSC00071.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="150" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSi8d7NlrhuNW6d41jxvm4vJ4lnhOitpLG-LR8A9OzQK4WYoelg9BkaPsBY7huYQNZ7GOTaoWs0FGG1GJbpr5XGLqOExvVn_rhy_SXb6fQaLEzmL9IXbCuskyJYpL6A042V3VilYadxXoG/s200/DSC00071.JPG" width="200" /></a><br />
<br />
My current home network configuration is using ISP supplied ADSL modem that comes without wireless. It connect to a cheap unmanaged switch through a crossover cable and distribute it to 2 PCs.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEge56H7NMBWtdVK2XpNj2oxmbJsCHpW3wA-IDX35L-4SM7CCPjD_mS62krOqtLsFVBGq28DwWajcpaqIrLF5BHVtUHP0b5Xt34OAC2TX2fy3unuQxOfTbWOjPigUqqZFB9-BIVVN9wWp30A/s1600/db108-wl_back.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="150" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEge56H7NMBWtdVK2XpNj2oxmbJsCHpW3wA-IDX35L-4SM7CCPjD_mS62krOqtLsFVBGq28DwWajcpaqIrLF5BHVtUHP0b5Xt34OAC2TX2fy3unuQxOfTbWOjPigUqqZFB9-BIVVN9wWp30A/s200/db108-wl_back.JPG" width="200" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhO96rWAA1IZNF1Jgv0zWLLIa4amVkiFZBxQ84uzOA3Jjwt3_odnDpXrf6j0no-3GciI_ryMqfPzffsMXnibxt5dO-19AtYHBpVR8pWtE0ReFHCMTgt2Svi2cb7zP9Vwl9Wde1bAX-_0ygE/s1600/db108-wl.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="150" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhO96rWAA1IZNF1Jgv0zWLLIa4amVkiFZBxQ84uzOA3Jjwt3_odnDpXrf6j0no-3GciI_ryMqfPzffsMXnibxt5dO-19AtYHBpVR8pWtE0ReFHCMTgt2Svi2cb7zP9Vwl9Wde1bAX-_0ygE/s200/db108-wl.JPG" width="200" /></a><br />
<br />
I also have a broken ADSL modem (Riger DB108-WL) that comes with wireless capability. The only thing is, the ADSL circuit is broken. So this is where this idea comes out. How to use the spare wireless circuit with my current network configuration. I thought it will be complicated but when I give a try, it was not that hard. Just a couple of simple steps will do.<br />
<br />
The main idea are to; <br />
<ul><li>give the wireless device a fix IP</li>
<li>turn it DHCP server off </li>
<li>hook it up to the existing switch using crossover cable</li>
<li>set the gateway IP pointing to the current ADSL modem. </li>
</ul>I assume you already know how to browse the wireless device <a href="http://xp-rience.blogspot.com/2008/07/web-based-http-management-gui.html">web management page</a>. Riger DB108-WL default user:pass is tmadmin:tmadmin<br />
<br />
Part 1, to make it easy, just reset the wireless device to factory default through the pinhole. Then hook it directly to your PC using standard network cable. Set its IP for example, my current ADSL modem is set to 192.168.100.1. So the wireless device IP should be set to the same network segment, let say 192.168.100.50. Next, turn of its DHCP server since we want to let the current ADSL modem to control the host distribution. Now save and reboot the wireless device.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCg6_vLAJVNQISKAjqVn6pHUT0nRmTXXg3CFdY2kckv0HKR1MoOOJPwT4VGXDxQNya-uLMff9Ci0xBSOdVR7QfAebncbvLi9SY29VE2gNhb9myeiFQsdoS6Zus13SJ-mqZ5RvSCE0EZ5KV/s1600/lan_conf.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="187" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCg6_vLAJVNQISKAjqVn6pHUT0nRmTXXg3CFdY2kckv0HKR1MoOOJPwT4VGXDxQNya-uLMff9Ci0xBSOdVR7QfAebncbvLi9SY29VE2gNhb9myeiFQsdoS6Zus13SJ-mqZ5RvSCE0EZ5KV/s200/lan_conf.gif" width="200" /></a></div><br />
Part 2, Now the IP of the wireless device has changed. Disconnect it from your PC and hook it to the switch with crossover cable. Hook your PC back to the switch. Now turn on your wireless device and browse to its web management page. Set the gateway so that it point to the current ADSL modem (in my case, 192.168.100.1).<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaZVHoXqQkc5iFlCADs0on_TRmOKTNkoiXza64SxUrBnEj7uhIrIPpQn0vG90SRL-mW8jH1vX6JJoUJpUzI3msEgQQ2Oe3BVpSQFW4qbBeHPBzxwvnmaTAAh3hVwjUxMell6idspVw9j3S/s1600/gateway_conf.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="128" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaZVHoXqQkc5iFlCADs0on_TRmOKTNkoiXza64SxUrBnEj7uhIrIPpQn0vG90SRL-mW8jH1vX6JJoUJpUzI3msEgQQ2Oe3BVpSQFW4qbBeHPBzxwvnmaTAAh3hVwjUxMell6idspVw9j3S/s200/gateway_conf.gif" width="200" /></a></div><br />
Now the wireless device is converted to wireless access point and ready to accept wireless connection.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJdMwS0Ci5A8lKX7beR2WsdjGe0aeGwxBhYKMY9T4TMNIVnucJ7wj0PAOAOxaxfD5HS2sfIX_nq8Y1dYiVs135qfZ2tfnWukfDeA-4c3b5SLZrUXnH89MNyxa0cnq9y2qN66h5ghpvv2Bk/s1600/overall_conf.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="278" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJdMwS0Ci5A8lKX7beR2WsdjGe0aeGwxBhYKMY9T4TMNIVnucJ7wj0PAOAOxaxfD5HS2sfIX_nq8Y1dYiVs135qfZ2tfnWukfDeA-4c3b5SLZrUXnH89MNyxa0cnq9y2qN66h5ghpvv2Bk/s320/overall_conf.png" width="320" /></a></div><br />
The best part of using this configuration is, you can turn off wireless independently without need to browse the web management page. Just turn the wireless device power off.<br />
<br />
**update**<br />
<br />
For DSL605EW, please refer to screenshots below.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkbDxtKzZlAcAX53wlPgwrptfmgMLevt5PfOIxGhtLccYKgjYSASVG6gpFQZ-tY4RGTTUadfYk3cEhd1uerqu_rr_nHbwEj9anb4a_8oNjkOl7ZVN7wrL16gIyxLtk0LfB2R7Rmz3Aa8Dp/s1600/dsl605ew.jpg" imageanchor="1" style=""><img border="0" width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkbDxtKzZlAcAX53wlPgwrptfmgMLevt5PfOIxGhtLccYKgjYSASVG6gpFQZ-tY4RGTTUadfYk3cEhd1uerqu_rr_nHbwEj9anb4a_8oNjkOl7ZVN7wrL16gIyxLtk0LfB2R7Rmz3Aa8Dp/s320/dsl605ew.jpg" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjooz5MkJ3iDOHy9d596p_F8eonhqrmsdULWOHVUEhiEqsWw2JGH3Uz-Pvw9x7MVdm_6U4Gb_YxA1HbjApQeLaAmiyP6acysCke8J6WOmjJs0W2FhKyjp0f5xGZpWpv9TsCNqKRpKSj_3AO/s1600/aztech_dsl605ew.gif" imageanchor="1" style=""><img border="0" width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjooz5MkJ3iDOHy9d596p_F8eonhqrmsdULWOHVUEhiEqsWw2JGH3Uz-Pvw9x7MVdm_6U4Gb_YxA1HbjApQeLaAmiyP6acysCke8J6WOmjJs0W2FhKyjp0f5xGZpWpv9TsCNqKRpKSj_3AO/s320/aztech_dsl605ew.gif" /></a>leorickhttp://www.blogger.com/profile/12860324908477273661noreply@blogger.com2tag:blogger.com,1999:blog-1859734723707065827.post-17765222092798574622010-10-28T01:22:00.001+08:002010-10-28T01:30:56.697+08:00Open DNS : Alternate DNSIf you are experiencing problems with your ISP DNS, you might want to try OpenDNS.<br />
<br />
Below is how to check whether your ISP DNS availability by using <tt>nslookup</tt> command<br />
<br />
I purposely change the DNS to 202.188.0.133 (TMNET DNS) which is the one that having a problem tonight. Timeout!<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixkP5jC74gUOeOG07zdPv7krMcwoJ14XnOVoh6S25ZQPgJJpGlW5gaeJ8CDtEYA8FUIMimCCg5omKJ9oAwRTG8Q4iTUs_mfp0JFUhUPH4TVt86EDDUnkNLQIk0SL9XjKTgsKMZ3vjTDySo/s1600/Untitled-2.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="121" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixkP5jC74gUOeOG07zdPv7krMcwoJ14XnOVoh6S25ZQPgJJpGlW5gaeJ8CDtEYA8FUIMimCCg5omKJ9oAwRTG8Q4iTUs_mfp0JFUhUPH4TVt86EDDUnkNLQIk0SL9XjKTgsKMZ3vjTDySo/s320/Untitled-2.gif" width="320" /></a></div><br />
No problem when using OpenDNS.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhc823mZ_JnUHkA_C633J_jFBR0uCyCd-6Vm8hynjMdh4o511XsY6VJ35Bbxd5eXsTd24QZsDq3HeKKDt4itIhhjELSbHddb_PlYkzZLGnsx8w4woQ-ZPli8fSf8fQXf265Ud-XVLMhRMAg/s1600/Untitled-1.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="104" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhc823mZ_JnUHkA_C633J_jFBR0uCyCd-6Vm8hynjMdh4o511XsY6VJ35Bbxd5eXsTd24QZsDq3HeKKDt4itIhhjELSbHddb_PlYkzZLGnsx8w4woQ-ZPli8fSf8fQXf265Ud-XVLMhRMAg/s320/Untitled-1.gif" width="320" /></a></div><br />
You can set this DNS to your network card setting if you don't want to change your ADSL modem setting.<br />
<br />
Easier to revert back to the ISP DNS when it recovers.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJdAcxZstNqYb-gdBg35iKAFfvhxqoQdVR1VAHIReWKmHldMRr2UTsUhClVV4qanff1wmVIawy3Z-yElic7vhg5BNT7fs3lgUJcl6dQXKm-nbOGGc5AMtK-0N3WRmMVLEhENo8sYNG6VgE/s1600/Untitled-3.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJdAcxZstNqYb-gdBg35iKAFfvhxqoQdVR1VAHIReWKmHldMRr2UTsUhClVV4qanff1wmVIawy3Z-yElic7vhg5BNT7fs3lgUJcl6dQXKm-nbOGGc5AMtK-0N3WRmMVLEhENo8sYNG6VgE/s320/Untitled-3.gif" width="260" /></a></div><br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4gUQpvKbgYGRmx6X0tIzt0w-SueZGAyciHfR-QxeqIqsPMGm9bVcYOQFgJ8A3ytU1XKfUhI2G_p9Lyw4ZEdCh5J-R3HrS3SmbUxL5AWSoSDQXY6e0waJlfZXiy7w5R81cWFEP5Chc52E5/s1600/Untitled-4.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4gUQpvKbgYGRmx6X0tIzt0w-SueZGAyciHfR-QxeqIqsPMGm9bVcYOQFgJ8A3ytU1XKfUhI2G_p9Lyw4ZEdCh5J-R3HrS3SmbUxL5AWSoSDQXY6e0waJlfZXiy7w5R81cWFEP5Chc52E5/s320/Untitled-4.gif" width="284" /></a></div><br />
More information on OpenDNS? please google for <a href="http://www.opendns.com">OpenDNS</a><br />
<br />
* Your might also consider <a href="http://code.google.com/speed/public-dns/docs/using.html">Google Public DNS</a>leorickhttp://www.blogger.com/profile/12860324908477273661noreply@blogger.com0tag:blogger.com,1999:blog-1859734723707065827.post-19237862930460926902010-08-05T23:51:00.000+08:002010-08-05T23:51:56.299+08:00YUI Compressor with GUIMinification is the process of removing all unnecessary characters from source code such as<br />
white space characters, new line characters, comments and block delimiters<br />
without changing its functionality. [<a href="http://en.wikipedia.org/wiki/Minification_%28programming%29">read more...</a>]<br />
<br />
Minified code reduces the amount of data that needs to be transferred through the web server (bandwidth saving).<br />
It may also be used as a kind of obfuscation.<br />
<br />
My favorite minification tool is <a href="http://developer.yahoo.com/yui/compressor/">YUI Compressor</a>.<br />
Mostly for CSS (Cascading Style Sheets) and JS (JavaScript).<br />
<br />
Let us taka a look what happen when a simple code get minified.<br />
<br />
<b>JavaScript - Original Code</b><br />
<br />
<pre class="brush:javascript;">function startTime(){
var today=new Date();
var h=today.getHours();
var m=today.getMinutes();
var s=today.getSeconds();
// add a zero in front of numbers<10
m=checkTime(m);
s=checkTime(s);
document.getElementById('txt').innerHTML=h+":"+m+":"+s;
t=setTimeout('startTime()',500);
}
function checkTime(i){
if (i<10){
i="0" + i;
}
return i;
}
</pre><b>JavaScript - Minified</b> <br />
<pre class="brush:javascript;">function startTime(){var b=new Date();var d=b.getHours();
var a=b.getMinutes();var c=b.getSeconds();a=checkTime(a);
c=checkTime(c);document.getElementById("txt").innerHTML=d+":"+a+":"+c;
t=setTimeout("startTime()",500)}function checkTime(a){if(a<10){a="0"+a
}return a};
</pre><b>CSS - Original Code</b> <br />
<pre class="brush:javascript;">body
{
background-color:#d0e4fe;
}
h1
{
color:orange;
text-align:center;
}
p
{
font-family:"Times New Roman";
font-size:20px;
}
</pre><b>CSS - Minfied</b> <br />
<pre class="brush:javascript;">body{background-color:#d0e4fe;}h1{color:orange;text-align:center;}
p{font-family:"Times New Roman";font-size:20px;}
</pre>Just to share here, since YUI Compressor don't provide any GUI, I've created one with Java Swing. It has been compiled together with <tt><a href="http://developer.yahoo.com/yui/compressor/">yuicompressor-2.4.2.jar</a></tt>.<br />
You need to have Java installed in order to run this executable JAR.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjMycGSWbRobHAPwia9QNNjgY4hbkG7Iam1a1qfiLHFjWiQV_-rXqrS7Yx3pzymJHvJpbPLXGL2jxLyMKUXv1jp8kcG88j-lcWCXXouPBIhyHYiWnqvDwBtFh4fkYx5POGvLiU3wHl7xYQ/s1600/JsCssMin.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjMycGSWbRobHAPwia9QNNjgY4hbkG7Iam1a1qfiLHFjWiQV_-rXqrS7Yx3pzymJHvJpbPLXGL2jxLyMKUXv1jp8kcG88j-lcWCXXouPBIhyHYiWnqvDwBtFh4fkYx5POGvLiU3wHl7xYQ/s320/JsCssMin.png" /></a></div><br />
<a href="http://www.fastanalytic.com/fa_jar/JsCssMin.jar">Download</a> (MD5 : 210176c93d331c50dc19a2dda0ae1c89 JsCssMin.jar)leorickhttp://www.blogger.com/profile/12860324908477273661noreply@blogger.com0