<?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 Zaki Arrozi Arsyad on Medium]]></title>
        <description><![CDATA[Stories by Zaki Arrozi Arsyad on Medium]]></description>
        <link>https://medium.com/@zakiarsyad?source=rss-d28f34c607bd------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*sEMvW0hqmv6tWt10C_7usw.jpeg</url>
            <title>Stories by Zaki Arrozi Arsyad on Medium</title>
            <link>https://medium.com/@zakiarsyad?source=rss-d28f34c607bd------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 18 May 2026 03:00:35 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@zakiarsyad/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[Linux file/text manipulation commands]]></title>
            <link>https://medium.com/@zakiarsyad/linux-file-text-manipulation-commands-865c028d187d?source=rss-d28f34c607bd------2</link>
            <guid isPermaLink="false">https://medium.com/p/865c028d187d</guid>
            <category><![CDATA[command-line]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Zaki Arrozi Arsyad]]></dc:creator>
            <pubDate>Fri, 22 May 2020 17:07:02 GMT</pubDate>
            <atom:updated>2020-05-26T09:09:21.909Z</atom:updated>
            <content:encoded><![CDATA[<h3>Linux file manipulation</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*czARYv5GV6j4QlNE" /><figcaption>Photo by <a href="https://unsplash.com/@hannahjoshua?utm_source=medium&amp;utm_medium=referral">Hannah Joshua</a> on <a href="https://unsplash.com?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>There a two types of manipulation commands</p><h4><strong>Redirection</strong></h4><p>This is how we combine a command with a file<br>example:</p><ul><li>cat file.txt &gt; file_copy.txt : copy file.txt content into file_copy.txt</li><li>ls / &gt; directory.txt : create a new file with list of content of / directory</li></ul><h4>Pipeline</h4><p>Combine two or more commands in a single line<br>example:</p><ul><li>ls /home/host/ | grep {keyword_1} | grep {keyword_2}: list all files or folder which are matched with those keywords</li></ul><h4>GREP</h4><p>Grep is used for filtering files or folder based on a keyword.<br>basic usage :</p><pre># display all line matched<br>grep {keyword} {file_path}</pre><pre># display all line matched<br>grep {keyword} {file_1} {file_2} {file_3}</pre><pre># ignore keyword case<br>grep -i {keyword} {file_path}</pre><pre># display lines without the matched line<br>grep -v {keyword} {file_path}</pre><pre># display with line number<br>grep -n {keyword} {file_path}</pre><pre># display a count of matching lines<br>grep -c {keyword} {file_path}</pre><pre># display matched line for either keyword 1 or keyword 2<br>grep -w &quot;keyword_1 | keyword_2&quot; {file_path}</pre><pre># display 4 lines after the keyword<br>grep -A {number} {keyword}</pre><pre># display 4 lines before the keyword<br>grep -B {number} {keyword}</pre><h4>REGEX</h4><p>We can also combine grep with regular expression. Regex is case sensitive<br>basic usage :</p><pre>grep -E &quot;REGEX&quot; {file_path}</pre><p>This command will display all lines which are matched with the regex pattern.</p><p><em>note : will talk about regex in another story</em></p><h4>SED</h4><p>Sed is Stream Editor. Sed can be used for searching a file, find and replace, insertion or deletion. We can also use sed for quickly editing a file without opening it. Sed also support regular expression pattern.</p><ul><li><strong>we use </strong><strong>s for substitution and </strong><strong>/ for the delimiter</strong></li></ul><pre># replace first unix word in each line with linux<br>sed &#39;s/unix/linux/&#39; {file_path}</pre><pre># replace all unix word in each line with linux<br>sed &#39;s/unix/linux/g&#39; {file_path}</pre><pre># replace second unix word in each line with linux<br>sed &#39;s/unix/linux/2&#39; {file_path}</pre><pre># replace with case insensitive<br>sed &#39;s/unix/linux/i&#39; {file_path}</pre><pre># replace all unix word except in fifth line<br>sed &#39;5!s/unix/linux/g&#39; {file_path}</pre><pre># replace unix word from second and next line<br>sed &#39;s/unix/linux/2g&#39; {file_path}</pre><pre># replace unix word in third line<br>sed &#39;3 s/unix/linux/&#39; {file_path}</pre><pre># replace unix word in first line until third line<br>sed &#39;1,3 s/unix/linux/&#39; {file_path}</pre><pre># replace unix word in start from third line<br>sed &#39;3,$ s/unix/linux/&#39; {file_path}</pre><pre># display only replaced lines<br>sed -n &#39;s/unix/linux/p&#39; {file_path}</pre><pre># display replaced lines twice<br>sed &#39;s/unix/linux/p&#39; {file_path}</pre><ul><li><strong>d for deletion</strong></li></ul><p>Sed also can be used for deleting a line.</p><pre># delete fifth line<br>sed &#39;5d&#39; {file_path}</pre><pre># delete last line<br>sed &#39;$d&#39; {file_path}</pre><pre># delete third line until sixth line<br>sed &#39;3,6d&#39; {file_path}</pre><pre># delete from third line and next<br>sed &#39;3,$d&#39; {file_path}</pre><pre># delete line with matched pattern<br>sed &#39;/pattern/d&#39; {file_path}</pre><pre># delete line with matched case insensitive pattern<br>sed -i &#39;/pattern/d&#39; {file_path}</pre><pre># delete line with matched pattern and two lines after<br>sed &#39;/abc/,+2d&#39; {file_path}</pre><pre># delete every second line, start from third line<br>sed &#39;3~2d&#39; {file_path}</pre><pre># delete blank line<br>sed &#39;/^$/d&#39; {file_path}</pre><pre># delete blank line w<br>sed -i &#39;/^#/d;/^$/d&#39; {file_path}</pre><ul><li><strong>G for file spacing</strong></li></ul><pre># insert one blank line after each line<br>sed G {file_path}</pre><pre># insert two blank lines after each line<br>sed &#39;G:G&#39; {file_path}</pre><pre># insert a black line above every line which matches pattern<br>sed &#39;/pattern/{x;p;x;}&#39; {file_path}</pre><pre># insert a blank line below every line which matches pattern<br>sed &#39;/pattern/G&#39; {file_path}</pre><ul><li><strong>-n p for displaying a file</strong></li></ul><pre># display a file<br>sed -n p {file_path}</pre><pre># display only fourth line<br>sed -n &#39;4p&#39; {file_path}</pre><pre># display from second line to fifth line<br>sed -n &#39;2,5p&#39; {file_path}</pre><pre># display only last line<br>sed -n &#39;$p&#39; {file_path}</pre><pre># display from third line and next<br>sed -n &#39;3,$p&#39; {file_path}</pre><pre># display entire file except second line to fourth line<br>sed -n &#39;2,4d&#39; {file_path}</pre><pre># display only line with matched pattern<br>sed -n &#39;/abc/p&#39; {file_path}</pre><pre># matched pattern start from fifth line<br>sed -n &#39;/abc/,5p&#39; {file_path}</pre><pre># display from second line to matched pattern line<br>sed -n &#39;2,/abc/p&#39; {file_path}</pre><ul><li><strong>= for numbering lines</strong></li></ul><pre># add a number in front of each line<br>sed = {file_path}</pre><h4>CUT</h4><p>As the name suggests, cut i used for cutting out the section from each line of file and writing the result to a new file. We can use this command to cut parts of a line by some of these commands :</p><ul><li>-b or --bytes=LIST</li></ul><p>Select by specifying a byte, a set of bytes, or a range of bytes.</p><pre># display first, second, and third byte of each line<br>cut -b &#39;1,2,3&#39; {file_path}</pre><pre># display first until third byte and fifth until seventh byte<br>cut -b &#39;1-3,5-7&#39; {file_path}</pre><pre># display third and next byte<br>cut -b &#39;3-&#39; {file_path}</pre><pre># display until third byte<br>cut -b &#39;-3&#39; {file_path}</pre><ul><li>-c or --characters=LIST</li></ul><p>Select by specifying a character, a set of characters, or a range of characters.</p><pre># display first, second, and third characters of each line<br>cut -c &#39;1,2,3&#39; {file_path}</pre><pre># display first until third characters and fifth until seventh characters<br>cut -c &#39;1-3,5-7&#39; {file_path}</pre><pre># display third and next characters<br>cut -c &#39;3-&#39; {file_path}</pre><pre># display until third characters<br>cut -c &#39;-3&#39; {file_path}</pre><ul><li>-f or --fields=LIST</li></ul><p>Select by specifying a field, a set of fields, or a range of fields. This command needs specified delimiter written with -d or --delimiter{DELIMITER} .</p><pre># display all fields without specified delimiter<br>cut -f &#39;1&#39; {file_path}</pre><pre># display first until third fields, with comma delimiter<br>cut -d\, -f &#39;1-3&#39; {file_path}</pre><pre># display from third fields, with comma delimiter<br>cut -d\, -f &#39;3-&#39; {file_path}</pre><pre># display until third fields, with comma delimiter<br>cut -d\, -f &#39;-3&#39; {file_path}</pre><ul><li>--complement</li></ul><p>Displays all bytes, characters, or fields except the selected.</p><pre># display all bytes except the selected<br>cut --complement -b &#39;1&#39; {file_path}</pre><pre># display all characters except the selected<br>cut --complement -c &#39;1&#39; {file_path}</pre><pre># display all fields except the selected<br>cut --complement -d\, -f &#39;1&#39; {file_path}</pre><ul><li>-s or --only-delimiter</li></ul><p>Do not print lines not containing delimiters.</p><pre># display only fields which have delimiter<br>cut -d\, -f &#39;1-4&#39; {file_path} -s</pre><ul><li>--output-delimiter=STRING</li></ul><p>Modify the output delimiter.</p><pre># display fields with # delimiter<br>cut -d\, -f &#39;1-4&#39; {file_path} --output-delimiter=&quot;#&quot;</pre><h4>SORT</h4><p>This command will do as the name implies.</p><pre># sort the lines ascending<br>sort {file_path}</pre><pre># sort the lines descending<br>sort -r {file_path}</pre><pre># sort and create a new file<br>sort -o {output_file} {original_file}</pre><pre># sort the numbering lines in ascending<br>sort -n {file_path}</pre><pre># sort the numbering lines in descending<br>sort -nr {file_path}</pre><pre># sort and remove duplicates<br>sort -u {file_path}</pre><pre># checks if a file is already sorted and return unsorted lines (if any)<br>sort -c {file_path}</pre><pre># sort a table by the nth column<br>sort -k2 {file_path}</pre><pre># sort by month<br>sort -M {file_path}</pre><h4>UNIQ</h4><p>We can delete the duplicated lines with this command. Uniq basic command will return the same result with sort -u .</p><pre># print only uniq line<br>uniq {file_path}</pre><pre># print a number how many times a line was repeated<br>uniq -c {file_path}</pre><pre># print repeated lines, only display one duplicated line per group<br>uniq -d {file_path}</pre><pre># print repeated lines, display all duplicated lines<br>uniq -D {file_path}</pre><pre># prints only the unique lines<br>uniq -u {file_path}</pre><pre># skip nth field to be skipped while comparing uniqueness<br>uniq -f 2 {file_path}</pre><pre># skip nth character to be skipped while comparing uniqueness<br>uniq -s 2 {file_path}</pre><pre># limit the comparison to a set number of characters <br>uniq -w 2 {file_path}</pre><pre># make the comparison case-insensitive<br>uniq -i {file_path}</pre><h4>TR</h4><p>We can use this command to translate or delete characters.</p><pre># translate from lowercase with uppercase<br>cat {file_path} | tr &quot;[a-z]&quot; &quot;[A-Z]&quot;</pre><pre># translate from lowercase with uppercase<br>cat {file_path} | tr &quot;[:lower:]&quot; &quot;[:upper:]&quot;</pre><pre># translate whitespace with tab<br>cat {file_path} | tr &quot;[:space:]&quot; &quot;\t&quot;</pre><pre># translate brackets with curly barckets<br>cat {file_path} | tr &quot;()&quot; &quot;{}&quot;</pre><pre># translate multiple whitespace with single space<br>cat {file_path} | tr -s &quot;[:space:]&quot; &quot; &quot;</pre><pre># delete specific A character<br>cat {file_path} | tr -d &quot;A&quot;</pre><pre># delete digit character<br>cat {file_path} | tr -d &quot;[:digit:]&quot;</pre><pre># delete all except digit<br>cat {file_path} | tr -cd &quot;[:digit:]&quot;</pre><h4>AWK</h4><p>Awk is used for manipulating data and generating reports.<br>Fields identifier :</p><ul><li>$0 : entire line of text</li><li>$1 : first field</li><li>$2 : second field</li><li>$6 : sixth field</li><li>$NF : stands for “number of fields,” and represents the last field</li><li>NR : display number of fields</li><li>OFS : output field separator</li><li>BEGIN : begin of the file</li><li>END : end of the file</li></ul><pre># view file<br>awk &#39;{print}&#39; {file_path}</pre><pre># view specific lines<br>awk &#39;{print $2,$3,$6}&#39; {file_path}</pre><pre># view last field each lines<br>awk &#39;{print $NF}&#39; {file_path}</pre><pre># view number of fields each line<br>awk &#39;{print NR}&#39; {file_path}</pre><pre># print specific lines with / separator<br>awk &#39;OFS=&quot;/&quot; {print $2,$3,$6}&#39; {file_path}</pre><pre># add text in the beginning of the file<br>awk &#39;BEGIN {print &quot;text&quot;} {print $2,$3,$6}&#39; {file_path}</pre><pre># add text in the ending of the file<br>awk &#39;END {print &quot;text&quot;} {print $2,$3,$6}&#39; {file_path}</pre><pre># print the lines which is matched with the given pattern<br>awk &#39;/pattern/&#39; {file_path}</pre><pre># print specific field after matched pattern each line <br>awk &#39;/pattern/ {print $2,$3,$6}&#39; {file_path}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=865c028d187d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Basic linux commands]]></title>
            <link>https://medium.com/@zakiarsyad/basic-linux-commands-202cb67601de?source=rss-d28f34c607bd------2</link>
            <guid isPermaLink="false">https://medium.com/p/202cb67601de</guid>
            <category><![CDATA[unix]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[cli]]></category>
            <dc:creator><![CDATA[Zaki Arrozi Arsyad]]></dc:creator>
            <pubDate>Wed, 20 May 2020 07:02:06 GMT</pubDate>
            <atom:updated>2020-05-20T07:06:39.526Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wl7BruJLoPrR2Y9I" /><figcaption>Photo by <a href="https://unsplash.com/@markusspiske?utm_source=medium&amp;utm_medium=referral">Markus Spiske</a> on <a href="https://unsplash.com?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Linux is closely related to the command line. Even though some people prefer to use graphic user interface (GUI), we will using command-line interface (CLI). CLI is more effective and powerful. Some process can be done in one line of commands in seconds.</p><p>These some basic commands that I use often.</p><ol><li><strong>Navigation</strong></li></ol><ul><li>pwd : print working directory</li><li>cd : change directory<br>- cd : go to home<br>- cd {dir_path} : go to directory path<br>- cd .. : on directory above<br>- cd - : back to last directory path</li><li>ls : list<br>- ls -a : list all (include hidden file and folder)<br>- ls -l : long list<br>- ls -la : long list all</li></ul><p><strong>2. Directory / file management</strong></p><ul><li>touch : create a new file</li><li>mkdir : create a new folder</li><li>rm : remove<br>- rm {file_name} : delete a file<br>- rm -r {dir_name} : delete a folder</li><li>rmdir : remove directory, only allows to delete empty directory</li><li>cp : copy<br>- cp {old_file} {new_file} : copy a file<br>- cp -r {old_dir} {new_dir} : copy a folder and all sub folder</li><li>mv : move<br>- mv {old_file_path} {new_file_path} : move a file or folder<br>- mv {old_file_name} {new_file_name} : rename a file or folder</li><li>locate {file_name} : search a file or folder<br>- locate -i {file_name} : search file with case sensitive</li><li>find {dir_path} {file_name} : search a file or folder inside a directory</li><li>tar : archive multiple files into a tarball</li><li>zip : compress files into a zip archive</li><li>unzip : extract the zipped files</li></ul><p><strong>3. File view and editing</strong></p><ul><li>nano : view and edit with nano</li><li>vim : view and edit with vim</li><li>cat : view file<br>- cat &gt; {file_name} : create a new file<br>- cat {file_1} &gt; {file_2} : copy file 1to file 2<br>- cat {file_1} &gt;&gt; {file_2} : append file 1 content to file 2</li><li>grep {keyword} {file_name} : search through all the text in a given file</li><li>head : view the first lines of any text file, by default it will showing first 10 lines<br>- head -n 5 {file_name} : display first 5 lines of the file</li><li>tail : view the last lines of any text file, by default it will showing first 10 lines<br>- tail -n 5 {file_name} : display last 5 lines of the file</li></ul><p><strong>4. Manual guide</strong></p><ul><li>man : manual<br>- man cp : display full guide for copy command</li><li>--help : help<br>- cp --help : display short guide for copy command</li></ul><p><strong>5. System commands</strong></p><ul><li>sudo : SuperUser Do, enables to perform tasks that require administrative or root permissions</li><li>command1; command2; command3 : run multiple commands</li><li>command1 &amp;&amp; command2 &amp;&amp; command3 : run the next commands after the first one is successful</li><li>useradd {username} : add a new user<br>- passwd {password} : set the password</li><li>userdel : delete a user</li><li>chmod {options} {file_name} : change the read, write, and execute permissions of files and directories<br>- chmod u=rwx,g=rx,o=r {file_name}<br>- u : user<br>- g : group<br>- o : other<br>- r : read<br>- w : write<br>- x : execute</li><li>chown {username} {file_name} : change or transfer the ownership of a file</li><li>uname : print detailed information about your Linux system</li><li>hostname : display the name of host/network<br>- hostname -i : display the IP address of the network</li><li>wget {link} : download from the internet</li><li>ps : display information about the currently running processes, including their process identification numbers (PIDs)</li><li>kill {pid} : terminate an unresponsive program</li><li>df : get a report on the system’s disk space usage<br>- df -h : display disk space statistics<br>- df -m : display disk space statistics in megabytes</li><li>du -h : display disk usage</li><li>free -m → show free memory</li><li>cat /proc/cpuinfo → display cpu info</li><li>htop / top → monitor system resources</li><li>history : review the commands we’ve entered before</li><li>clear : clean out the terminal</li></ul><p>6. <strong>Keyboard shourcut</strong></p><ul><li>ctrl + C : safe kill</li><li>ctrl + Z : sometimes there are child processes that still running in the background</li><li>ctrl + A : moves to the beginning of the line</li><li>ctrl + E : moves to the end of the line</li></ul><p><em>Source:</em></p><ul><li><em>Unix cheat sheet → </em><a href="http://www.mathcs.emory.edu/~valerie/courses/fall10/155/resources/unix_cheatsheet.html"><em>http://www.mathcs.emory.edu/~valerie/courses/fall10/155/resources/unix_cheatsheet.html</em></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=202cb67601de" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Basic Vagrantfile configuration]]></title>
            <link>https://medium.com/@zakiarsyad/basic-vagrantfile-configuration-6b8138b92481?source=rss-d28f34c607bd------2</link>
            <guid isPermaLink="false">https://medium.com/p/6b8138b92481</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[vagrant]]></category>
            <category><![CDATA[macos]]></category>
            <dc:creator><![CDATA[Zaki Arrozi Arsyad]]></dc:creator>
            <pubDate>Tue, 19 May 2020 02:39:17 GMT</pubDate>
            <atom:updated>2020-05-19T04:03:38.202Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RAfLD-AUU358bze-" /><figcaption>Photo by <a href="https://unsplash.com/@arthurreeder?utm_source=medium&amp;utm_medium=referral">Arthur Reeder</a> on <a href="https://unsplash.com?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Let’s create a basic configuration of our Vagrantfile, instead of only use vagrant init.</p><ul><li><strong>Default Vagrantfile if we run</strong> vagrant init &lt;boxpath&gt;</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c81526241ffa87d32eb34320bb4c159a/href">https://medium.com/media/c81526241ffa87d32eb34320bb4c159a/href</a></iframe><ul><li><strong>Set minimum vagrant version</strong></li></ul><pre>Vagrant.require_version &quot;&gt;= 1.3.5&quot;, &quot;&lt; 1.4.0&quot;</pre><p>This will help toavoid compatibility issues that may arise from using different version of vagrant.<br>We can specify the version that the Vagrantfile will only run if we use greater than equal version 1.3.5 and below 1.4.0.</p><ul><li><strong>Configures provisioners</strong></li></ul><pre>config.vm.provision &quot;shell&quot;, inline: &quot;apt-get update &amp;&amp; apt-get install -y  docker.io &quot;</pre><p>or</p><pre>config.vm.provision &quot;shell&quot;, inline: &lt;&lt;-SHELL<br>    apt-get update<br>    apt-get install -y  docker.io<br>SHELL</pre><p>We can automatically run a code to install and configure something when the virtual machine is created.<br>In this case, we update the package list and install docker.</p><ul><li><strong>Define a Virtual Machine</strong></li></ul><pre>config.vm.define &quot;ubuntu1804&quot; do |ubuntu1804|<br>    # ...<br>end</pre><p>We can define a name for our VM, instead of use default if we don’t define it.</p><ul><li><strong>Configure the machine</strong></li></ul><pre>config.vm.box = &quot;ubuntu/bionic64&quot;</pre><p>We can specify our machine we want to run. We can find available linux machine <a href="https://app.vagrantup.com/boxes/search">here</a>.</p><ul><li><strong>Set autoupdate for every </strong>vagrant up</li></ul><pre>config.vm.box_check_update = false</pre><p>The default value is true, so every time we run the VM, it will check for updates.</p><ul><li><strong>Create a forwarded port</strong></li></ul><pre># enable public access<br>config.vm.network &quot;forwarded_port&quot;, guest: 80, host: 8080</pre><pre># disable public access<br>config.vm.network &quot;forwarded_port&quot;, guest: 80, host: 8080, host_ip: &quot;127.0.0.1&quot;</pre><p>We can configure the networks in the machine. If we use config.vm.network we have to specify two ports, first one is for guess and the second one is host port that the guest port can be accessed by.<br>By default, it will automatically enable the public access. If we want to disable public access, we need to specify the host_ip that only allow access via 127.0.0.1.</p><ul><li><strong>Create a private network</strong></li></ul><pre>config.vm.network &quot;private_network&quot;, ip: &quot;192.168.33.10&quot;</pre><p>We can also specify the private IP for the machine that allow us to access the VM using a static IP.</p><ul><li><strong>Create a bridge network</strong></li></ul><pre>config.vm.network :public_network, :bridge =&gt; &quot;en0: Wi-Fi (Wireless)&quot;</pre><p>The default network connection for vagrant is NAT. We can update into bridge which is allow the machine to connect to other vm and the host, also we can use host only which only allow communication between the machin and the host.</p><ul><li><strong>Crate share a folder between VM and host</strong></li></ul><pre>config.vm.synced_folder &quot;HOST_FOLDER_PATH&quot;, &quot;VM_FOLDER_PATH&quot;</pre><p>We can create a sync folder that allow us to copy pasting a file between the machine and the host. We need to specify the host folder path and vm folder path , then we can easily transfer file between that machines.</p><ul><li><strong>Set provider configuration</strong></li></ul><pre>config.vm.provider &quot;virtualbox&quot; do |vb|<br>    vb.memory = &quot;2048&quot;<br>    vb.cpus = &quot;1&quot;<br>end</pre><p>If we need more memory and cpu, we can configure the memory and cpus we want to use in the VM.</p><ul><li><strong>Configure disk size</strong></li></ul><pre>config.disksize.size = &#39;25GB&#39;</pre><p>We also can configure disk size that we want to use for the machine.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4220592a213879d09428783364250403/href">https://medium.com/media/4220592a213879d09428783364250403/href</a></iframe><p><em>Source</em></p><ul><li><em>Vagrant public boxpath → </em><a href="https://app.vagrantup.com/boxes/search"><em>https://app.vagrantup.com/boxes/search</em></a></li><li><em>Vagrantfile docs → </em><a href="https://www.vagrantup.com/docs/vagrantfile/"><em>https://www.vagrantup.com/docs/vagrantfile/</em></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6b8138b92481" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Simply running linux on mac machine]]></title>
            <link>https://medium.com/@zakiarsyad/simply-running-linux-on-mac-machine-2b2f19b6d36f?source=rss-d28f34c607bd------2</link>
            <guid isPermaLink="false">https://medium.com/p/2b2f19b6d36f</guid>
            <category><![CDATA[macos]]></category>
            <category><![CDATA[virtual-ma]]></category>
            <category><![CDATA[vagrant]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Zaki Arrozi Arsyad]]></dc:creator>
            <pubDate>Mon, 18 May 2020 17:10:48 GMT</pubDate>
            <atom:updated>2020-05-21T22:58:20.418Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4M2C2tAu53E6nWQL" /><figcaption>Photo by <a href="https://unsplash.com/@jmckinven?utm_source=medium&amp;utm_medium=referral">James McKinven</a> on <a href="https://unsplash.com?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Hi, we will run through how I run linux in my machine.<br>I will use brew for the installation.</p><ol><li><strong>Make sure brew is installed</strong></li></ol><pre>brew --version</pre><p>if there is no brew installed, let’s just add it to your machine.</p><pre>ruby -e &quot;$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)&quot;</pre><p><strong>2. Install VirtualBox</strong></p><p>Simply run this command to add VirtualBox in your machine</p><pre>brew install cask virtual box</pre><p>Then check the installation using this command</p><pre>vboxmanage --version</pre><p><strong>3. Install Vagrant</strong></p><p>Next, we will need Vagrant to help us to run and getting in to the linux machine</p><pre>brew install vagrant</pre><p>Then check the installation</p><pre>vagrant --version</pre><p><strong>4. Let’s start the linux machine</strong></p><p>These are the main things to run linux</p><ul><li>Creating a Virtual Machine</li></ul><pre>vagrant init &lt;boxpath&gt;</pre><p>You can choose linux version that you want. go to this source <a href="https://app.vagrantup.com/boxes/search">here</a>.<br>In case we want to use ubuntu1804, we can type vagrant init ubuntu/bionic64 .<br>This command will generate a Vagrantfile for us.</p><ul><li>Starting a Virtual Machine</li></ul><pre>vagrant up</pre><ul><li>Getting into a Virtual Machine</li></ul><pre>vagrant ssh &lt;boxname&gt;</pre><p>In this case, we only use default Vagrantfile from vagrant init &lt;boxpath&gt; instead of set the box name. We can simply run vagrant ssh to get into out VM. Welcome to linux machine !!</p><ul><li>Stoping a Virtual Machine</li></ul><pre>vagrant halt</pre><p>This will stop the VM. We can simply run vagrant resume to start the VM again</p><ul><li>Cleaning up a Virtual Machine</li></ul><pre>vagrant destroy</pre><p>This command will delete the VM, and we need to run vagrant up to create the VM.</p><p><em>Source:</em></p><ul><li><em>Vagrant cheatsheet → </em><a href="https://gist.github.com/wpscholar/a49594e2e2b918f4d0c4"><em>https://gist.github.com/wpscholar/a49594e2e2b918f4d0c4</em></a></li><li><em>Vagrant public boxpath → </em><a href="https://app.vagrantup.com/boxes/search"><em>https://app.vagrantup.com/boxes/search</em></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2b2f19b6d36f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>