tag:blogger.com,1999:blog-45954076568602745882024-03-05T23:33:17.327-08:00SAIGJigko SWhttp://www.blogger.com/profile/10271210843928363617noreply@blogger.comBlogger9125tag:blogger.com,1999:blog-4595407656860274588.post-46130579351964067652015-10-22T02:40:00.004-07:002015-10-22T02:56:16.275-07:00Docker - Command & Dockerfile reference<h2>
Command </h2>
https://docs.docker.com/reference/run/<br />
<br />
<ul>
<li>docker run [option...] <image> [command]</li>
<ul>
<li>-p <external-port>:<container-port> - expose container port to host</li>
<li>-d - รัน container ไว้เบื้องหลัง (daemon)</li>
<li>--name <container-name> - ตั้งชื่อ container</li>
<li>-v <src>:<dest> - mount ไฟล์ที่ <src> ของ host กับ <dest> ของ container </li>
<li>--link <container>:<hostname></li>
<li>-it - i=interactive, t=pseudo tty ใช้เมื่อต้องการทำงานแบบ interactive เช่นใช้ bash</li>
<ul>
<li>eg. docker run hello-world - รัน image hello-world</li>
<li>docker run -it ubuntu /bin/bash - สร้าง container จาก image ubuntu แล้วรัน bash</li>
<li>docker run -d --name my-nginx -p 8000:80 nginx - สร้าง container ชื่อ my-nginx จาก image nginx แล้ว expose port 80 ของ container ไปยัง port 8000 ของเครื่อง host</li>
</ul>
</ul>
<li>docker ps [option]</li>
<ul>
<li>docker ps - ดูรายการ container </li>
<li>docker ps -a - ดูรายการ container ทุกรายการรวมถึง container ที่ stop อยู่</li>
</ul>
<li>docker images [option] [repository]</li>
<ul>
<li>docker images - ดูรายการ image ที่มี </li>
</ul>
<li>docker pull <image></li>
<ul>
<li>docker pull nginx - โหลด image nginx ลงในเครื่อง</li>
</ul>
<li>docker push <image></li>
<ul>
<li>docker push my-usernam/my-image - อัพโหลด image ไปยัง docker hub (registry)</li>
</ul>
<li>docker build [option] <dockerfile-path></li>
<ul>
<li>docker build -t my-image . - สร้าง image จาก Dockerfile ในตำแหน่งปัจจุบัน แล้วตั้งชื่อ image ที่ได้ว่า myimage </li>
</ul>
<li>docker stop <container> [container...]</li>
<ul>
<li>docker stop my-laravel - หยุดการทำงานของ container my-laravel </li>
</ul>
<li>docker start <container> [container...]</li>
<ul>
<li>docker start my-laravel - ให้ container my-laravel ที่หยุด เริ่มทำงานอีกครั้ง </li>
</ul>
<li>docker rm <container> [container...]</li>
<ul>
<li>docker rm my-laravel - ลบ container my-laravel (ต้อง stop ก่อน) </li>
</ul>
<li>docker rmi <image> [image...]</li>
<ul>
<li>docker rmi laravel - ลบ image ชื่อ laravel ออก</li>
</ul>
<li>docker inspect <container|image></li>
<ul>
<li>docker inspect laravel - (image) ดูรายละเอียดของ image laravel</li>
<li>docker inspect my-laravel - (container) ดูรายละเอียดของ container my-laravel</li>
</ul>
<li>docker exec [option] <container></li>
<ul>
<li>docker exec -it my-nginx /bin/bash - เรียกใช้ bash จาก container my-nginx (ใส่ -it เพื่อให้ใช้งานแบบ interactive ได้)</li>
</ul>
</ul>
<br />
<h2>
Dockerfile </h2>
https://docs.docker.com/reference/builder/<br />
<br />
<ul>
<li>FROM <image></li>
<ul>
<li>ระบบุ base image ที่จะนำมาใช้ทำงาน </li>
</ul>
<li>COPY <src> <dest></li>
<li><strike>ADD <src> <dest></strike></li>
<ul>
<li>คัดลอกไฟล์จาก <src> ไปเก็บไว้ใน container ที่ <dest></li>
</ul>
<li>RUN <command></li>
<ul>
<li>คำสั่งที่ต้องการให้ทำในขณะที่กำลังสร้าง image ( จะสร้าง Layer ใหม่ ) </li>
</ul>
<li>CMD <command></li>
<ul>
<li>คำสั่งที่ต้องการให้รันเมื่อ image ถูกรัน สามารถถูกแทนที่ด้วย [command] จากคำสั่ง docker run ได้ </li>
</ul>
<li>ENTRYPOINT <command></li>
<ul>
<li>คำสั่งที่ต้องการให้รันเมื่อ image ถูกรัน </li>
</ul>
<li>EXPOSE <port,...></li>
<ul>
<li>ระบบว่าจะ container นี้ใช้งาน port อะไรบ้าง</li>
</ul>
</ul>
Jigko SWhttp://www.blogger.com/profile/10271210843928363617noreply@blogger.com0tag:blogger.com,1999:blog-4595407656860274588.post-12503683792457004522015-10-21T13:55:00.002-07:002015-10-24T05:47:36.775-07:00Docker - เตรียมความพร้อม <br />
เนื่องจาก Docker ทำงานบน Linux เท่านั้น จึงได้แบ่งวิธีการติดตั้งออกเป็น 2 กลุ่มคือ Non-Linux และ Linux <br />
<ol>
<li>Non-Linux </li>
<ul>
<li>Windows User ให้ติดตั้ง Docker toolbox โดยทำตาม<a href="http://docs.docker.com/windows/step_one/" target="_blank">นี้</a></li>
<li>Mac User ให้ติดตั้ง Docker toolbox โดยทำตาม<a href="http://docs.docker.com/mac/step_one/" target="_blank">นี้</a> </li>
</ul>
ขั้นตอนโดยสรุปคือให้ติดตั้ง Docker toolbox แล้วทดสอบว่าใช้งานได้ไหม โดยใช้คำสั่ง ( ปัจจุบัน docker toolbox มีปัญหากับ Windows10 )<br />
<blockquote class="tr_bq">
<pre><code class="hljs livecodeserver">docker run hello-world</code></pre>
</blockquote>
<br />
สำหรับผู้ที่ทำตามวิธีตามในลิงค์แล้วไม่สามารถใช้งานได้ให้ติดตั้ง <a href="https://www.virtualbox.org/wiki/Downloads">VirtualBox </a> version ใหม่ (>=5.0.8) หากยังใช้ docker toolbox ไม่ได้ ให้ Import <a href="https://drive.google.com/file/d/0B8KFEfLg7rqOVXJZWmRlVHZuQWs/view">image นี้</a>ใส่เข้าไปใน VirtualBox<br /><br />
<br />
<li> Linux</li>
<ul>
<li>Linux User ให้ติดตั้ง Docker โดยทำตาม<a href="http://docs.docker.com/linux/step_one/" target="_blank">นี้</a> (Debian based) สำหรับกรณีอื่นๆทำตามด้านล่าง</li>
<ul>
<li>CentOS - yum install docker</li>
<li>ArchOS - pacman -S docker </li>
</ul>
</ul>
</ol>
Jigko SWhttp://www.blogger.com/profile/10271210843928363617noreply@blogger.com0tag:blogger.com,1999:blog-4595407656860274588.post-67146165818891831242015-09-12T00:54:00.002-07:002015-09-12T00:59:52.358-07:00[Idea Are Cheap] iTruemart กับกระบวนการส่ง วันนี้เห็นตัวระบบ Logistic ของ iTruemart น่าสนใจเลยจะมาเล่าให้ฟังเป็นไอเดียวสำหรับต่อยอดทำอย่างอื่นในอนาคต<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinyKZPQE_bidhtvbULcspwLpVLU_nY_zZbI8UQveez1wqS84ndhiXEZa8P9vAySyinSFbtAj1dn2O1AA-NNuhJ4HvCo-3UdiaER7uGhBX4ejImWx0de9NM2ySk-dT3DjtSZOC89cu7Ewk/s1600/11998408_961838483859991_1758644737_n.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinyKZPQE_bidhtvbULcspwLpVLU_nY_zZbI8UQveez1wqS84ndhiXEZa8P9vAySyinSFbtAj1dn2O1AA-NNuhJ4HvCo-3UdiaER7uGhBX4ejImWx0de9NM2ySk-dT3DjtSZOC89cu7Ewk/s320/11998408_961838483859991_1758644737_n.jpg" width="320" /></a></div>
<br />
<br />
<ul>
<li>ในการขนส่งบริษัทจะแจ้งลูกค้าผ่านทางอีเมลล์ และมีการโทรติดต่อลูกค้าก่อนส่ง</li>
<li>ระบบในการรับสินค้าใช้เป็น Application บน Android หน้าจอ 5.5 - 6 นิ้ว</li>
</ul>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGS7J224YStHs_8O31g4GkOrGjHEwyCvTKXESnvJyCKs7B82harHUm7c_mYa6FVApa89-0aVIOJwwuaLCAjAQv3Dcc4L4vPhNbkwj-b-IjRk1wgQx8Rs2GvPpJoGt9XVBYOJoLMGwfxzc/s1600/12016571_961838527193320_1693763924_n.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGS7J224YStHs_8O31g4GkOrGjHEwyCvTKXESnvJyCKs7B82harHUm7c_mYa6FVApa89-0aVIOJwwuaLCAjAQv3Dcc4L4vPhNbkwj-b-IjRk1wgQx8Rs2GvPpJoGt9XVBYOJoLMGwfxzc/s320/12016571_961838527193320_1693763924_n.jpg" width="320" /></a></div>
<br />
<br />
<ul>
<li>ในการ Track เลข Barcode ใช้ตัว Image Processing อ่าน มีความแม่นยำในระดับหนึ่ง และมีการตรวจสอบกับฐานข้อมูลก่อนที่พนักงานจะกดยืนยันการส่ง</li>
<li>ใช้การเซ็นชื่อลงบนหน้าจอเพื่อเป็นหลักฐานการรับสินค้า </li>
</ul>
<br /><ul>
</ul>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVmytfHVIMR3k7qZJZHv4O1Xiq8V9LJhg_Joy1XJ67VsVJPaG1sAukPDEGUSmGt1qKMLTtvVOnNnl8buZYcCGsdLhyphenhyphenM_zhXRILXAhdmunlnqC4CMZxfdT6GLrjWjkdv9wOYZpuhVaj2UE/s1600/12000023_961838510526655_1642892078_n.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVmytfHVIMR3k7qZJZHv4O1Xiq8V9LJhg_Joy1XJ67VsVJPaG1sAukPDEGUSmGt1qKMLTtvVOnNnl8buZYcCGsdLhyphenhyphenM_zhXRILXAhdmunlnqC4CMZxfdT6GLrjWjkdv9wOYZpuhVaj2UE/s320/12000023_961838510526655_1642892078_n.jpg" width="320" /></a></div>
<div>
<br /></div>
<div>
ปล. MicroSD ถูกมาก อันละ 99 บาท สายชาร์จเส้นละ 19 บาท</div>
Anonymoushttp://www.blogger.com/profile/15275390014694962869noreply@blogger.com0tag:blogger.com,1999:blog-4595407656860274588.post-49011710434993899922015-09-08T09:28:00.000-07:002015-09-11T00:18:58.532-07:00วิธีสร้าง Private/Public Key ด้วย msys2<h2>
<span style="white-space: pre-wrap;">แนะนำการสร้าง Key สำหรับใช้งาน</span></h2>
สำหรับผู้ใช้ Windows ใครที่ยังไม่มี msys2 ให้ติดตั้งก่อน <a href="http://msys2.github.io/">ที่นี่</a> ทำตามเว็บให้ครบทุกขั้นตอนด้วยนะ
<br />
เริ่มจากใช้คำสั่ง สร้าง Key ขึ้นมา ผ่าน Terminal
<br />
<pre class="command-line" style="-webkit-background-clip: padding-box; -webkit-font-smoothing: auto; background-clip: padding-box; background-color: #333333; border-radius: 3px; border: 2px solid rgb(221, 221, 221); color: white; font-family: Monaco, 'DejaVu Sans Mono', 'Courier New', monospace; font-size: 13px; font-stretch: inherit; line-height: inherit; margin-bottom: 10px; margin-top: 10px; overflow: auto; padding: 10px; vertical-align: baseline;"><span class="command" style="border: 0px; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: pre-wrap;">$ ssh-keygen -t rsa -b 4096 -C "<em style="border: 0px; color: #f9fe64; font-family: inherit; font-size: inherit; font-stretch: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">your_email@example.com</em>"</span>
<span class="comment" style="border: 0px; color: #cccccc; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: pre-wrap;"># Creates a new ssh key, using the provided email as a label</span>
<span class="output" style="border: 0px; color: #63e463; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: pre-wrap;"><span style="border: 0px; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; left: -1000px; line-height: inherit; margin: 0px; padding: 0px; position: fixed; top: -1000px; vertical-align: baseline;"># </span>Generating public/private rsa key pair.</span></pre>
บันทึกค่าใน Default Directory ที่ได้มา
<br />
<pre class="command-line" style="-webkit-background-clip: padding-box; -webkit-font-smoothing: auto; background-clip: padding-box; background-color: #333333; border-radius: 3px; border: 2px solid rgb(221, 221, 221); color: white; font-family: Monaco, 'DejaVu Sans Mono', 'Courier New', monospace; font-size: 13px; font-stretch: inherit; line-height: inherit; margin-bottom: 10px; margin-top: 10px; overflow: auto; padding: 10px; vertical-align: baseline;"><pre class="command-line" style="-webkit-background-clip: padding-box; -webkit-font-smoothing: auto; background-clip: padding-box; background-color: #333333; border-radius: 3px; border: 2px solid rgb(221, 221, 221); color: white; font-family: Monaco, 'DejaVu Sans Mono', 'Courier New', monospace; font-size: 13px; font-stretch: inherit; line-height: inherit; margin-bottom: 10px; margin-top: 10px; overflow: auto; padding: 10px; vertical-align: baseline;"><span class="output" style="border: 0px; color: #63e463; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: pre-wrap;">Enter file in which to save the key (/Users/<em style="border: 0px; color: #f9fe64; font-family: inherit; font-size: inherit; font-stretch: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">you</em>/.ssh/id_rsa): <em style="border: 0px; color: #f9fe64; font-family: inherit; font-size: inherit; font-stretch: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">[Press enter]</em></span></pre>
</pre>
หากต้องการเข้ารหัสให้ทำการกรอกรหัส แต่หากไม่ต้องการให้ Enter ข้ามไป
<br />
<pre class="command-line" style="-webkit-background-clip: padding-box; -webkit-font-smoothing: auto; background-clip: padding-box; background-color: #333333; border-radius: 3px; border: 2px solid rgb(221, 221, 221); color: white; font-family: Monaco, 'DejaVu Sans Mono', 'Courier New', monospace; font-size: 13px; font-stretch: inherit; line-height: inherit; margin-bottom: 10px; margin-top: 10px; overflow: auto; padding: 10px; vertical-align: baseline;"><pre class="command-line" style="-webkit-background-clip: padding-box; -webkit-font-smoothing: auto; background-clip: padding-box; background-color: #333333; border-radius: 3px; border: 2px solid rgb(221, 221, 221); color: white; font-family: Monaco, 'DejaVu Sans Mono', 'Courier New', monospace; font-size: 13px; font-stretch: inherit; line-height: inherit; margin-bottom: 10px; margin-top: 10px; overflow: auto; padding: 10px; vertical-align: baseline;"><span class="output" style="border: 0px; color: #63e463; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: pre-wrap;">Enter passphrase (empty for no passphrase): <em style="border: 0px; color: #f9fe64; font-family: inherit; font-size: inherit; font-stretch: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">[Type a passphrase]</em></span>
<span class="output" style="border: 0px; color: #63e463; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: pre-wrap;"><span style="border: 0px; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; left: -1000px; line-height: inherit; margin: 0px; padding: 0px; position: fixed; top: -1000px; vertical-align: baseline;"># </span>Enter same passphrase again: <em style="border: 0px; color: #f9fe64; font-family: inherit; font-size: inherit; font-stretch: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">[Type passphrase again]</em></span></pre>
</pre>
หลังจากเราผ่านขั้นตอนก่อนหน้ามาแล้ว จะมีการแสดง key fingerprint ให้เราดู (ดูเฉยๆ ไม่ต้องทำอะไร)
<br />
<pre class="command-line" style="-webkit-background-clip: padding-box; -webkit-font-smoothing: auto; background-clip: padding-box; background-color: #333333; border-radius: 3px; border: 2px solid rgb(221, 221, 221); color: white; font-family: Monaco, 'DejaVu Sans Mono', 'Courier New', monospace; font-size: 13px; font-stretch: inherit; line-height: inherit; margin-bottom: 10px; margin-top: 10px; overflow: auto; padding: 10px; vertical-align: baseline;"><pre class="command-line" style="-webkit-background-clip: padding-box; -webkit-font-smoothing: auto; background-clip: padding-box; background-color: #333333; border-radius: 3px; border: 2px solid rgb(221, 221, 221); color: white; font-family: Monaco, 'DejaVu Sans Mono', 'Courier New', monospace; font-size: 13px; font-stretch: inherit; line-height: inherit; margin-bottom: 10px; margin-top: 10px; overflow: auto; padding: 10px; vertical-align: baseline;"><span class="output" style="border: 0px; color: #63e463; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: pre-wrap;">Your identification has been saved in /Users/<em style="border: 0px; color: #f9fe64; font-family: inherit; font-size: inherit; font-stretch: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">you</em>/.ssh/id_rsa.</span>
<span class="output" style="border: 0px; color: #63e463; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: pre-wrap;"><span style="border: 0px; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; left: -1000px; line-height: inherit; margin: 0px; padding: 0px; position: fixed; top: -1000px; vertical-align: baseline;"># </span>Your public key has been saved in /Users/<em style="border: 0px; color: #f9fe64; font-family: inherit; font-size: inherit; font-stretch: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">you</em>/.ssh/id_rsa.pub.</span>
<span class="output" style="border: 0px; color: #63e463; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: pre-wrap;"><span style="border: 0px; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; left: -1000px; line-height: inherit; margin: 0px; padding: 0px; position: fixed; top: -1000px; vertical-align: baseline;"># </span>The key fingerprint is:</span>
<span class="output" style="border: 0px; color: #63e463; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: pre-wrap;"><span style="border: 0px; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; left: -1000px; line-height: inherit; margin: 0px; padding: 0px; position: fixed; top: -1000px; vertical-align: baseline;"># </span><em style="border: 0px; color: #f9fe64; font-family: inherit; font-size: inherit; font-stretch: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db your_email@example.com</em></span></pre>
</pre>
ใช้งาน ssh-agent
<br />
<pre class="command-line" style="-webkit-background-clip: padding-box; -webkit-font-smoothing: auto; background-clip: padding-box; background-color: #333333; border-radius: 3px; border: 2px solid rgb(221, 221, 221); color: white; font-family: Monaco, 'DejaVu Sans Mono', 'Courier New', monospace; font-size: 13px; font-stretch: inherit; line-height: inherit; margin-bottom: 10px; margin-top: 10px; overflow: auto; padding: 10px; vertical-align: baseline;"><pre class="command-line" style="-webkit-background-clip: padding-box; -webkit-font-smoothing: auto; background-clip: padding-box; background-color: #333333; border-radius: 3px; border: 2px solid rgb(221, 221, 221); color: white; font-family: Monaco, 'DejaVu Sans Mono', 'Courier New', monospace; font-size: 13px; font-stretch: inherit; line-height: inherit; margin-bottom: 10px; margin-top: 10px; overflow: auto; padding: 10px; vertical-align: baseline;"><span class="comment" style="border: 0px; color: #cccccc; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: pre-wrap;"># start the ssh-agent in the background</span>
<span class="command" style="border: 0px; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: pre-wrap;">$ eval "$(ssh-agent -s)"</span>
<span class="output" style="border: 0px; color: #63e463; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: pre-wrap;"><span style="border: 0px; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; left: -1000px; line-height: inherit; margin: 0px; padding: 0px; position: fixed; top: -1000px; vertical-align: baseline;"># </span>Agent pid 59566</span></pre>
</pre>
สั่งให้ใช้งาน SSH Key (หากเราใช้ชื่อไฟล์ตามที่ระบบตั้งให้มา "~/.ssh/id_rsa" จะใช้โดยอัตโนมัติอยู่แล้ว (หาก private key ไม่ได้ใส่ passphrase))
<br />
<pre class="command-line" style="-webkit-background-clip: padding-box; -webkit-font-smoothing: auto; background-clip: padding-box; background-color: #333333; border-radius: 3px; border: 2px solid rgb(221, 221, 221); color: white; font-family: Monaco, 'DejaVu Sans Mono', 'Courier New', monospace; font-size: 13px; font-stretch: inherit; line-height: inherit; margin-bottom: 10px; margin-top: 10px; overflow: auto; padding: 10px; vertical-align: baseline;"><pre class="command-line" style="-webkit-background-clip: padding-box; -webkit-font-smoothing: auto; background-clip: padding-box; background-color: #333333; border-radius: 3px; border: 2px solid rgb(221, 221, 221); color: white; font-family: Monaco, 'DejaVu Sans Mono', 'Courier New', monospace; font-size: 13px; font-stretch: inherit; line-height: inherit; margin-bottom: 10px; margin-top: 10px; overflow: auto; padding: 10px; vertical-align: baseline;"><span class="command" style="border: 0px; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: pre-wrap;">$ ssh-add ~/.ssh/id_rsa</span></pre>
</pre>
หา Public key ได้จากไฟล์ id_rsa.pub โดยใช้คำสั่ง
<br />
<pre class="command-line" style="-webkit-background-clip: padding-box; -webkit-font-smoothing: auto; background-clip: padding-box; background-color: #333333; border-radius: 3px; border: 2px solid rgb(221, 221, 221); color: white; font-family: Monaco, 'DejaVu Sans Mono', 'Courier New', monospace; font-size: 13px; font-stretch: inherit; line-height: inherit; margin-bottom: 10px; margin-top: 10px; overflow: auto; padding: 10px; vertical-align: baseline;"><pre class="command-line" style="-webkit-background-clip: padding-box; -webkit-font-smoothing: auto; background-clip: padding-box; background-color: #333333; border-radius: 3px; border: 2px solid rgb(221, 221, 221); color: white; font-family: Monaco, 'DejaVu Sans Mono', 'Courier New', monospace; font-size: 13px; font-stretch: inherit; line-height: inherit; margin-bottom: 10px; margin-top: 10px; overflow: auto; padding: 10px; vertical-align: baseline;"><span class="command" style="border: 0px; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: pre-wrap;">$ cat .ssh/id_rsa.pub</span></pre>
</pre>
คัดลอก Public Key ที่ได้ ไปใช้งาน :)
<br />
ตัวอย่าง Public key
<blockquote>ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDzy4taGIcxi2S477iRiPY0ts+4Zz37ZA7NNmMs11vf/kyfyduA0SR3LKFzfoUItwYoQkU+BHGl42zvJkPR2B7YtmCtgmKmzz1yzY9nLmSXal/BvRoVHEkwBP2ROUvJQdWqDjxoQEbdVXV/2ku/YuYU131MVlusUzPNAnWgtXeIY1u/6oCxDcQSBn/u9Xk+m983h2CqE57YQBnS17QiOVPXMlk/oTO6yD1DhhoB+WXG63uWZLLX9/SMbfQf60UVhXPzJ0H7GbJxvPw8ArSaY8VOZqRQ9km2oFOn0Dgd0vIFEHzvTqtuuOHI8IEq8Ih0marCmaa7j30Zto/i3+guIL0h Extraterrestrial@DESKTOP</blockquote>
<pre class="command-line" style="-webkit-background-clip: padding-box; -webkit-font-smoothing: auto; background-clip: padding-box; background-color: #333333; border-radius: 3px; border: 2px solid rgb(221, 221, 221); color: white; font-family: Monaco, 'DejaVu Sans Mono', 'Courier New', monospace; font-size: 13px; font-stretch: inherit; line-height: inherit; margin-bottom: 10px; margin-top: 10px; overflow: auto; padding: 10px; vertical-align: baseline;">อ้างอิงจาก : <a href="https://help.github.com/articles/generating-ssh-keys/">https://help.github.com/articles/generating-ssh-keys/</a></pre>
Anonymoushttp://www.blogger.com/profile/15275390014694962869noreply@blogger.com0tag:blogger.com,1999:blog-4595407656860274588.post-74583058208998068232015-04-07T02:22:00.002-07:002015-04-08T02:04:12.743-07:00To be Android developerซอฟต์แวร์ที่ต้องเตรียมมา<br />
<br />
<ol>
<li>Android Studio <a href="http://developer.android.com/sdk/index.html">developer.android.com/sdk/index.html</a></li>
<li>Genymotion <a href="http://www.genymotion.com/#!/download">www.genymotion.com/#!/download</a> ( ต้องสมัครสมาชิก )</li>
</ol>
<div>
<br /></div>
<div>
<br /></div>
<div>
<b>Genymotion</b><br />
<ol>
<li>เมื่อเปิดขึ้นมาครั้งแรกจะพบข้อความว่า Do you want to add a new one? ให้ตอบ yes</li>
<li>จากนั้น Login</li>
<li>แล้วเลือกสร้าง Custom Phone - 4.1.1 </li>
<li>เมื่อ Download เสร็จ ให้ลอง Start Device นั้นขึ้นมา</li>
</ol>
</div>
<div>
<b>Android Studio</b></div>
<div>
ทดลองสร้างโปรเจ็ค Hello World แล้วกด Run แล้วดูผลที่ Genymotion</div>
Jigko SWhttp://www.blogger.com/profile/10271210843928363617noreply@blogger.com0tag:blogger.com,1999:blog-4595407656860274588.post-60693781568758007152015-04-01T03:31:00.003-07:002015-04-01T03:31:56.674-07:00[Prerequisite] Wow Such Image Processing Amaze<h2>
โปรแกรมที่ต้องเตรียมมา</h2>
<br />
<ol>
<li>Eclipse ที่ใช้งานได้</li>
<li>OpenCV 2.4.11 หรือ 3.0.0 beta ก็ได้นะ ดาวน์โหลดได้ตามนี้เลยจ้า<br /><a href="http://sourceforge.net/projects/opencvlibrary/files/opencv-win/2.4.11/">OpenCV 2.4.11</a> หรือ <a href="http://sourceforge.net/projects/opencvlibrary/files/opencv-win/3.0.0-beta/">OpenCV 3.0.0 beta</a></li>
<li>อาจจะทดลอง set-up environment โดยการแตกไฟล์ opencv ออกมา แล้ว Add External Archives เป็นไฟล์ opencv-xxx.jar เมื่อ xxx เป็นเลขเวอร์ชั่นของ opencv เช่น <pre>opencv-300.jar</pre>
ซึ่งพบได้ใน directory <pre>opencv/build/java</pre>
</li>
<li>create project แล้วทดลองใส่โค้ด
<pre>import org.opencv.core.Core;
import org.opencv.core.Mat;
import org.opencv.core.CvType;
import org.opencv.core.Scalar;
public class DogeImage {
// แทน path ของบรรทัดข้างล่างด้วย path ไปหาไฟล์ dll ของเครื่องตนเอง
static{ System.load("E:\\OpenCV\\opencv\\build\\java\\x64\\opencv_java300.dll"); }
public static void main(String[] args) {
System.out.println("Welcome to OpenCV " + Core.VERSION);
Mat m = new Mat(5, 10, CvType.CV_8UC1, new Scalar(0));
System.out.println("OpenCV Mat: " + m);
Mat mr1 = m.row(1);
mr1.setTo(new Scalar(1));
Mat mc5 = m.col(5);
mc5.setTo(new Scalar(5));
System.out.println("OpenCV Mat data:\n" + m.dump());
}
}
</pre>
</li>
<li>ทดลองรันดู ถ้าผ่านก็ถือว่าโอเค ถ้าไม่ผ่านก็ไม่เป็นไร หรือใจร้อนอาจจะลองหาวิธีแก้จาก stackoverflow ก่อนได้เช่นกัน</li>
</ol>
choehttp://www.blogger.com/profile/06524947764720134738noreply@blogger.com0tag:blogger.com,1999:blog-4595407656860274588.post-74633503079745824172015-03-26T08:00:00.001-07:002015-03-26T08:08:45.650-07:00Subdomain for "To be developer series : Web dev"พี่สร้าง Subdomain ให้ตามนี้นะ คราวหลังจะได้ใช้อันนี้แทน<br />
<blockquote class="tr_bq">
<br />
<a href="http://boom.saig.kmitl.net/">boom.saig.kmitl.net</a><br />
<a href="http://dewdroid.saig.kmitl.net/">dewdroid.saig.kmitl.net</a><br />
<a href="http://donkky.saig.kmitl.net/">donkky.saig.kmitl.net</a><br />
<a href="http://ginglebee.saig.kmitl.net/">ginglebee.saig.kmitl.net</a><br />
<a href="http://hazelnut.saig.kmitl.net/">hazelnut.saig.kmitl.net</a><br />
<a href="http://icekung.saig.kmitl.net/">icekung.saig.kmitl.net</a><br />
<a href="http://king.saig.kmitl.net/">king.saig.kmitl.net</a><br />
<a href="http://natkungz.saig.kmitl.net/">natkungz.saig.kmitl.net</a><br />
<a href="http://jayna.saig.kmitl.net/">jayna.saig.kmitl.net </a><br />
<a href="http://oat.saig.kmitl.net/">oat.saig.kmitl.net</a><br />
<a href="http://oil.saig.kmitl.net/">oil.saig.kmitl.net</a>
</blockquote>
<br />Jigko SWhttp://www.blogger.com/profile/10271210843928363617noreply@blogger.com0tag:blogger.com,1999:blog-4595407656860274588.post-10377621504024804252015-03-21T08:39:00.001-07:002015-03-21T08:39:13.362-07:00To Be Developer Series :: Web development with Laravel 5Course จัดขึ้นเพื่อให้น้องๆตาม Technology ในปัจจุบันได้ทัน และ สามารถสร้าง web application เบื้องต้น เพื่อที่จะสามารถนำไปต่อยอดได้อีกต่อไป ในส่วนของ Course จะมีรายละเอียดหัวข้อดังนี้<br />
<br />
<u> ครึ่งแรก ( ~ 3 hours) </u><br />
<br />
<span id="docs-internal-guid-a71f6ec1-3b7a-4532-28cf-68e521bba023"></span><br />
<ul style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: 'Roboto Slab'; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: 'Roboto Slab'; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">client server model and HTTP request </span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: 'Roboto Slab'; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: 'Roboto Slab'; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">web server & LAMP </span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Framework </span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">MVC structure </span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Composer</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Artisan</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Laravel 5 Structure & Important files</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Routing </span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">View & Blade ( Control structure & Template )</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Controller & Form and Data Retrieval ( GET & POST concept ) </span></div>
</li>
</ul>
<div>
<span style="font-family: Arial;"><span style="font-size: 15px; line-height: 20.7000007629395px; white-space: pre-wrap;"><br /></span></span></div>
<div>
<span style="font-family: Arial;"><span style="font-size: 15px; line-height: 20.7000007629395px; white-space: pre-wrap;"> <u>ครั้งหลัง </u></span></span><u> ( ~ 3 hours)</u></div>
<div>
<span style="font-family: Arial;"><span style="font-size: 15px; line-height: 20.7000007629395px; white-space: pre-wrap;"><br /></span></span></div>
<ul style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Database & mySQL & phpmyadmin </span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Laravel Eloquent (Create, Modifier , Drop)</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Migration (migrate & rollback)</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Eloquent ( ORM & Data Retrieval )</span></div>
</li>
</ul>
Drnutsurohttp://www.blogger.com/profile/04643679512258940667noreply@blogger.com0tag:blogger.com,1999:blog-4595407656860274588.post-35139480677865775812015-03-17T09:26:00.002-07:002015-03-19T08:41:46.557-07:00[Train] Data mining + Wekaโปรแกรมที่ต้องเตรียมมา<br />
<br />
<ol>
<li><a href="http://orange.biolab.si/" target="_blank">Orange - Data mining tool</a></li>
<li><a href="http://www.cs.waikato.ac.nz/ml/weka/downloading.html" target="_blank">Weka </a>- ถ้าใช้ Linux ถ้าสามารถใช้คำสั่ง <br />yum install weka หรือ<br />apt-get install weka </li>
<li><a href="http://prdownloads.sourceforge.net/weka/weka-3-6-12.zip" target="_blank">Weka.jar</a></li>
<li><a href="http://www.eclipse.org/downloads/" target="_blank">Eclipse</a> (ทดลองเปิดดูด้วยนะว่าใช้ได้มั้ย ถ้าไม่ได้ให้ลง <a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html" target="_blank">JDK</a> ก่อน) </li>
</ol>
<br />
ไฟล์ข้อมูล<br />
- <a href="https://drive.google.com/file/d/0B8aY_vjbNGZvNDRsZTRYV1FadjA/view?usp=sharing">https://drive.google.com/file/d/0B8aY_vjbNGZvNDRsZTRYV1FadjA/view?usp=sharing</a><br />
<br />
- <a href="https://drive.google.com/file/d/0B8aY_vjbNGZvVVl5S1ZBakJ5cG8/view?usp=sharing">https://drive.google.com/file/d/0B8aY_vjbNGZvVVl5S1ZBakJ5cG8/view?usp=sharing</a><br />
<br />
- <a href="https://raw.githubusercontent.com/ce-saig/ducking-spice/master/crop_price.arff">https://raw.githubusercontent.com/ce-saig/ducking-spice/master/crop_price.arff</a><br />
<ol>
</ol>
<br />
<br />
โค้ดของวันนี้<br />
<br /><a href="https://github.com/ce-saig/ducking-spice">https://github.com/ce-saig/ducking-spice</a>Jigko SWhttp://www.blogger.com/profile/10271210843928363617noreply@blogger.com0