<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Jufianto Henri on Medium]]></title>
        <description><![CDATA[Stories by Jufianto Henri on Medium]]></description>
        <link>https://medium.com/@jufianto?source=rss-64e32bce32ac------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*hBL7PORYRuO51RrTuoyzCw.jpeg</url>
            <title>Stories by Jufianto Henri on Medium</title>
            <link>https://medium.com/@jufianto?source=rss-64e32bce32ac------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 08:32:55 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jufianto/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[AI Code or AI Agent — Is It Really for You?]]></title>
            <link>https://medium.com/jufi-blogs/ai-code-or-ai-agent-is-it-really-for-you-383706629962?source=rss-64e32bce32ac------2</link>
            <guid isPermaLink="false">https://medium.com/p/383706629962</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[developer-productivity]]></category>
            <category><![CDATA[github-copilot]]></category>
            <category><![CDATA[ai-agent]]></category>
            <dc:creator><![CDATA[Jufianto Henri]]></dc:creator>
            <pubDate>Sat, 23 Aug 2025 09:09:36 GMT</pubDate>
            <atom:updated>2025-08-23T09:09:36.493Z</atom:updated>
            <content:encoded><![CDATA[<h3>AI Code or AI Agent — Is It Really for You?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b2jg9vV8ph6ILkCdN-5seA.png" /><figcaption>what AI writes in a day, you may spend a week repairing</figcaption></figure><p>AI is everywhere. Every headline, every framework, every tool now comes with an “AI-powered” sticker. Articles praise it, others warn about it.</p><p>But here’s the question: do we really understand what AI is in the context of software engineering? And more importantly, how should we actually use it?</p><h3>AI Code vs AI Agent</h3><p>Not all “AI for developers” is the same.</p><ul><li><strong>AI Code</strong> → autocomplete on steroids. Think GitHub Copilot in your editor. It predicts the next line, fills in functions, or generates snippets. Super useful, but limited to suggestions while you type.</li><li><strong>AI Agents</strong> → collaborators that take action. Tools like Copilot Agent, Copilot Ask, or aider can edit files, refactor across projects, and even scaffold new features. They don’t just suggest — they try to do the work alongside you.</li></ul><p>That’s a big difference. Autocomplete is safe to accept or reject. Agents blur the line: they can be amazing helpers, but also dangerous if left unchecked.</p><h3>How I Use Them</h3><p>With Copilot, the differences are clear:</p><ul><li><strong>Copilot Code</strong> → classic autocomplete. Good for boilerplate.</li><li><strong>Copilot Ask</strong> → like chatting with a teammate. Great for debugging or refactoring.</li><li><strong>Copilot Agent</strong> → edits across multiple files. Starts acting like a real agent.</li></ul><p>And then there’s <strong>aider</strong>, a CLI-first agent. Instead of living in your editor, you talk to it in plain language. Example: <em>“Add a new endpoint for user transactions.”</em> It edits the right files and shows you the diffs.</p><p>Together, these tools let me move faster and offload boring work. But the more autonomy I give them, the more careful I need to be.</p><h3>The Dark Side</h3><p>Of course, things don’t always go well.</p><ul><li>In 2025, one AI assistant <strong>deleted a live production database</strong> with thousands of records — and even tried to cover it up.</li><li>Developers have leaked <strong>API keys and source code</strong> by pasting them into AI prompts. Some companies now ban external AI tools completely.</li><li>And more often, AI just gives <strong>bad advice</strong>: outdated libraries, insecure fixes, or code that doesn’t run.</li></ul><p>AI is powerful, but it also amplifies mistakes.</p><h3>My Personal Experience</h3><p>I’ve run into these problems myself.</p><ul><li><strong>Outdated Code</strong> → While using Hydra v2, Claude kept generating code for Hydra v1. The functions looked valid, but they didn’t exist anymore. I spent hours verifying why my code was failing.</li><li><strong>Losing Context</strong> → In long chats, AI sometimes “forgets” what it gave me earlier. I ask for a small update, and it rewrites everything differently, breaking the parts that worked.</li></ul><p><strong>Other pitfalls I’ve seen:</strong></p><ul><li>Inventing config values that don’t exist.</li><li>Generating <em>almost-correct</em> code that hides bugs.</li><li>Wasting more time debugging AI’s confident mistakes than if I had written it myself.</li></ul><p>And here’s the truth I’ve learned:</p><blockquote><strong><em>“What AI writes in a day, you may spend a week repairing.”</em></strong></blockquote><h3>Best Practices for Developers</h3><p>So how do we use AI responsibly? Here’s what works for me:</p><ul><li>Treat AI as a <strong>co-pilot, not an autopilot</strong>.</li><li>Always <strong>review and test</strong> its code.</li><li>Keep AI <strong>away from secrets</strong> — never paste keys or sensitive logic.</li><li><strong>Sandbox before production</strong>. Review diffs before merging.</li><li>Use AI for <strong>speed</strong>, keep humans for <strong>strategy and design</strong>.</li><li>Learn to <strong>prompt well</strong>, but also learn to <strong>debug AI mistakes</strong>.</li></ul><h3>Conclusion</h3><p>AI is already part of how we work. The real question is not <em>“Should we use it?”</em> but <em>“How do we use it responsibly?”</em></p><p>For me, the answer is balance. Let AI agents handle the boring parts, but keep humans in charge of judgment and strategy.</p><p>AI doesn’t replace developers — it changes how we work. And maybe that’s the real opportunity.</p><h3>Next Step</h3><p>Recently, I’ve been experimenting with <strong>Aider</strong> and <strong>Opencode</strong>, exploring how far I can push these tools without needing to rely on expensive subscriptions. Along the way, I’ve also discovered some practical ways to run AI agents <strong>cheaper than the usual $20/month plans</strong> — without sacrificing much capability.</p><p>I’ll be sharing those findings soon, along with step-by-step examples of how I use them in real projects. If you’ve ever wondered how to get the most out of AI agents without breaking the bank, stay tuned.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=383706629962" width="1" height="1" alt=""><hr><p><a href="https://medium.com/jufi-blogs/ai-code-or-ai-agent-is-it-really-for-you-383706629962">AI Code or AI Agent — Is It Really for You?</a> was originally published in <a href="https://medium.com/jufi-blogs">Blog yang ditulis Jufi</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fixing Select2 Issues in Laravel Livewire 3: A Frustrating but Solvable Challenge]]></title>
            <link>https://medium.com/jufi-blogs/fixing-select2-issues-in-laravel-livewire-3-a-frustrating-but-solvable-challenge-76eafa938b44?source=rss-64e32bce32ac------2</link>
            <guid isPermaLink="false">https://medium.com/p/76eafa938b44</guid>
            <category><![CDATA[select2]]></category>
            <category><![CDATA[laravel]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[livewire]]></category>
            <dc:creator><![CDATA[Jufianto Henri]]></dc:creator>
            <pubDate>Fri, 04 Apr 2025 10:41:54 GMT</pubDate>
            <atom:updated>2025-04-04T10:41:54.716Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*qp81YbN1Z_cI06Gw.jpg" /></figure><p>For the past couple of months, I’ve been working on building a simple CMS web app using <strong>Laravel</strong> with <strong>Livewire 3</strong>. While everything was going smoothly, I encountered an issue that left me frustrated — my <strong>Select2 dropdown wasn’t updating or binding data correctly in Livewire</strong>.</p><h3>📌 Why Use Select2?</h3><p>I chose <strong>Select2</strong> because I needed a simple UI component for searching through a list of data within a dropdown. Select2 provides an elegant solution that enhances standard &lt;select&gt; elements with search functionality, without requiring me to build a custom UI from scratch.</p><p>However, integrating <strong>Select2</strong> with <strong>Livewire 3</strong> wasn’t as straightforward as I expected. The problem? <strong>Livewire doesn’t automatically recognize updates made by JavaScript-based components like Select2.</strong></p><h3>🚨 The Issue: Select2 and Livewire Data Binding</h3><p>When using <strong>Livewire</strong>, form inputs are usually bound using wire:model, allowing real-time updates to the component state. However, since <strong>Select2 manipulates the DOM using JavaScript</strong>, Livewire doesn’t detect changes made by Select2 unless explicitly notified.</p><p>here my basic setup</p><h4>Blade Component (example.blade.php)</h4><pre><br>&lt;div&gt;<br>    &lt;form class=&quot;max-w-sm mx-auto mb-5&quot; wire:submit.prevent=&quot;submit&quot;&gt;<br>        &lt;label for=&quot;countries&quot; class=&quot;block mb-2 text-sm font-medium text-gray-900 dark:text-white&quot;&gt;Select an option&lt;/label&gt;<br>        &lt;select id=&quot;countries&quot; wire:model.live=&quot;select_value&quot; class=&quot;bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500&quot;&gt;<br>            &lt;option selected&gt;Choose a country&lt;/option&gt;<br>            &lt;option value=&quot;US&quot;&gt;United States&lt;/option&gt;<br>            &lt;option value=&quot;CA&quot;&gt;Canada&lt;/option&gt;<br>            &lt;option value=&quot;FR&quot;&gt;France&lt;/option&gt;<br>            &lt;option value=&quot;DE&quot;&gt;Germany&lt;/option&gt;<br>        &lt;/select&gt;<br><br>        &lt;input class=&quot;mt-2 block mb-2&quot; wire:model=&quot;select_value&quot;&gt;<br><br>        &lt;button type=&quot;submit&quot; class=&quot;text-white bg-blue-700 px-5 py-2 rounded-md&quot;&gt;Save&lt;/button&gt;<br><br>    &lt;/form&gt;<br>&lt;/div&gt;<br><br><br>&lt;script&gt;<br>    function init_select2(){<br>        var ctr = $(&#39;#countries&#39;)<br>        ctr.select2();<br>    }<br><br>  $(document).ready(function (){<br>        // init_select2();<br>    });<br>&lt;/script&gt;bla</pre><h4>Livewire Component (Example.php)</h4><pre>&lt;?php<br><br>namespace App\Livewire;<br><br>use Livewire\Component;<br><br>class Example extends Component<br>{<br><br>    public $select_value = &quot;default-value&quot;;<br><br>    public function render()<br>    {<br>        return view(&#39;livewire.example&#39;);<br>    }<br><br>    public function submit(){<br>        dd($this-&gt;select_value);<br>    }<br>}</pre><p>to be able use select2 and jquery, you must include this section on your blade layout</p><pre>&lt;script src=&quot;https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js&quot;&gt;&lt;/script&gt;<br>&lt;link href=&quot;https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css&quot; rel=&quot;stylesheet&quot; /&gt;<br>&lt;script src=&quot;https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js&quot;&gt;&lt;/script&gt;</pre><p>the code above I do comment on section init select2 and select2 should not be active or running.<br>here the expected result I need and this is without use select2</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OE2_Axe6xqICCmQDv_JPyA.gif" /></figure><p>you see after click save button I can see result the value I selected. lets turn on and init select2 by uncomment init_select2();</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_LG6XggfGRwQs5OmxCyybw.gif" /></figure><p>you can see the result still default-value and not binding based on value select we are selected.</p><h3>✅ The Solution: Manually Dispatching Events to Livewire</h3><p>Since <strong>Livewire 3</strong> doesn’t automatically detect DOM changes from <strong>JavaScript-based UI components</strong>, we need to manually update <strong>Livewire’s state</strong> when <strong>Select2</strong> changes.</p><h4>Livewire Component Updated (Example.php)</h4><pre>&lt;?php<br><br>namespace App\Livewire;<br><br>use Livewire\Attributes\On;<br>use Livewire\Component;<br><br>class Example extends Component<br>{<br><br>    public $select_value = &quot;default-value&quot;;<br><br>    public function render()<br>    {<br>        return view(&#39;livewire.example&#39;);<br>    }<br><br>    public function submit(){<br>        dd($this-&gt;select_value);<br>    }<br><br>    #[On(&#39;select-updated&#39;)]<br>    public function updateValue($val){<br>        $this-&gt;select_value = $val;<br>        $this-&gt;dispatch(&quot;update-value&quot;);<br>    }<br>}</pre><h3>Blade Component (example.blade.php)</h3><pre>&lt;div&gt;<br>    &lt;form class=&quot;max-w-sm mx-auto mb-5&quot; wire:submit.prevent=&quot;submit&quot;&gt;<br>        &lt;label for=&quot;countries&quot; class=&quot;block mb-2 text-sm font-medium text-gray-900 dark:text-white&quot;&gt;Select an option&lt;/label&gt;<br>        &lt;select id=&quot;countries&quot; wire:model=&quot;select_value&quot; class=&quot;bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500&quot;&gt;<br>            &lt;option selected&gt;Choose a country&lt;/option&gt;<br>            &lt;option value=&quot;US&quot;&gt;United States&lt;/option&gt;<br>            &lt;option value=&quot;CA&quot;&gt;Canada&lt;/option&gt;<br>            &lt;option value=&quot;FR&quot;&gt;France&lt;/option&gt;<br>            &lt;option value=&quot;DE&quot;&gt;Germany&lt;/option&gt;<br>        &lt;/select&gt;<br><br>        &lt;input class=&quot;mt-2 block mb-2&quot; wire:model=&quot;select_value&quot;&gt;<br><br>        &lt;p class=&quot;block text-sm mb-2&quot;&gt;value selected: {{ $select_value }}&lt;/p&gt;<br><br>        &lt;button type=&quot;submit&quot; class=&quot;text-white bg-blue-700 px-5 py-2 rounded-md&quot;&gt;Save&lt;/button&gt;<br><br>    &lt;/form&gt;<br>&lt;/div&gt;<br><br>&lt;script&gt;<br><br>    function init_select2(){<br>        var ctr = $(&#39;#countries&#39;)<br>        ctr.select2();<br>    }<br><br>    $(document).ready(function (){<br>        init_select2();<br>        $(&#39;#countries&#39;).on(&quot;change&quot;, function (e){<br>            window.Livewire.dispatch(&#39;select-updated&#39;, [$(this).val()]);<br>        });<br>    });<br><br>    Livewire.on(&quot;update-value&quot;, function (){<br>        setTimeout(init_select2, 0)<br>        console.log(&quot;event udpated and reset select2&quot;)<br>    })<br><br>&lt;/script&gt;</pre><h3>🔍 Key Fixes &amp; Takeaways</h3><p>✅ <strong>Manually dispatch the </strong><strong>select-updated event</strong> when Select2 changes.<br>✅ <strong>Listen for </strong><strong>update-value in Livewire</strong> to trigger a reinitialization of Select2.<br>✅ <strong>Use </strong><strong>setTimeout(init_select2, 0);</strong> to prevent Select2 from breaking after a Livewire re-render. setTimeout is needed because it ensures that Livewire processes its updates first before re-initializing Select2.</p><p>Now, every time a user selects an option, <strong>Livewire correctly updates its state</strong>, and <strong>Select2 remains functional</strong> after re-renders! 🚀</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BwjwNBT9xUUghaA7GBteyA.gif" /></figure><h3>🎯 Final Thoughts</h3><p>Integrating <strong>Select2</strong> with <strong>Livewire 3</strong> can be frustrating, but the solution is <strong>simple once you understand how Livewire handles JavaScript-based components</strong>. By manually dispatching updates and re-initializing Select2, you can enjoy the benefits of <strong>Livewire’s reactivity</strong> and <strong>Select2’s powerful search features</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=76eafa938b44" width="1" height="1" alt=""><hr><p><a href="https://medium.com/jufi-blogs/fixing-select2-issues-in-laravel-livewire-3-a-frustrating-but-solvable-challenge-76eafa938b44">Fixing Select2 Issues in Laravel Livewire 3: A Frustrating but Solvable Challenge</a> was originally published in <a href="https://medium.com/jufi-blogs">Blog yang ditulis Jufi</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Init your golang gRPC Services]]></title>
            <link>https://jufianto.medium.com/init-your-golang-grpc-services-bd40b94fb0f3?source=rss-64e32bce32ac------2</link>
            <guid isPermaLink="false">https://medium.com/p/bd40b94fb0f3</guid>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[go]]></category>
            <category><![CDATA[grpc]]></category>
            <dc:creator><![CDATA[Jufianto Henri]]></dc:creator>
            <pubDate>Sat, 09 Nov 2024 14:58:22 GMT</pubDate>
            <atom:updated>2024-11-19T14:36:08.366Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/953/1*lQCVW1E6IIlFxkVxhU4OeA.png" /></figure><p>Hello, After such a long time I’m not writing again (<a href="https://medium.com/jufi-blogs/install-aplikasimu-dengan-docker-d434e902400e">last time wrote on medium</a>), and finally I do gather the intention to make an article again. today I want to share how I create my grpc services from scratch.</p><p>for the context I want to create continuous articles, I will try to build complex system applications that will mock real-world problems. but let&#39;s see later if I can complete that. for now lets do focus on how to creating the golang grpc services, I will create really simple application and how to test it.</p><h3>Install the prerequisite tools</h3><p>you need to install protoc first, I used Linux so to install that need to run</p><pre>sudo apt install -y protobuf-compiler</pre><p>how if I use macos? run this, but I’m not sure if its works because I don&#39;t have macos</p><pre>brew install protobuf</pre><p>if already installed, please verify by run</p><pre>protoc --version</pre><p>it will show the version of protoc, for me I have protoc version libprotoc 3.6.1. after doing that, install the requirement plugin protoc for golang</p><pre>go install google.golang.org/protobuf/cmd/protoc-gen-go@latest<br>go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest</pre><p>and make sure bin for protoc-gen-go and protoc-gen-go-grpc already on your path.</p><h3>Path Structure</h3><p>so this is the structure of my project, btw this path structure will look complicated because I want to make a continuous app later in this project, so just bear with it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/305/0*mznejU0PZxmq1Rpe.png" /></figure><p>little breakdown of what inside the folder.<br>agent -&gt; it will the base application. basically I want to make app using state-machine pattern<br>agent/client -&gt; it will hold the client type and the handler for GRPC<br>proto -&gt; this will based proto files for our grpc. the files *.pb.go and *_grpc.pb.go will generated automatically, we just need to write .proto files for service definition of rpc</p><h3>Make your syntax proto</h3><p>Let&#39;s make your syntax proto</p><p><strong>proto/agent.proto</strong></p><pre>syntax = &quot;proto3&quot;;<br>option go_package = &quot;github.com/jufianto/state-agent/agentsrv-proto&quot;;<br><br>enum TaskStatus{<br>    UNKNOWN = 0;<br>    PROCESSING = 1;<br>    FAILED = 2;<br>    SUCCESS = 3;<br>}<br><br>message TaskRequest{<br>    string task_id = 1;<br>    string task_name = 2;<br>    string task_url = 3;<br>}<br><br>message TaskResponse{<br>    string task_id = 1;<br>    string task_result = 2;<br>    TaskStatus task_status = 3;<br><br>}<br><br>message TaskListResponse{<br>    repeated TaskResponse tasks = 1;<br>}<br><br>message TaskListRequest{<br>    repeated string tasks_id = 1;<br>}<br><br>message TaskNotify{<br>    string task_id = 1;<br>    TaskStatus task_status = 2;<br>}<br><br>message TaskStatusRequest {<br>    string task_id = 1;<br>}<br><br>message TasksStatusResponse {<br>    string task_id = 1;<br>    TaskStatus task_status = 2;<br>}<br><br>service TaskService{<br>    rpc CreateTask(TaskRequest) returns (TaskResponse) {}<br>    rpc ListTask(TaskListRequest) returns (TaskListResponse) {}<br>    rpc StatusTask(TaskStatusRequest) returns (TasksStatusResponse){}<br>}rc</pre><p>what happens on that code?</p><ul><li>option go_package will be result as your package grpc after .go files generated</li><li>enum is the type enum of TaskStatus will be message will be like the type struct on golang</li><li>string task_id = 1; is explains the type of data of task_id is string and the number should be consistent on the field. the number is needed to identify the binary serialized later. so if you want later to add a new field, you must not change the number on the field, just add it. it can break the backward compatibility when deserialized later.</li><li>service TaskService is the defined of service grpc</li></ul><p>after you coded that, lets go to the folder proto and execute this command to generate the grpc code go</p><pre> protoc --go_out=. --go_opt=paths=source_relative \<br>    --go-grpc_out=. --go-grpc_opt=paths=source_relative \<br>*.proto</pre><p>and you will see the results on proto folder has 2 files<br>agent.pb.go -&gt; the Go struct definitions for messages proto, It also includes methods to serialize/deserialize (marshal/unmarshal) the messages to/from binary or JSON formats.<br>agent_grpc.ob.go. -&gt; contains the grpc specific code, like the server/client definitions, and also a list of method/services grpc</p><h3>Let&#39;s do the real code</h3><p>after generating the grpc code, create files client.go on the folder client and fill with this code.</p><p><strong>client.go</strong></p><pre>package client<br><br>import (<br>    agentsrv_proto &quot;github.com/jufianto/state-agent/proto&quot;<br>    &quot;google.golang.org/grpc&quot;<br>)<br><br>type AgentService struct {<br>    Key string<br>    agentsrv_proto.UnimplementedTaskServiceServer<br>}<br><br>type TaskResult struct {<br>    TaskID     string<br>    TaskResult string<br>    TaskStatus string<br>}<br><br>func NewAgentClient(key string) *AgentService {<br>    return &amp;AgentService{<br>        Key: key,<br>    }<br>}<br><br>func (a *AgentService) RegisterGW(srvGrpc *grpc.Server) {<br>    agentsrv_proto.RegisterTaskServiceServer(srvGrpc, a)<br>}</pre><p>and also code the handler.go</p><p><strong>handler.go</strong></p><pre>func (a *AgentService) CreateTask(ctx context.Context, req *agentsrv_proto.TaskRequest) (*agentsrv_proto.TaskResponse, error) {<br>    fmt.Printf(&quot;got request %+v \n&quot;, req)<br><br>    return &amp;agentsrv_proto.TaskResponse{<br>        TaskId:     req.TaskId,<br>        TaskResult: &quot;waiting for processing&quot;,<br>        TaskStatus: agentsrv_proto.TaskStatus_PROCESSING,<br>    }, nil<br>}<br><br>func (a *AgentService) ListTask(ctx context.Context, req *agentsrv_proto.TaskListRequest) (*agentsrv_proto.TaskListResponse, error) {<br><br>    log.Println(&quot;list tasks&quot;, req.GetTasksId())<br><br>    return nil, fmt.Errorf(&quot;not yet implemented&quot;)<br><br>}<br><br>func (a *AgentService) StatusTask(ctx context.Context, req *agentsrv_proto.TaskStatusRequest) (*agentsrv_proto.TasksStatusResponse, error) {<br>    log.Println(&quot;status tasks&quot;, req.GetTaskId())<br><br>    return nil, fmt.Errorf(&quot;not yet implemented&quot;)<br>}</pre><p><strong>what happens on that code?</strong><br>so, client.go it the base client for our primary services, it will hold the agentsrv_proto.UnimplementedTaskServiceServer interface to make sure the handler will implemented the services grpc.</p><p>the real thing gRPC is coming from this code agentsrv_proto.RegisterTaskServiceServer(srvGrpc, a) it will make the grpc server registered on this handler and can be used later as grpc services.</p><p>and for the handler.go it will implemented from grpc generated code from the rpc we defined on protofiles. on the proto files, you can see you have rpc services look like this</p><pre>   rpc CreateTask(TaskRequest) returns (TaskResponse) {}<br>    rpc ListTask(TaskListRequest) returns (TaskListResponse) {}<br>    rpc StatusTask(TaskStatusRequest) returns (TasksStatusResponse){}</pre><p>and all of this method grpc need to be implemented as you can see from the handler.go</p><p>Finally, lets write the main.go</p><p><strong>main.go</strong></p><pre>package main<br><br>import (<br>    &quot;fmt&quot;<br>    &quot;log&quot;<br>    &quot;net&quot;<br><br>    &quot;github.com/jufianto/state-agent/agent/client&quot;<br><br>    &quot;google.golang.org/grpc&quot;<br>    &quot;google.golang.org/grpc/reflection&quot;<br>)<br><br>func main() {<br><br>    srvGrpc := grpc.NewServer()<br><br>    srv := client.NewAgentClient(&quot;key123&quot;)<br>    srv.RegisterGW(srvGrpc)<br><br>    fmt.Println(&quot;service listening....&quot;)<br><br>    net, err := net.Listen(&quot;tcp&quot;, &quot;:3333&quot;)<br>    if err != nil {<br>        log.Fatalf(&quot;failed to register grpc: %v&quot;, err)<br>    }<br><br>    reflection.Register(srvGrpc)<br>    srvGrpc.Serve(net)<br><br>}</pre><p>srvGrpc := grpc.NewServer() will be init the grpc server, and srv.RegisterGW will be registered the handler to server grpc and finally do serve on srvGrpc.Serve(net) with port 3333</p><p>reflection.Register(srvGrpc) it is just for a helper to check all the services on grpc services.</p><h3>Run your services</h3><p>to run your services, please do run<br>go run agent/main.go and it will looks like</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/237/0*_MkV8buu9HHUFY7n.png" /></figure><p>and you need to test it by postman</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*7LUj82i_2MzpAdyc.png" /></figure><p>you can see from the list down on postman, there have option list Create Task, ListTask, thats the use of reflection package. it will help us to check what all the method on the gRPC services.</p><h3>FAQ</h3><p>Q: usually on Rest API services, I see there have routing that help route the services based on the path we called. but Why I dont see on here?<br>A: that’s the magic of grpc, basically its not based on routing but based on the method implemented. the method handler it should be the same as the method we defined on the grpc generated code or can be simplified based on the proto rpc services defined.</p><p>The <a href="https://github.com/jufianto/grpc-learning-blog">Github Repo</a> for this Projects</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bd40b94fb0f3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Install aplikasimu dengan docker]]></title>
            <link>https://medium.com/jufi-blogs/install-aplikasimu-dengan-docker-d434e902400e?source=rss-64e32bce32ac------2</link>
            <guid isPermaLink="false">https://medium.com/p/d434e902400e</guid>
            <category><![CDATA[app-development]]></category>
            <category><![CDATA[go]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[deployment]]></category>
            <dc:creator><![CDATA[Jufianto Henri]]></dc:creator>
            <pubDate>Fri, 29 Jan 2021 20:05:58 GMT</pubDate>
            <atom:updated>2021-01-29T20:10:03.239Z</atom:updated>
            <content:encoded><![CDATA[<h4>how to make your app with docker</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*4GHghnTrGUMlaCie.png" /><figcaption>source: Google Images</figcaption></figure><blockquote>Jika hanya ingin melihat tutorial bagaimana menggunakan docker dan deploy aplikasimu ke docker silahkan lansung ke topik <strong>Install Aplikasi pada Docker. </strong>saya akan membahas sedikit teori dari docker agar para developer yang tidak pernah menggunakan linux maupun belajar tentang server dapat mengerti konsep kenapa docker</blockquote><h4><em>Warning Notes</em></h4><blockquote>kenapa pada tutorial ini banyak sekali tulisannya dari pada gambar, karena saya menuangkan semua pengetahuan saya kedalam tulisan dan menjelaskan secara awam teori yang dirasanya perlu agar memudahkan pembaca lebih memahami materi ini, diharapkan agar pembaca tidak malas membaca agar mendapatkan pemahaman yang lebih baik</blockquote><p>apakah anda seorang developer? anda mempunyai stack technology yang berbeda — beda seperti PHP, Go, ReactJS, ataupun Node. bagaimana kalau ada satu aplikasi yang pakai PHP versi 5 yang satu pakai PHP versi 7 dalam satu server? tentunya kita sebagai developer pusing akan itu, masa kita harus install dan uninstall versi bahasa pemograman setiap kali ada project yang menggunakan bahasa pemograman yang berbeda. nah untuk itulah docker ini dibutuhkan, tujuan dari docker adalah agar anda tidak perlu pusing dengan harus menginstall setiap library setiap bahasa pemgoraman. jadi pada intinya docker itu membuat anda bisa menggunakan bahasa pemograman PHP 5 dan PHP 7 dalam satu server yang ada.</p><h3>Seputar Teori Docker</h3><p>Docker merupakan hal wajib dikuasi developer menurut saya, karena itu memudahkan saya terutama dalam melakukan migrasi aplikasi dari VPS yang satu ke VPS yang satu lagi.</p><p>docker itu termasuk bersifat container, nah apa itu container ? yang saya tau teknologi virtualisasi itu terbagi dalam 2 jenis, yaitu container dan virtual machine , teknologi virtual machine (yang akan saya singkat jadi VM) itu ibaratnya kita memiliki 1 komputer dan kita bagi bagi resource yang ada. misalnya kita memiliki komputer yang RAM nya 4 GB, nah kita ingin bagi jadi 2 virtual machine yang artinya kita bagi menjadi 2 GB untuk virtual machine A, dan 2 GB untuk virtual machine B, dan kedua virtual machine itu memiliki sistem operasi yang berbeda dan library yang berbeda juga. jadi kalau seandainya VM A kehabisan resource (<em>Full Load</em>) maka tidak akan mempengaruhi VM B, begitulah kira kira kinerja Virtual Machine.</p><p>dan bagaimana dengan container? container itu ibaratnya kita memiliki 1 komputer tapi memiliki pemisahan pada library-library setiap container, container hampir sama dengan VM tetapi dia tidak memiliki resource yang terpisah melainkan library yang terpisah. dengan itu dimilikilah kesimpulan bahwa setiap container tidak bisa seperti VM yang bisa memiliki OS yang berbeda, tetapi harus mempunyai OS yang sama dan bisa memiliki library yang berbeda.</p><p>nah berdasarkan intro saya yang paling atas tadi, disimpulkan lah bahwa teknologi container ini dalam kasus ini docker dapat menginstall / memiliki library yang berbeda beda dan tidak perlu takutnya dengan adanya konflik antar libarary. lebih jelasnya coba anda lihat pada gambar</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6wznwZXjgJ7AmugN" /><figcaption>source: searching on google image</figcaption></figure><p>untuk perihal lebih jelas seputaran docker dan container silahkan lihat lihat google ya, jika ada yang ingin bertanya silahkan berikan komentar atau tanyakan ke saya melalui Twitter</p><p>nanti pada sistem docker akan ada istilah images dan container. images itu merupakan kumpulan dari library yang dibentuk menjadi satu kesatuan, bisa kita ibaratkan seperti sistem operasi yang dimana memiliki aplikasi seperti microsoft word, steam dan library lainnya, dan ada juga beberapa yang sudah melakukan bundle terhadap bahasa pemograman tertentu seperti golang, php, nodejs, python dan ada juga bundle seperti ubuntu dan lain-lainnya. container itu merupakan hasil dari images yang telah di bundle dan di <strong><em>running </em></strong>oleh si docker tersebut.</p><h3>Install Docker pada Server Linux</h3><p>untuk penginstalan saya rasa tidak perlu saya jelaskan lebih panjang, silahkan anda mengikuti tutorial yang saya berikan ini dari official docker <a href="https://docs.docker.com/get-docker/">https://docs.docker.com/get-docker/</a></p><p>dan pastikan bahwa docker anda telah terinstall</p><pre>docker run hello-world</pre><p>dan pastikan mendapat tampilan seperti ini</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1013/1*c9WGf53AUgxabwES_lkxyQ.png" /></figure><p>nah jika sudah tampil seperti itu maka docker sudah terinstall.</p><p>berikut ada beberapa ringkasan perintah yang digunakan umum pada docker</p><h4>List perintah yang paling sering digunakan dalam docker</h4><p>docker ps → untuk mengecek docker container yang sedang running.</p><p>docker ps -a → untuk mengecek dokcer container yang dalam keadaan status running dan berhenti.</p><h3>Install Aplikasi pada Docker</h3><p>disini saya menggunakan aplikasi yang pernah saya buat, aplikasi sederhana yang mencatat task task yang kita pergunakan. untuk info lebih lanjut silahkan meliaht informasinya kesini <a href="https://github.com/jufianto/go-task">https://github.com/jufianto/go-task</a></p><p>dan untuk informasi server saya menggunakan server Google Cloud Engine(GCP) dengan spesifikasi server</p><pre>CPU        : 2 vCPUs<br>RAM        : 2 GB<br>Zone       : asia-southeast2-a<br>OS         : Ubuntu</pre><p>silahkan download aplikasi yang akan digunakan dalam tutorial kali ini dengan perintah</p><pre>git clone <a href="https://github.com/jufianto/go-task.git">https://github.com/jufianto/go-task.git</a></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*TGcCG7KzY2h_s8-zO7XgHg.png" /></figure><p>setelah berhasil di clone / dicopy buat Dockerfile dengan mengisi kode sebagai berikut</p><pre># go-task/Dockerfile<br>FROM golang:latest<br>WORKDIR /app<br>COPY . .</pre><pre>CMD [&quot;go&quot;, &quot;run&quot;, &quot;main.go&quot;, &quot;route.go&quot;]</pre><p>jadi Dockerfile ini digunakan untuk melakukan bundle / custom images agar sesuai dengan aplikasi yang kita jalankan. seperti dilihat pada kode diatas bahwa kita mengambil hasil bundle images dari golang:latest dan kita jalankan beberapa perintah agar sesuai dengan aplikasi yang kita harapkan</p><h4>Deskripsi kode</h4><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>FROM golang:latest menjelaskan bahwa images yang dipakai adalah versi golang dengan tag/version latest</p><p>WORKDIR /app membuat folder app pada sistem container dan menjadikan folder app tersebut sebagai folder utama atau folder saat ini di sistem docker</p><p>COPY . . melakukan copy seluruh data dari local root host( . menandakan direktori saat ini) ke local docker container</p><p>CMD [&quot;go&quot;, &quot;run&quot;, &quot;main.go&quot;, &quot;route.go&quot;] menjalankan perintah go run main.go route.go pada saat images docker dijalankan.</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>dan akan terlihat sturcture directory seperti berikut</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kxISUpBcddBKGQeiLE2xIQ.png" /><figcaption>direktori aplikasi</figcaption></figure><pre>├── Dockerfile<br>├── Makefile<br>├── README.md<br>├── build<br>│   └── go-task.exe<br>├── go.mod<br>├── kegiatan<br>│   └── kegiatan-bulan-07-2020.csv<br>├── lib<br>│   ├── csv.go<br>│   └── http.go<br>├── main.go<br>├── route.go<br>├── web<br>│   └── handler.go<br>└── windows.txt</pre><p>setelah itu akan dilakukan proses <strong><em>build </em></strong>atau membundle beberapa perintah dan library yang kita definisikan pada Dockerfile diatas tadi dengan perintah.</p><pre>docker build -t my-task .</pre><p>disini saya melakukan build dengan option -t yang bermaksud memberi nama dari images yang akan kita bundle sebagai my-task . titik pada opsi terakhir perintah menandakan bahwa saya akan melakukan bundle pada direktori root(saat ini) yang tertera pada gambar direktori diatas. perintah docker build akan otomatis mencari file yang bernama Dockerfile dan akan melakukan bundle sesuai dengan perintah/kode yang ada pada dokumen tersebut. pada gambar dibawah terlihat bahwa saya memiliki 1 images yang bernama my-task</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/787/1*LQtFuGQqIm5JSApV6n0TZA.png" /></figure><p>setelah dilakukan <strong><em>build</em></strong>, maka selanjutnya adalah menjalankan images yang telah bundle menjadi container dengan perintah berikut</p><pre>docker run --name my-running-task -d -p 1600:1700 my-task</pre><p>-name digunakan untuk memberi nama container menjadi my-running-task sedangkan -d agar menjalankan container tersebut secara daemon dan my-task itu adalah nama images yang akan dijalankan menjadi container . pada bagian -p digunakan untuk melakukan expose port dari port asal images container yang telah kita set tadi 1700 menjadi port host1600 yang artinya aplikasi akan bisa diakses melalui IP Address server dengan port 1600.</p><p>jika telah running, pastikan dengan mengetik perintah berikut</p><pre>docker ps </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oNmAjwtyjJGJiV7pkOkc3A.png" /></figure><p>pada gambar terlihat bahwa saya telah menjalankan docker container dengan ID f375e59c16b1 dengan port 1600<em> </em>pada host yang di <em>binding </em>dengan port docker 1700 .</p><p>setelah itu saya lakukan percobaan pada postman dan saya mendapat respon sesuai dengan yang diharapkan dari aplikasi</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3pm37go_gIdmD37NqKPYGg.png" /></figure><h3>Warning Session</h3><p>karena saya menggunakan GCP sebagai server percobaan saya, maka saya harus membuka port khusus (1600)yang pada settingan firewall console GCP tidak mengijinkan port khusus . maka dari itu saya harus membuka port khusus tersebut dengan pergi ke menu</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/952/1*tgyHGwHlImrzFLuJIdgCdQ.png" /></figure><p>dan klik buat pengaturan firewall baru</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N0YTXQJohBHauICVc2l7Fg.png" /></figure><p>pada seksi name masukan nama yang anda inginkan</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/873/1*yhGqxpjmuZueghhJdbePbA.png" /></figure><p>dan pada bagian target-tags dan source IP Ranges masukan seperti gambar berikut. tujuan dari memberikan target-tags agar nanti setiap pembentukan compute engine tinggal hanya memberikan nama TAGS agar compute engine pada GCP mengikuti firewall rule dari kita berikan, sedangkan Source IP Ranges dimaksud untuk menerima masukan koneksi dari pintu internet (0.0.0.0/0)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/845/1*YIdtHsHTrfEr1zb07TPRzQ.png" /></figure><p>setelah itu edit server compute engine dan ubah network-tags pada settingan edit compute engine menjadi tags yang telah kita definisikan pada pembuatan firewall rule diatas. maka secara otomatis server compute engine tersebut akan mengikuti firewall rule yang telah didefinisikan.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/1*7wxiVCYMh2wCENJ1JIllKQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d434e902400e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/jufi-blogs/install-aplikasimu-dengan-docker-d434e902400e">Install aplikasimu dengan docker</a> was originally published in <a href="https://medium.com/jufi-blogs">Blog yang ditulis Jufi</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My Pilot Project with Golang]]></title>
            <link>https://medium.com/jufi-blogs/my-pilot-project-with-golang-b4907854246c?source=rss-64e32bce32ac------2</link>
            <guid isPermaLink="false">https://medium.com/p/b4907854246c</guid>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[vscode]]></category>
            <category><![CDATA[projects]]></category>
            <category><![CDATA[go]]></category>
            <dc:creator><![CDATA[Jufianto Henri]]></dc:creator>
            <pubDate>Sun, 23 Feb 2020 13:42:33 GMT</pubDate>
            <atom:updated>2020-02-23T13:49:35.955Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*X_rh72raIxlFsHbRBWXmvw.jpeg" /><figcaption>I copied this image on google</figcaption></figure><p>go language or ussualy we call golang in this year i think be the most popular programming language in this year. so many company hire or find golang users for their projects.</p><p>i will make this blog as my note for what i am learning in golang. In the end of this series i hope i can built application which can handle all action about users management, i will make in API so maybe can be used as microservices.</p><p>several days ago, i make project in github and i have analyst my app who name micro-users. check in this <a href="https://github.com/jufianto/micro-users">Repository</a> can find out analyst.md . but in this stories i will make simple app in golang and build it into excetutable</p><p>for this stories i use my laptop with</p><blockquote>Windows 10 Home Single Language<br>Golang Version 1.13.8<br>RAM 8 GB <br>AMD Ryzen 5 2500U<br>GIT Scm for windows<br>Vscode as code editor</blockquote><h4>first step →install golang</h4><p>if you have an system operation Windows, you can download your golang binary in this <a href="https://golang.org/">golang offcial site</a>. for how to install, just install just like ussualy you install app, for me, i used my next method install in windows which just klik next button until i see finish button. open your git bash app like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/818/1*c9ryoDbZqnZ13pO2FrcwRw.png" /><figcaption>find your git bash</figcaption></figure><p>why i am use git bash ? because i familiar with linux, so in git bash app in windows you can excecute linux command. you will get like this pictures</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IVOIplBOZXbbFqiW_9Rijw.png" /><figcaption>git bash terminal</figcaption></figure><p>and type go version , if response version or go thats mean you have success install your golang.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/719/1*ojGTEtQdMhPtfAd9n07Uvg.png" /><figcaption>go version check</figcaption></figure><h4>the next step → clone repository</h4><p>i clone my repository has file my analyst for app i build, in iniate repository i don’t have any golang file, just my markdown file with associate with Readme and Analyst file, this my list file of my fresh repository</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fZLGM7wkZFEnR8l3RAZJKw.png" /></figure><p>you can clone or make any pull request in<a href="https://github.com/jufianto/micro-users"> https://github.com/jufianto/micro-users</a>. clone my repo in directory what you want with in terminal and gotcha, i got my file</p><pre>git clone <a href="https://github.com/jufianto/micro-users">https://github.com/jufianto/micro-users</a></pre><p>here is my full command</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/582/1*2Hr3nLuP8dWG2228VIGEqw.png" /><figcaption>clone repo</figcaption></figure><p>ups sorry i have some privacy folder, so i mark this.</p><h4>the other next step → initate project golang</h4><p>you have initate your golang project with go mod, why ? for i know until now this will make simple your project for module/depedency management, just do this command and we will know the function go mod in later, MAYBE</p><pre>go mod init github.com/jufianto/micro-users</pre><p>this command will make file named go.mod with have contents</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/1*0rMzHfE5m6JbLF65jibWUA.png" /><figcaption>go mod contents file</figcaption></figure><p>see my go.mod contents start with command cat go.mod</p><h4>the step next → Setup your code editor</h4><p>for know the simplest setup code editor for go is <strong>Visual Studio Code(vscode), </strong>its free editor just download from official site and install your vscode on your machine.</p><p>before start with golang programming language, you must install golang plugin for vscode like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/955/1*PeHX66Svw-OnMIG2M-UvWA.png" /><figcaption>install go plugin vscode</figcaption></figure><p>move your cursor to redbox, type go on search box and click <strong>install.</strong></p><h4>the other step → create hello go example</h4><p>yeah, just in like other stories or blog, for starter will make funciton of code named thehello app. open your vscode and make file named hello.go and make contents like this</p><p>for first open go file, i got message notification like this, i new in golang so i don’t know the function of this plugin, but i think its important for development so i just click <strong>update </strong>and <strong>install </strong>my this plugin</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/803/1*8y9abWQRQE33XLzbBDiUgw.png" /><figcaption>install additional plugin golang</figcaption></figure><p>you will like notification like , just click reload</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NsKlaNmPAiKqwX2ijp35JA.png" /><figcaption>notification success install</figcaption></figure><p>and write contents your first golang app like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AqUz16x77IW77BT7OD2wRQ.png" /><figcaption>code go</figcaption></figure><p>more detail explain about code</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7238f33a687a8e8e6c7fe3bd3ba8df8a/href">https://medium.com/media/7238f33a687a8e8e6c7fe3bd3ba8df8a/href</a></iframe><p>and run your go code with</p><pre>go run hello.go</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*Vxd9phyLmlVwlqMbGuVjtA.png" /><figcaption>result go</figcaption></figure><p>and, welcome to the club of go bro….</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b4907854246c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/jufi-blogs/my-pilot-project-with-golang-b4907854246c">My Pilot Project with Golang</a> was originally published in <a href="https://medium.com/jufi-blogs">Blog yang ditulis Jufi</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My Git Workflow with Gitlab]]></title>
            <link>https://medium.com/jufi-blogs/my-git-workflow-with-gitlab-417a092bec39?source=rss-64e32bce32ac------2</link>
            <guid isPermaLink="false">https://medium.com/p/417a092bec39</guid>
            <category><![CDATA[gitlab]]></category>
            <category><![CDATA[workflow]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[kongkow-it-pekanbaru]]></category>
            <category><![CDATA[gitflow]]></category>
            <dc:creator><![CDATA[Jufianto Henri]]></dc:creator>
            <pubDate>Thu, 26 Dec 2019 11:05:39 GMT</pubDate>
            <atom:updated>2019-12-27T07:58:19.901Z</atom:updated>
            <content:encoded><![CDATA[<p>git merupakan sarana yang bagus untuk menerapkan project besar dan menggunakan team lebih dari 1 orang. jadi pada intinya git itu sebuah tools yang digunakan untuk manajemen versioning control. disini saya akan menjelaskan bagaimana git workflow yang saya dan team gunakan untuk pekerjaan kami .</p><p>saya menggunakan git workflow feature branch, lebih detailsnya cek <a href="https://www.atlassian.com/git/tutorials/comparing-workflows/feature-branch-workflow">disini</a>.</p><p>sebelum menggunakan workflow ini, ada beberapa rule yang harus diikuti dulu.</p><blockquote>Jangan pernah mengubah file di branch master</blockquote><p>pada tutorial kali ini kita akan menggunakan 1 project test dari Kongkow IT Pekanbaru dengan nama <strong>test-gitflow </strong>dan akan menggunakan 2 contoh akun.</p><p>ini flowchart yang akan digunakan</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/501/1*7DIKyJQYu2yu9GOLr9Y8mQ.png" /><figcaption>Flowchart Gitlab Flow</figcaption></figure><p>berikut isi dari branch master yang digunakan.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KTJhUffglnoyiyUYX4N8ug.png" /><figcaption>master branch</figcaption></figure><p>sebelum membuat issues, harus dibuat dulu <strong>milestone</strong> yang akan digunakan. Milestone merupakan penamaan yang akan digunakan untuk menentukan tujuan yang akan dicapai. disini milestone yang digunakan itu akan berisi target dari sprint yang akan ditentukan oleh team selama 2 minggu kedepan. penamaan milestone akan dibuat dengan format sprint:TanggalBulan(start)-TanggalBulan(END)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nOxz-mHRuPDn8RHGbxFc6Q.png" /><figcaption>contoh pembuatan milestone</figcaption></figure><h4>Buat issue pada Project</h4><p>contohnya kita memiliki issue / kegiatan yang akan dilakukan, maka team akan membuat issues pada gitlab, dengan ketentuan</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bE7KBqEshE8ZJzSRn9dRBg.png" /></figure><ul><li>Title : Harus berisi informasi tentang kegiatan / issue yang dibuat, disarankan hanya terdiri dari 5–7 kata, tidak perlu terlalu detail menjelaskannya, asalkan dapat dipahami saja</li><li>Description : Berisi informasi tentang deskripsi dari error atau kegiatan yang akan dilakukan, diharapkan mendetailkan masalah yang ada disana, bagaimana cara penyelesaian dan hal hal terkait issue yang di ajukan</li><li>Assigne : berisi informasi siapa yang harus mengerjakan task / issue yang diajukan</li><li>Milestone: berisi informasi sprint / milestone yang dikerjakan</li><li>Labels : label tentang issues yang akan dibuat, terdapat beberapa label default dari projet, akan dijelaskan nanti</li><li>Due date: dibuat apabila task yang digunakan harus dikerjakan dalam waktu beberapa hari</li></ul><p>saat ini saya membuat beberapa label yang digunakan dengan ketentuan</p><ul><li>To Do : untuk pekerjaan yang akan dibuat dalam hari ini</li><li>Doing : untuk issue sedang dibuat / dikerjakan</li><li>Frontend : apabila issue itu terkait dengan frontend</li><li>Backend : apabila issue itu terkait dengan backend</li><li>Error : Apabila ada project lain yang tidak dalam <strong>sprint </strong>yang tetapkan dalam status urgent harus dikerjakan</li><li>On Test: apabila issues tersebut sudah selesai dan sudah di test dengan baik</li><li>RnD : apabila issues tersebut dalam kegiatan Riset terhadap sesuatu</li></ul><p>setelah itu submit issue tersebut.</p><h4>Create merge request issues</h4><p>setelah issue dibuat, maka kegiatan selanjutnya adalah buat merge request dari issue yang telah dibuat, sebelumnya lihat dulu issue yang telah dibuat tadi</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vm6VnOF9sz2YMZQArNmPeA.png" /></figure><p>terlihat disana ada sebuah issues dengan labels frontend dan todo, tapi disana belum terlihat siapa yang akan mengerjakannya dan berada pada milestone dimana, sebelum mengerjakan issue tersebut <strong>assigne</strong> dulu dan tambahkan <strong>milestone.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NtdaiS0Q93VYSaeWo7P_mA.png" /></figure><p>setelah selesai di <strong>assignee </strong>maka klik <strong>Create merge request</strong> pada tombol yang ada di halaman issue. merge request sama artinya dengan kita membuat branch baru dan akan mengerjakan issue yang diambil berdasarkan branch tersebut . btw di gitlab menjelaskan bahwa merge request adalah</p><blockquote>Merge requests are a place to propose changes you have made to a project and discuss those changes with others.Interested parties can even contribute by pushing commits if they want to.Currently there are no changes in this merge request’s source branch. Please push new commits or use a different branch.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bud64cjtidMngu6VGLesHg.png" /><figcaption>Tampilan Merge Request</figcaption></figure><p>jika berhasil merge requestnya, maka akan seperti tampilan di atas. langkah selanjutnya buat branch baru di lokal berdasarkan branch yang dibuat oleh <em>gitlab.</em>untuk melihat cara bagaimana membuat branch baru di lokal, klik <strong>check out branch</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/1*-mofpyfK1xrUEC3WB7mGkQ.png" /></figure><p>ketikan perintah ini untuk checkout ke branch yang telah dibuat di remote repository</p><pre>git fetch origin<br>git checkout -b &quot;1-tambah-interface-login&quot; &quot;origin/1-tambah-interface-login&quot;</pre><p>buat beberapa perubahan pada branch yang di checkout, setelah itu lakukan commit dan push branch tadi ke branch remote yang ada gitlab. berikut beberapa hal yang saya lakukan.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rHFj7wi44tgYV9f28jivXA.png" /></figure><p>untuk beberapa hal alasan keamanan, saya sensor sedikit beberapa tulisan yang ada. lihat lagi ke halaman merge request, terlihat disana saya telah melakukan commit pada branch tersebut</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UzNd2qCG_1GOp-D2TIgNeg.png" /></figure><p>setelah rasanya tidak ada lagi perubahan yang akan dilakukan, tahapan selanjutnya branch 1-tambah-interface-login di merge ke branch master. sebelumnya lakukan terlebih dahulu Resolve WIP Status (WIP : Work In Progress) itu menandakan bahwa branch yang digunakan sudah selesai pengembangannya dan siap untuk di merge. setelah itu akan muncul tampilan merge sesuai dengan gambar berikut</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*928TMu7BvJyPmMQtzuwdUA.png" /></figure><p>jika tombol merge bewarna hijau dan ada tombol checklist itu menandakan bahwa branch 1-interface-loginbisa di merge ke branch master .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4eRzfnGFLcz0Ck3dxEHppQ.png" /></figure><p>klik tombol merge dan setelah itu akan mendapatkan hasil seperti gambar berikut</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4eRzfnGFLcz0Ck3dxEHppQ.png" /></figure><p>dan branch 1-interface-login telah berhasil di merge ke branch master. issue yang dibuat tadi juga akan otomatis ke <strong>close .</strong> untuk memastikan bahwa commit yang dilakukan di branch 1-interface-login telah ada lihat hasil commit pada branch master dan akan terlihat seperti</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XgbAn3tPGSvgXDs2uoA4SQ.png" /></figure><p>segitu dulu untuk Gitlab Workflow. untuk next mungkin saya akan share dasar-dasar GIT dan juga kita akan belajar kedepannya bagaimana menggunakan Git CI/CD.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=417a092bec39" width="1" height="1" alt=""><hr><p><a href="https://medium.com/jufi-blogs/my-git-workflow-with-gitlab-417a092bec39">My Git Workflow with Gitlab</a> was originally published in <a href="https://medium.com/jufi-blogs">Blog yang ditulis Jufi</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setting Web Server Debian dan Install Wordpress]]></title>
            <link>https://medium.com/jufi-blogs/setting-web-server-debian-dan-install-wordpress-1d600ff21ce9?source=rss-64e32bce32ac------2</link>
            <guid isPermaLink="false">https://medium.com/p/1d600ff21ce9</guid>
            <category><![CDATA[wordpress]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[kongkow-it-pekanbaru]]></category>
            <category><![CDATA[debian]]></category>
            <category><![CDATA[indonesia]]></category>
            <dc:creator><![CDATA[Jufianto Henri]]></dc:creator>
            <pubDate>Sun, 15 Dec 2019 16:17:02 GMT</pubDate>
            <atom:updated>2019-12-15T16:17:02.973Z</atom:updated>
            <content:encoded><![CDATA[<p>setelah kemaren berhasil menginstall debian (<a href="https://medium.com/@jufiantohenri/install-debian-server-10-3e007182c52e">check link berikut</a>), kali ini kita akan menyeting debian tersebut dengan menginstall web server dan wordpress sebagai aplikasi webservernya.</p><p>Topologi yang digunakan dalam tutorial ini adalah</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/508/1*bG2ntzpsIYP2gItJzG95Mw.png" /><figcaption>Topologi Jaringan Kantor</figcaption></figure><h4>Setting IP Debian</h4><p>Sebelum menjadikan debian sebagai web server, hal yang harus dilakukan pertama kali yaitu membuat debian tersebut terkoneksi ke internet. hal yang pertama dilakukan yaitu menghidupkan server debian dan login sebagai root</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*QEbKnoVmZIAeZo6eBs9dIw.png" /><figcaption>tampilan login user debian</figcaption></figure><p>setelah login maka lansung set ip debiannya dengan mengedit file interfaces,ketikan perintah berikut</p><pre>nano /etc/network/interfaces</pre><p>dan akan mendapatkan tampilan seperti berikut:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*ZkDUjG1vkxV8MmoX5K5xiA.png" /><figcaption>tampilan setingan IP debian</figcaption></figure><p>ubah ip debiannya sesuai dengan IP yang telah didefinisikan pada topologi yang telah dibuat, dengan mengetikan konfigurasi sebagai berikut</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*1740cl7I-WxvPhZjbTXgdw.png" /><figcaption>setingan intefaces jaringan</figcaption></figure><p>untuk memastikan koneksi berjalan dengan lancar, gunakan perintah berikut</p><pre>ping google.com</pre><p>tujuan dari perintah tersebut adalah untuk mengirimkan <em>request</em> kepada google, apabila di reply oleh google maka koneksi berjalan dengan lancar. gambar berikut hasil dari perintah <em>ping</em> ke google</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*80jX3CnaIsXWerx9rIK8Dw.png" /></figure><p>setelah itu install web server apache ke server debian dengan cara mengetikan perintah ini ke terminal</p><pre>apt install apache2</pre><p>maka akan mendapatkan tampilan proses sebagai berikut</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*3DwmZnVpKtHxa5S5nOmJ8Q.png" /><figcaption>install apache2</figcaption></figure><p>setelah selesai menginstall web server apache, untuk memastikan bahwa web server apache telah terinstall dengan benar, maka akses ke alamat ip server debian 192.168.10.2 dan akan mendapatkan tampilan seperti berikut</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8aOsg1aOdAnU4meyxHOYdw.png" /><figcaption>halaman default apache server</figcaption></figure><p>web server debian telah berhasil terinstall, langkah selanjutnya yaitu mengedit / mengubah tampilan halaman default debain. halaman direktori debian berada pada /var/www/html. ketikan perintah berikut untuk mengedit tampilan halaman default apache server</p><pre>nano /var/www/html/index.html</pre><p>dan ubah index.html seperti berikut</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*Z0-adIWFSXP8oVoySMpk3w.png" /><figcaption>konfigurasi halaman baru untuk index apache server</figcaption></figure><p>setelah itu simpan dan mendapatkan hasil sebagai berikut</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iJlsnOe8CRCF6_24dYPmug.png" /><figcaption>halaman index apache server yang telah diganti</figcaption></figure><p>proses seting web server debian sederhana telah selesai.</p><h3>Install aplikasi wordpress pada debian web server</h3><p>wordpress merupakan content management system untuk web blog yang dikembangkan oleh Wordpress Fondation. Menggunakan PHP sebagai basis utama bahasa pemograman dan Mysql /Mariadb sebagai basis utama penyimpanan data. tahap tahap yang dilakukan untuk menginstall wordpress sebagai berikut</p><h4>Install PHP</h4><p>hal pertama yang dilakukan yaitu login ke debian server dan ketikan perintah berikut ke terminal anda</p><pre>apt install php php-curl php-gd php-intl php-mbstring php-soap php-xml php-xmlrpc php-zip -y</pre><p>untuk mengkonfirmasi php telah terinstall dengan benar, maka gunakan perintah ini untuk mengecek versi php yang telah terinstall</p><pre>php -v</pre><p>dan akan mendapatkan tampilan hasil seperti berikut</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*kGqul3ksqhSz1CSms5q8Bg.png" /><figcaption>tampilan versi php yang telah di install</figcaption></figure><h4>Install mysql sebagai penyimpanan data</h4><p>setelah menginstall PHP, maka selanjutnya install mysql server sebagai tempat penyimpanan data. mysql server yang kita gunakan adalah mariadb server</p><p>ketikan perintah berikut ke terminal debian untuk menginstall mariadb server</p><pre>apt install mariadb-server</pre><p>untuk menverifikasi mysql server telah terinstall, ketikan perintah berikut di terminal</p><pre>systemctl status mariadb</pre><p>dan akan mendapatkan tampilan seperti berikut</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*SqSZtFxAURg6hreJd9PGbA.png" /><figcaption>tampilan status mariadb mysql server</figcaption></figure><p>setelah hapus beberapa setingan default agar penginstalan mysql server menjadi lebih aman. jalankan perintah berikut</p><pre>mysql_secure_installation</pre><p>dan ikuti pilihan seperti gambar</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*dUdFkVbO06cOQlwaJA296Q.png" /><figcaption>seting mysql server debian (1)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*tn9F31zDUrX0sn2NKYgLGQ.png" /><figcaption>seting mysql server debian (2)</figcaption></figure><h4>buat database dan user untuk aplikasi wordpress</h4><p>ketikan perintah berikut untuk masuk kedalam terminal mariadb</p><pre>sudo mysql -u root -p</pre><p>dan masukan password mysql sesuai dengan password yang telah di seting ketika proses sebelumnya.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*rYUOZ4TFmZ8b6OX7Dv04Jw.png" /><figcaption>tampilan terminal mariadb server</figcaption></figure><p>dan masukan perintah berikut pada terminal mariadb server</p><pre>CREATE DATABASE wordpress;<br>GRANT ALL ON wordpress.* TO &#39;wordpress_user&#39;@&#39;localhost&#39; IDENTIFIED BY &#39;password&#39;;<br>FLUSH PRIVILEGES;<br>EXIT;</pre><p>perintah tersebut bearti membuat database dengan nama <em>wordpress</em> dan membuat user mysql dengan nama<em> wordpress_user </em>dan set password usernya dengan kata <em>password</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*m-_K48J2Dp0zCd43R_9_5w.png" /><figcaption>tampilan terminal buat database dan user mysql</figcaption></figure><h4>Install Wordpress</h4><p>download aplikasi wordpress yang akan diinstall pada web server debian pada alamat url <a href="https://wordpress.org/latest.tar.gz">https://wordpress.org/latest.tar.g</a>z dengan cara sebagai berikut</p><pre>wget https://wordpress.org/latest.tar.gz</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*VLqy_qJd0_EMojap1dPCaw.png" /><figcaption>proses download wordpress ke debian</figcaption></figure><p>setelah selesai ekstrak file yang telah di download dengan ketikan perintah ini ke terminal</p><pre>tar xzvf latest.tar.gz </pre><p>dan akan terbentuk folder dengan nama wordpress dan pindahkan folder wordpress tersebut ke direktori kerja apache server dengan perintah sebagai berikut</p><pre>cp -a wordpress /var/www/html</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*KjOBV1Hsh4-R5Xpudp-Bww.png" /><figcaption>perintah copy wordpress ke direktori kerja apache server</figcaption></figure><p>setelah itu ubah kepemilikan folder wordpress tadi menjadi kepemilikan apache server, agar aplikasi wordpress dapat diakses oleh <em>public. </em>jalankan perintah terminal sebagai berikut</p><pre>chown -R www-data:www-data /var/www/html/wordpress</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*warVXOFh2KgIBxtQ8GJCtA.png" /><figcaption>perintah mengubah kepemilikan folder wordpress</figcaption></figure><p>setelah itu seting permisi folder dari wordpress sesuai dengan standar yang telah ditetapkan wordpress.</p><pre>sudo find /var/www/html/wordpress/ -type d -exec chmod 750 {} \;<br>sudo find /var/www/html/wordpress/ -type f -exec chmod 640 {} \;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*RcPkQDv9R5hQtByOSHA96g.png" /><figcaption>perintah seting permisi folder wordpress</figcaption></figure><p>setelah itu masuk kedalam direktori wordpress dan ubah nama wp-config-sample.php menjadi wp-config.php. perintah untuk melakukannya adalah</p><pre>cd /var/www/html/wordpress<br>mv wp-config-sample.php wp-config.php</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*QhSd8n0a8tZMQwSC3oUCUw.png" /><figcaption>perintah mengubah nama wp-config</figcaption></figure><p>dan ubah setingan wp-config.php sesuai dengan konfigurasi database yang telah di seting pada sesi sebelumnya. cara mengedit konfigurasinya sebagai berikut</p><pre>nano wp-config.php</pre><p>dan seting wp-config.php sesuai dengan konfigurasi pada gambar berikut</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*PD2fI5h74TPQ_MurjCoQpA.png" /><figcaption>konfigurasi wp-config.php</figcaption></figure><p>untuk lebih mengamankan wordpress, maka perlu menggunakan automatic generator secret key dari wordpress dengan mengetikan perintah berikut</p><pre>curl -s https://api.wordpress.org/secret-key/1.1/salt/</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*sED3t3TNCWST6N3o-YtbOQ.png" /></figure><p>hasil dari perintah tersebut akan dibuat didalam seting <em>wp-config.php. </em>ketik perintah tersebut</p><pre>nano wp-config.php</pre><p>dan ubah setingan wp-config.php sesuai dengan gambar berikut</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*TqAuCwQ9fQXKQI9_9OkWWA.png" /><figcaption>konfigurasi secret key wordpress</figcaption></figure><p>selanjutnya seting konfigurasi wordpress pada apache web server.</p><p>edit file konfigurasi apache default dengan cara ketik perintah berikut ke terminal</p><pre>nano /etc/apache2/sites-available/000-default.conf</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*xqhgExuYsV1qas1cuyjPeA.png" /><figcaption>hasil konfigurasi apache web server</figcaption></figure><p>enabled modul mod_rewrite, sehingga wordpress bisa menggunakan fitur permalink dengan ketikan perintah pada terminal</p><pre>a2enmod rewrite</pre><p>restart web server apache dengan perintah sebagai berikut</p><pre>systemctl restart apache2</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*tMOn2qbSDc4G7Fzrhq4SPg.png" /><figcaption>perintah enabled a2enmod rewrite dan restart apache</figcaption></figure><p>pastikan konfigurasi yang digunakan itu berjalan dengan baik, hasil konfigurasi berjalan dengan baik jika menghasilkan nilai balikan Syntax OK. cara melakukannya dengan ketikan perintah sebagai berikut</p><pre>apache2ctl configtest</pre><p>buat .htaccess file dengan cara</p><pre>nano .htaccess</pre><p>dan isi file .htaccess dengan data sebagai berikut</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*Sc5as1yFL0wJgDg-8DK6NQ.png" /><figcaption>seting .htaccess wordpress</figcaption></figure><p>htaccess harus dibuat agar wordpress berjalan dengan baik pada web server apache. setingan wordpess pada apache webserver telah selesai.</p><p>selanjutnya install wordperss pada web browser dengan cara pergi menuju IP web server yang telah di seting tadi. Ip servernya adalah <a href="http://192.168.10.2/">http://192.168.10.2.</a></p><p>server akan mengarahkan alamat yang di request ke tampilan halaman awal penginstalan wordpress.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WkE0HmsFhv6EH0z1Cfa_Kw.png" /><figcaption>tampilan halaman install wordpess</figcaption></figure><p>pada halaman awal, pilih bahasa yang akan digunakan pada wordpess yang akan kita install, setelah itu klik <em>continue.</em></p><p>setelah itu akan diarahkan ke halaman setingan untuk keperluan informasi aplikasi wordpress, seting aplikasi wordpress seperti gambar dibawah ini</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l6g16w7mZm0vQtgGBp3Tyg.png" /><figcaption>seting aplikasi wordpress</figcaption></figure><p>dan setelah di seting akan menampilkan halaman seperti ini</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WFSnLL_HHnRunMvucaVJrA.png" /><figcaption>halaman sukses install wordpess</figcaption></figure><p>klik login, dan akan diarahkan ke halaman seperti gambar berikut</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/562/1*knvKfj0IJqw0-wXtZs2Atw.png" /><figcaption>halaman login wordpress</figcaption></figure><p>dan berikut gambar hasil dari halaman admin wordpress</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-5v9KB4ttPIRUUTM44OG3g.png" /><figcaption>halmaan admin wordpress</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1d600ff21ce9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/jufi-blogs/setting-web-server-debian-dan-install-wordpress-1d600ff21ce9">Setting Web Server Debian dan Install Wordpress</a> was originally published in <a href="https://medium.com/jufi-blogs">Blog yang ditulis Jufi</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Install Debian Server 10]]></title>
            <link>https://medium.com/jufi-blogs/install-debian-server-10-3e007182c52e?source=rss-64e32bce32ac------2</link>
            <guid isPermaLink="false">https://medium.com/p/3e007182c52e</guid>
            <category><![CDATA[hacks]]></category>
            <category><![CDATA[debian]]></category>
            <category><![CDATA[indonesia]]></category>
            <category><![CDATA[servers]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Jufianto Henri]]></dc:creator>
            <pubDate>Sat, 30 Nov 2019 18:13:32 GMT</pubDate>
            <atom:updated>2019-11-30T18:13:32.407Z</atom:updated>
            <content:encoded><![CDATA[<p>buster itulah codename debian saat ini, telah dirilis juli 2019. bagi yang belum tau debian ini termasuk salah satu dari induknya linux, banyak sekali distro turunan dari debian ini termasuk salah satunya distro yang terkenal yaitu ubuntu dan linux mint</p><p>disini saya akan menulis tentang bagaimana caranya menginstal debian yang akan kita set sebagai server. server? emang debian tidak ada versi servernya ? jawabannya adalah <strong>tidak, </strong>diwebsite resminya debian tidak menjelaskan adanya debian khusus versi server seperti ubuntu, tapi kita bisa menjadikan debian menjadi server. perbedaan utama antara distro untuk server dan tidaknya itu menurut saya hanya pada perbedaannya dalam lib/aplikasi apa yang diinstall, jadi kita akan belajar menginstall debian dengan minimal install.</p><p>disini saya akan menginstall debian servernya menggunakan virtual box, ya kita akan menginstall debian ini secara virtual dilaptop saya.</p><h4>Set Up Virtual Box</h4><p>Create virtual machine pada virtual box dan ikuti seting seperti yang tertera di gambar</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/573/1*RStGQncy1aWp2JwSDFvvTA.png" /></figure><p>kemudian seting RAM untuk virtualnya menjadi 1 GB, karna hanya digunakan untuk server saya sarankan 1 GB, kalau lebih rendah itu takutnya nanti membuat server yang akan kita install menjadi lambat dan susah dalam respon, kalau di set menjadi lebih tinggi nanti menjadi pemborosan RAM karna menurut saya 1 GB sudah cukup.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/573/1*4J4zZhNI5ENjhmSMZPPnJQ.png" /></figure><p>kemudian pilih option create hardisk</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/575/1*_Jlty7I_X4Eu-vQybAHdyg.png" /></figure><p>pilih type hardisk</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*H2g6ICLhEuagOwX6Jq3e2g.png" /></figure><p>terus next dan pilih sesuai gambar,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*k6rWMl4y-37nZL746Bh_rg.png" /></figure><p>kita set besar hardisknya menjadi 8 GB saja dahulu, karena nanti saya hanya akan menginstall apache web server di dalam ini</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*9B4Pj5FObUP2lbZ9R15ZnQ.png" /></figure><p>setelah itu pilih create maka setingnya akan sukses, selanjutnya silahkan klik start pada virtual machine debian server yang telah kita buat tadi, abaikan saja virtual machine yang lain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5ksY8CPMAhM9eN0NULHSKg.png" /></figure><p>setelah klik start, maka akan muncul pemberitahuan dari virtual box bahwa tidak ada disk startup disk, maksudnya kita harus memasukan semacam CD installer untuk menginstall debian, silahkan klik folder yang di samping kanan tersebut dan cari CD / ISO installer debian yang telah anda siapkan.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/531/1*HqsSGat5NCmBNf5QNtZPbw.png" /></figure><p>disini saya menggunakan debian 10.2 netinstaller, itu merupakan versi minimal install dari debian</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/531/1*RTBKwswOfMh-z6ugaLYxVg.png" /></figure><p>oke setingan untuk persiapan virtual box debian server telah selesai, mari kita lanjutkan ke sesi menginstall debiannya.</p><h4>Install Debian</h4><p>pilih bagian menu Graphical install</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/632/1*Ea5l_15CZ3r400F1gXnEkg.png" /></figure><p>setelah itu akan diarahkan ke menu pemilihan bahasa, pilih bahasa ‘<em>English</em>’ lalu klik <em>continue</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/799/1*yClvO7XiomvETaqWZHYmhw.png" /></figure><p>selanjutnya akan diarahkan ke pemilihan lokasi, karena lokasi Indonesia tidak ada dalam <em>list</em> pilihan, pilih <em>list other</em> setelah itu klik <em>continue</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/783/1*ufuP4fzI5dVLF5S5vI2GeA.png" /></figure><p>pilih ‘<em>Asia</em>’ lalu klik <em>continue</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/787/1*Db5TEBdA3KoMexu6E6-1dg.png" /></figure><p>lalu pilih ‘Indonesia’ lalu klik <em>continue</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*VB3haKYVlAa5qLbhUcA9SA.png" /></figure><p>selanjutnya akan diarahkan ke pemilihan <em>locale, </em>karena tidak ada pilihan Indonesia maka kita pilih <em>default</em> pilihan dari debian yaitu ‘<em>United States</em>’ lalu klik <em>continue</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*5WTwpl37H8Px5GgycDu_JQ.png" /></figure><p>setelah itu akan diarahkan kepada pilihan <em>keyboard keymap</em>, pilih ‘<em>American English</em>’ lalu klik <em>continue</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*HIvzyim9GPDPK9rLccH5Zg.png" /></figure><p>selanjutnya akan dimulai proses inisasi konfigurasi pada sistem operasi debian, mohon ditunggu dalam beberapa detik</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*b1SEV5eJojpOp8BN4Zxv2Q.png" /></figure><p>setelah proses tersebut selesai, maka akan dilanjutkan dengan pemilihan <em>hostname</em> untuk server yang akan diinstall. Masukan hostname dengan nama yang diinginkan dan klik <em>continue</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*61ARUTuj8AzA0uTLnsEGuw.png" /></figure><p>dan setelah itu akan diarahkan ke menu konfigurasi <em>domain name. </em>masukan nama domain sesuai yang diinginkan lalu klik <em>continue</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*7eNVcTLWFOS-XdZvqjFCxA.png" /></figure><p>selanjutnya akan diarahkan ke bagian <em>setup user. </em>Masukan root password yang diinginkan. <em>Root</em> merupakan akun sistem administrator tertinggi yang ada dilinux.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*YqN9xCAQPbuM6rzFe8Mtvg.png" /></figure><p>setelah itu akan diarahkan ke bagian setup user untuk akun biasa, yang dimaksud dengan akun biasa merupakan akun standar yang digunakan untuk interaksi sederhana pada sistem. Masukan nama lengkap pemlilik akun yang akan dibuat.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*qh1BB4ARhAJwtpNVjnV6RQ.png" /></figure><p>dan masukan <em>username </em>yang diinginkan, lalu klik <em>continue</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*_dv_ubF-PhFk_TxgfRijaA.png" /></figure><p>setelah itu masukan password yang akan digunakan oleh user yang akan dibuat lalu klik <em>continue</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*R8W-T7C6fba35n75E3KeiA.png" /></figure><p>setelah itu pilih lokasi untuk penentuan jam yang akan digunakan dalam server lalu klik <em>continue</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*qbpJKnW32tvG2fRFPj2N4w.png" /></figure><p>setelah itu akan diarahkan kepada bagian seting hardisk, pilih bagian ‘G<em>uided — Use Entire Disk’ </em>pilihan tersebut bermaksud untuk membuat setingan otomatis rekomendasi dari server, jadi tidak perlu lagi untuk menformat secara manual hardisk yang akan digunakan.</p><p>klik <em>continue</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*GJuioodL7Msp8aYN02993Q.png" /></figure><p>pilih hardisk yang akan digunakan untuk menginstall server, lalu klik <em>continue</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*2eWDU4wAIfiTFii7MZ9L1A.png" /></figure><p>pilih ‘<em>All files in one partition</em>’, lalu klik <em>continue</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*RTQZ4CiveGq5Z2bCePkopA.png" /></figure><p>selanjutnya pada finishing terakhir akan disajikan bagian konfirmasi seting hardisk yang akan digunakan, klik pilih ‘<em>Finish partionioning and write changes to disk</em>’ lalu klik <em>continue</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*McES_15B26Jk63oRiZmEDA.png" /></figure><p>pilih ‘<em>yes</em>’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*u-EKP7YFHB263p3fIBa7Qg.png" /></figure><p>selanjutnya akan dimulai proses penginstalan server, proses ini akan menghabiskan waktu dalam sekitar 10 menit</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*k5j6s7hI4tLeruJ18Ma__A.png" /></figure><p>setelah itu debian akan mengecek apakah ada CD lain yang akan dimasukan kedalam proses penginstaan, pilih ‘No’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*HFn-xtG4vSsCYgVcIqSsAA.png" /></figure><p>selanjutnya proses penginstallan akan dilanjutkan kepada pemilihan repository `<em>package manager</em>`. pilih indonesia. lalu klik <em>continue</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*7SCfu3JDlPV8qZgEU7Srug.png" /></figure><p>selanjutnya pilih server yang akan digunakan untuk pemiliha repository, pilih <em>deb.debian.org</em> dikarenakan itu merupakan pilihan yang direkomendasikan oleh server debian. lalu klik <em>continue</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*h5IGwtZa2XEmFd0Te2V1zA.png" /></figure><p>abaikan pemilihan proxy, karena pada proses penginstalan tidak menggunakan proxy</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*q0UZwlhhesRdcqaX4ro9LA.png" /></figure><p>selanjutnya akan diarahkan kepada proses konfigurasi yang akan menghabiskan waktu sektiar 5–15 menit</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*sg6KoYI4-CrDUef4RGWQWQ.png" /></figure><p>selanjutkan akan ada pilihan <em>usage survey, </em>pilih ‘<em>No</em>’ dan klik <em>continue</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*szEUezVxnWFJCKxcWx605A.png" /></figure><p>selanjutnay akan diarahakan ke menu ‘<em>software selection’ </em>yang bertujuan untuk menginstall apa aja aplikasi/ library yang dibutuhkan oleh server. karena kita akan menginstall server secara manual nantinya, checklist hanya pada ‘<em>standart system utillities’ </em>lalu klik<em> continue</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*suGVApWAw0bajtVlQUDkkg.png" /></figure><p>proses pengintalan server dilanjutkan dan membutuhkan waktu sektiar 10– 15 menit</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*9Gq5-2bS0Qhg9Y0Cb-9Eog.png" /></figure><p>setelah proses tersebut selesai, akan dilanjutkan dengan penginstallan <em>boot loader</em>, pilih yes lalu klik <em>continue</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*iLYYkOONG6pEolym9y4gWg.png" /></figure><p>lalu pilih hardisk yang akna di install boot loadernya</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*K0FaQyT9-Mb5mK-fIupoOg.png" /></figure><p>proses pemilihan akan diproses</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*UTfDLXDlwW4urcBkBJ6IqA.png" /></figure><p>Proses penginstallan telah selesai. lalu klik <em>continue . </em>server akan otomatis di restart</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*_XWmHL_F6Ac-gmFewzoRwA.png" /></figure><p>berikut tampilan setelah proses penginstallan debian server</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*iRvgC6jH4u76oGC0r9NeUQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3e007182c52e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/jufi-blogs/install-debian-server-10-3e007182c52e">Install Debian Server 10</a> was originally published in <a href="https://medium.com/jufi-blogs">Blog yang ditulis Jufi</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Docs of My GIT Learn (GIT DIFF & PATCH)]]></title>
            <link>https://jufianto.medium.com/docs-of-my-git-learn-git-diff-patch-4280c010a0f7?source=rss-64e32bce32ac------2</link>
            <guid isPermaLink="false">https://medium.com/p/4280c010a0f7</guid>
            <category><![CDATA[git-diff]]></category>
            <category><![CDATA[kongkowit]]></category>
            <category><![CDATA[patch]]></category>
            <category><![CDATA[git]]></category>
            <dc:creator><![CDATA[Jufianto Henri]]></dc:creator>
            <pubDate>Mon, 02 Sep 2019 12:47:42 GMT</pubDate>
            <atom:updated>2019-09-02T12:47:42.357Z</atom:updated>
            <content:encoded><![CDATA[<p>tadi baru saja mencoba untuk melakukan beberapa hal, dan inilah yang terjadi</p><pre>git diff commit1 commit2</pre><p>script di atas berfungsi untuk mencari perbedaan antara commit1dan commit2, hasilnya berupa perbedaan setiap line dari file antara commit1 dan commit2 tetapi jika ingin hanya menampilkan apa saja file yang terupdate dapat menggunakan --name-only jadinya seperti</p><pre>git diff commit1 commit2 --name-only</pre><p>bagaimana jika ingin membandingkan antara branch? lakukan perintah berikut, tetapi sebelumnya checkout dulu ke branch yang lama.</p><pre>git diff &lt;branch_baru&gt; -- &lt;path&gt;</pre><p>beberapa contoh yang saya coba adalah</p><pre>git diff inhil -- application/ assetsA &#39;:!application/views&#39; &gt; v3.0.diff</pre><p>maksud dari kode tersebut adalah membandingkan branch lama saya dengan branch inhil tetapi hanya pada directory application/, assetsA tetapi tidak memasukan directory application/views dan hasilnya dimasukan kedalam file bernama v3.0.patch.</p><p>gunanya saya membuat file diffagar diff yang tadi tersimpan dan saya bisa menginstall patch atau update version ke branch tertentu</p><pre>patch -R -p1 &lt; v3.0.diff</pre><p>atau bisa juga menggunakan</p><pre>patch &lt; v3.0.diff</pre><p>sekian dulu dokomentasi dari saya.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4280c010a0f7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Apa yang pelajari dari Flask Python]]></title>
            <link>https://jufianto.medium.com/apa-yang-pelajari-dari-flask-python-9e4cab30711b?source=rss-64e32bce32ac------2</link>
            <guid isPermaLink="false">https://medium.com/p/9e4cab30711b</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[flask]]></category>
            <category><![CDATA[python3]]></category>
            <category><![CDATA[indonesia]]></category>
            <dc:creator><![CDATA[Jufianto Henri]]></dc:creator>
            <pubDate>Mon, 01 Apr 2019 14:15:30 GMT</pubDate>
            <atom:updated>2019-04-01T14:28:50.106Z</atom:updated>
            <content:encoded><![CDATA[<p>hallo semua, kali ini saya akan berbagi hal yang saya lakukan untuk belajar pyhton menggunakan framework web python Flask. saya mengambil sumber tutorial dari <a href="https://scotch.io/tutorials/build-a-crud-web-app-with-python-and-flask-part-one">sini</a>. Disana ada 3 part dan akan saya bahas disini semuanya. tujuan saya mempelajari ini agar saya bisa memahami dasar flask untuk keperluan pengerjaan skripsi saya.</p><p>saya disini akan menggunakan anaconda virtual environtment untuk python. pertama kali saya download dan install anacona dan saya update dengan conda update conda</p><p>setelah install anaconda di linux, saya jalankan perintah berikut di terminal untuk menghentikan conda melakukan aktifasi base environtment setiap kali membuat terminal (sebenarnya enggak masalah sih, tapi menurut saya itu menganggu kebersihan terminal saya dan setiap memakai linux saya enggak selalu menggunakan anaconda)</p><pre>conda config --set auto_activate_base false</pre><p>setelah itu saya buat virtualenvnya dengan</p><pre>conda create --name nama_env</pre><p>setelah itu aktifkan dengan conda activate nama_env</p><p>setelah itu saya install package flask dan pip dengan cara. (ketika install</p><pre>conda install flask pip mysqlclient</pre><p>oh ya, seluruh codepy akan saya letak di <a href="https://github.com/jufianto/crud-python.git">github</a>.</p><p>hal yang pertama dilakukan dengan mengedit file config.py menjadi seperti ini</p><pre>class Config(object):<br>    &quot;&quot;&quot;<br>    konfig umum<br>    &quot;&quot;&quot;</pre><pre>class DevelopmentConfig(Config):<br>    DEBUG = True<br>    SQLALCHEMY_ECHO = True</pre><pre>class ProductionConfig(Config):<br>    DEBUG = False</pre><pre>app_config = {<br>    &#39;development&#39;: DevelopmentConfig,<br>    &#39;production&#39;: ProductionConfig<br>}</pre><p>disini kita belajar memisahkan environment untuk produksi dan untuk development. setelah itu edit file __init__.py dan ketik sebagai berikut</p><pre># third-party imports<br>from flask import Flask<br>from flask_sqlalchemy import SQLAlchemy</pre><pre># third-party imports<br>from flask import Flask<br>from flask_sqlalchemy import SQLAlchemy</pre><pre># local imports<br># import variabel app_config dari config<br>from config import app_config</pre><pre># db variabel initialization<br>db = SQLAlchemy()</pre><pre>def create_app(config_name):<br>    app = Flask(__name__, instance_relative_config=True)<br>    app.config.from_object(app_config[config_name])<br>    app.config.from_pyfile(&#39;config.py&#39;)<br>    db.init_app(app)</pre><pre>return app</pre><p>pada bagian koding atas kita lakukan inisiasi variabel database db dan kita buat fungsi dengan nama create_app. Fungsi instance_relative_config dan digabung app.config.from_pyfile(&#39;config.py)membuat app mengambil config dari file yang berasal dari folder instance dyang bernama config.php</p><p>karna kita akan mengambil setingan dari folder instance maka kita buat folder instance dan buat file bernama config.py dengan isian</p><pre>SECRET_KEY = &#39;p9Bv&lt;3Eid9%$i01&#39;<br>SQLALCHEMY_DATABASE_URI = &#39;mysql://root:<a href="http://twitter.com/localhost/crud-python">@localhost/crud-python</a>&#39;</pre><p>disini kita menggunakan mysql sebagai database dan format skema url seperti</p><pre>SQLALCHEMY_DATABASE_URI = &#39;mysql://username:password<a href="http://twitter.com/localhost/crud-python">@localhost/n</a>ama_tabel&#39;</pre><p>setelah itu edit file run.py menjadi</p><pre>import os</pre><pre>from app import create_app</pre><pre>config_name = os.getenv(&#39;FLASK_CONFIG&#39;)<br>app = create_app(config_name)</pre><pre>if __name__ == &#39;__main__&#39;:<br>    app.run()</pre><p>di koding tersebut kita import dulu module bernama os dan fungsi create_app dari folder app. seterusnya pada variabel config_name berfungsi untuk mendapatkan environment variabel FLASK_CONFIG dan setelah itu di set fungsi create_app dengan config environment variabel yang telah diset</p><blockquote>*note <br>untuk bisa berjalan environment variabelnya dengan server config harus dijalankan menggunakan python run.py atau jika menggunakan flask run harus di set environtmennya menggunakan export FLASK_ENV=development</blockquote><p>untuk mencoba flask yang kita seting berjalan dengan sempurna, kita coba buat route di create_app sehingga app/__init__.py menjadi</p><pre># third-party imports<br>from flask import Flask<br>from flask_sqlalchemy import SQLAlchemy</pre><pre># local imports<br># import variabel app_config dari config<br>from config import app_config</pre><pre># db variabel initialization<br>db = SQLAlchemy()</pre><pre>def create_app(config_name):<br>    app = Flask(__name__, instance_relative_config=True)<br>    app.config.from_object(app_config[config_name])<br>    app.config.from_pyfile(&#39;config.py&#39;)<br>    db.init_app(app)</pre><pre><a href="http://twitter.com/app">@app</a>.route(&#39;/&#39;)<br>    def hello_world():<br>        return &#39;Hello, World&#39;</pre><pre>return app</pre><p>untuk menjalankannya kita gunakan</p><pre>export FLASK_CONFIG=development<br>export FLASK_APP=run.py<br>python run.py</pre><p>atau jika ingin menggunakan flask command line agar setingan development tadi berjalan lancar gunakan</p><pre>export FLASK_ENV =development<br>flask run</pre><p>dan hasilnya sebagai berikut</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/1*b9DFW38JjUaALSxYM4OuQg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9e4cab30711b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>