<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Txt</title>
	<atom:link href="http://txt.binnyva.com/feed/" rel="self" type="application/rss+xml" />
	<link>https://txt.binnyva.com</link>
	<description>Byte sized tech know-how.</description>
	<lastBuildDate>Wed, 11 Jun 2025 21:20:45 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>Run Webserver with current folder as root</title>
		<link>https://txt.binnyva.com/2022/12/run-webserver-with-current-folder-as-root/</link>
					<comments>https://txt.binnyva.com/2022/12/run-webserver-with-current-folder-as-root/#respond</comments>
		
		<dc:creator><![CDATA[Binny V A]]></dc:creator>
		<pubDate>Thu, 01 Dec 2022 13:57:45 +0000</pubDate>
				<category><![CDATA[Command Line]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[command]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[static]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[webserver]]></category>
		<guid isPermaLink="false">https://txt.binnyva.com/?p=756</guid>

					<description><![CDATA[Different ways to run a webserver using the current directory as root. Useful to serve static files.]]></description>
										<content:encoded><![CDATA[<p>Different ways to run a webserver using the current directory as root. Useful to serve static files.</p>
<p>If you use NPM, install serve using <code>npm install serve -g</code>. Then run it using the command&#8230;</p>
<p><code>serve</code></p>
<p>If you have PHP install, use the command&#8230;</p>
<p><code>php -Slocalhost:8000</code></p>
<p>If python is your thing, use command&#8230;</p>
<p><code>python -m SimpleHTTPServer 8000</code></p>
<p>If you want to use Python3, use&#8230;</p>
<p><code>python3 -m http.server</code></p>
<p>You can exit for any of these using the keyboard shortuct Ctrl+C.</p>
<p><a class="wp-editor-md-post-content-link" href="https://paul.wellnerbou.de/2015/05/03/ways-to-start-a-webserver-in-your-current-directory/">Source</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://txt.binnyva.com/2022/12/run-webserver-with-current-folder-as-root/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Pass Command Line Arguments to npm</title>
		<link>https://txt.binnyva.com/2022/10/pass-command-line-arguments-to-npm/</link>
					<comments>https://txt.binnyva.com/2022/10/pass-command-line-arguments-to-npm/#respond</comments>
		
		<dc:creator><![CDATA[Binny V A]]></dc:creator>
		<pubDate>Sat, 15 Oct 2022 11:10:04 +0000</pubDate>
				<category><![CDATA[Command Line]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[arguments]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[npm]]></category>
		<guid isPermaLink="false">https://txt.binnyva.com/?p=753</guid>

					<description><![CDATA[If you want to pass command line arguments to `npm` scripts, use the `--` separator. ]]></description>
										<content:encoded><![CDATA[<p>If you want to pass command line arguments to <code>npm</code> scripts, use the <code>--</code> separator. Example&#8230;</p>
<pre><code class="line-numbers">npm run build -- --prefix-paths
</code></pre>
<p>This will pass  the <code>--prefix-paths</code>to the <code>build</code> script. Please note the double <code>--</code> in the command.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://txt.binnyva.com/2022/10/pass-command-line-arguments-to-npm/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Screen Mirroring from Android phone to Linux</title>
		<link>https://txt.binnyva.com/2022/07/screen-mirroring-from-android-phone-to-linux/</link>
					<comments>https://txt.binnyva.com/2022/07/screen-mirroring-from-android-phone-to-linux/#respond</comments>
		
		<dc:creator><![CDATA[Binny V A]]></dc:creator>
		<pubDate>Mon, 25 Jul 2022 06:10:46 +0000</pubDate>
				<category><![CDATA[Command Line]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[phone]]></category>
		<category><![CDATA[screen]]></category>
		<guid isPermaLink="false">https://txt.binnyva.com/?p=749</guid>

					<description><![CDATA[Use [scrcpy](https://github.com/Genymobile/scrcpy)(screen copy) to mirror an Android device - and see/use it from your linux system.]]></description>
										<content:encoded><![CDATA[<p>Use <a class="wp-editor-md-post-content-link" href="https://github.com/Genymobile/scrcpy">scrcpy</a>(screen copy) to mirror an Android device &#8211; and see/use it from your linux system.</p>
<h3>Setup</h3>
<p>Install <code>scrcpy</code>&#8230;</p>
<p><code>sudo apt-get install scrcpy</code></p>
<p>Connect your phone to your system using a USB cable. Make sure USB Debugging is enabled.</p>
<p>Run command&#8230;</p>
<pre><code class="line-numbers">adb tcpip 5555
adb connect &lt;your android's ip address&gt;:5555
</code></pre>
<p>Disconnect the USB Cable. Then run&#8230;</p>
<p><code>scrcpy</code></p>
<p>This should open a window where you can see the phone screen.</p>
<h3>Usage</h3>
<p>You&#8217;ll not have to do the USB connection again. Just run these commands to see the screen&#8230;</p>
<pre><code class="line-numbers">adb connect &lt;your android's ip address&gt;:5555
scrcpy
</code></pre>
<p>Keep in mind your phone IP might change. And phone reboot might end the <code>adb tcpip 5555</code> demon. So that might have to be done again.</p>
<p><a class="wp-editor-md-post-content-link" href="https://www.reddit.com/r/linux/comments/vzjsbj/mirroring_phone_screen_wirelessly_in_just_one/">Source</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://txt.binnyva.com/2022/07/screen-mirroring-from-android-phone-to-linux/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Metadata/Frontmatter of current note in Obsidian</title>
		<link>https://txt.binnyva.com/2021/08/metadata-frontmatter-of-current-note-in-obsidian/</link>
					<comments>https://txt.binnyva.com/2021/08/metadata-frontmatter-of-current-note-in-obsidian/#respond</comments>
		
		<dc:creator><![CDATA[Binny V A]]></dc:creator>
		<pubDate>Tue, 03 Aug 2021 18:28:31 +0000</pubDate>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[obsidian]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[typescript]]></category>
		<guid isPermaLink="false">https://txt.binnyva.com/?p=746</guid>

					<description><![CDATA[Get the metadata or the frontmatter of the currently open note in Obsidian plugin development.]]></description>
										<content:encoded><![CDATA[<p>Get the metadata or the frontmatter of the currently open note in Obsidian plugin development. This uses the Obsidian metadata cache.</p>
<pre><code class="language-js line-numbers">const noteFile = this.app.workspace.getActiveFile(); // Get the currently Open Note
const metadata = this.app.metadataCache.getFileCache(noteFile);
</code></pre>
]]></content:encoded>
					
					<wfw:commentRss>https://txt.binnyva.com/2021/08/metadata-frontmatter-of-current-note-in-obsidian/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Get selected text in Obsidian</title>
		<link>https://txt.binnyva.com/2021/08/get-selected-text-in-obsidian/</link>
					<comments>https://txt.binnyva.com/2021/08/get-selected-text-in-obsidian/#respond</comments>
		
		<dc:creator><![CDATA[Binny V A]]></dc:creator>
		<pubDate>Tue, 03 Aug 2021 18:27:08 +0000</pubDate>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[obsidian]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[typescript]]></category>
		<guid isPermaLink="false">https://txt.binnyva.com/?p=744</guid>

					<description><![CDATA[Getting the currently selected text when creating an Obsidian plugin]]></description>
										<content:encoded><![CDATA[<p>Getting the currently selected text when creating an Obsidian plugin&#8230;</p>
<pre><code class="language-js line-numbers">import { MarkdownView } from 'obsidian';

// ...

// Access to the editor component...
const editor = this.app.workspace.getActiveViewOfType(MarkdownView)?.editor; 
const selectedText = editor.getSelection(); // Get selected text
</code></pre>
<p>You can also update selected text&#8230;</p>
<pre><code class="language-js line-numbers">editor.replaceSelection("New Text Goes Here");
</code></pre>
]]></content:encoded>
					
					<wfw:commentRss>https://txt.binnyva.com/2021/08/get-selected-text-in-obsidian/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Get current file content in Obsidian</title>
		<link>https://txt.binnyva.com/2021/08/get-current-file-content-in-obsidian/</link>
					<comments>https://txt.binnyva.com/2021/08/get-current-file-content-in-obsidian/#comments</comments>
		
		<dc:creator><![CDATA[Binny V A]]></dc:creator>
		<pubDate>Tue, 03 Aug 2021 18:24:50 +0000</pubDate>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[obsidian]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[typescript]]></category>
		<guid isPermaLink="false">https://txt.binnyva.com/?p=742</guid>

					<description><![CDATA[Get currently open file and content when developing a plugin for Obsidian]]></description>
										<content:encoded><![CDATA[<p>If you are creating a plugin for Obsidian, and you want to get the currently opened file/note and its content, use this code&#8230;</p>
<pre><code class="language-js line-numbers">const noteFile = this.app.workspace.getActiveFile(); // Currently Open Note
if(!noteFile.name) return; // Nothing Open

// Read the currently open note file. We are reading it off the HDD - we are NOT accessing the editor to do this.
let text = await this.app.vault.read(noteFile); 
</code></pre>
]]></content:encoded>
					
					<wfw:commentRss>https://txt.binnyva.com/2021/08/get-current-file-content-in-obsidian/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Store Emoji in MySQL DB</title>
		<link>https://txt.binnyva.com/2021/07/store-emoji-in-mysql-db/</link>
					<comments>https://txt.binnyva.com/2021/07/store-emoji-in-mysql-db/#respond</comments>
		
		<dc:creator><![CDATA[Binny V A]]></dc:creator>
		<pubDate>Mon, 26 Jul 2021 21:49:51 +0000</pubDate>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Configuration]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[db]]></category>
		<category><![CDATA[emoji]]></category>
		<category><![CDATA[encoding]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[utf8]]></category>
		<guid isPermaLink="false">https://txt.binnyva.com/?p=740</guid>

					<description><![CDATA[If you want to store Emoji characters in a MySQL DB, you need to update the table encoding. You can...]]></description>
										<content:encoded><![CDATA[<p>If you want to store Emoji characters in a MySQL DB, you need to update the table encoding. You can do this by&#8230;</p>
<pre><code class="line-numbers">ALTER DATABASE &lt;DATABASE_NAME&gt; CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ;
ALTER TABLE &lt;table_name&gt; CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- ALTER TABLE &lt;table_name&gt; MODIFY &lt;field_name&gt; TEXT CHARSET utf8mb4;
</code></pre>
<p><a class="wp-editor-md-post-content-link" href="https://stackoverflow.com/questions/39463134/how-to-store-emoji-character-in-mysql-database">Source</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://txt.binnyva.com/2021/07/store-emoji-in-mysql-db/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Add HTTPS to a Domain using LetsEncrypt on Webmin/VirtualMin</title>
		<link>https://txt.binnyva.com/2021/06/add-https-to-a-domain-using-letsencrypt-on-webmin-virtualmin/</link>
					<comments>https://txt.binnyva.com/2021/06/add-https-to-a-domain-using-letsencrypt-on-webmin-virtualmin/#respond</comments>
		
		<dc:creator><![CDATA[Binny V A]]></dc:creator>
		<pubDate>Thu, 03 Jun 2021 20:13:17 +0000</pubDate>
				<category><![CDATA[Configuration]]></category>
		<guid isPermaLink="false">https://txt.binnyva.com/?p=737</guid>

					<description><![CDATA[Add a TXT record to your domain &#8211; it should have this value: _acme-challenge.DOMAIN.TLD &#8211; example: _acme-challenge.binnyva.com. Hostname will be...]]></description>
										<content:encoded><![CDATA[<ul>
<li>Add a TXT record to your domain &#8211; it should have this value: <code>_acme-challenge.DOMAIN.TLD</code> &#8211; example: <code>_acme-challenge.binnyva.com</code>. Hostname will be <code>@</code>.</li>
<li>Do this for all the subdomains you want an SSL certificate for. It will look like this &#8211; <code>_acme-challenge.www.binnyva.com</code>, <code>_acme-challenge.txt.binnyva.com</code>. Each subdomain will need a separate TXT record.</li>
<li>Open VirtualMin, go to the domain&#8217;s Virtual Server.</li>
<li>Go to <code>Manage Virtual Server &gt; Setup SSL Certificate</code>(in the Sidebar)</li>
<li>Open the <code>Let's Encrypt</code> tab.</li>
<li>Select the &#8216;Domain names listed here&#8217; option, and enter all the domains you want an SSL certificate for &#8211; separated by new lines.</li>
<li>Mark the <code>Automatically renew certificate?</code> option as &#8216;Yes&#8217;</li>
<li>Click <code>Request Certificate</code></li>
</ul>
<p>If all went well, you&#8217;ll get the certificates automatically installed with in a minute or so.</p>
<p>Justed used this to get an certificate for <a class="wp-editor-md-post-content-link" href="https://arathimd.com">Arathi M D</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://txt.binnyva.com/2021/06/add-https-to-a-domain-using-letsencrypt-on-webmin-virtualmin/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Docker Basics</title>
		<link>https://txt.binnyva.com/2021/03/docker-basics/</link>
					<comments>https://txt.binnyva.com/2021/03/docker-basics/#respond</comments>
		
		<dc:creator><![CDATA[Binny V A]]></dc:creator>
		<pubDate>Fri, 19 Mar 2021 20:32:54 +0000</pubDate>
				<category><![CDATA[Configuration]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[basics]]></category>
		<category><![CDATA[configure]]></category>
		<category><![CDATA[docker]]></category>
		<guid isPermaLink="false">https://txt.binnyva.com/?p=727</guid>

					<description><![CDATA[Source Images Images are the templates used to create Docker Containers. Container is a running instance of an image. Eg....]]></description>
										<content:encoded><![CDATA[<p><a class="wp-editor-md-post-content-link" href="https://www.youtube.com/playlist?list=PLhW3qG5bs-L99pQsZ74f-LC-tOEsBp2rK">Source</a></p>
<h2>Images</h2>
<p>Images are the templates used to create Docker Containers. Container is a running instance of an image. Eg. ubuntu Image. Or Apache image.</p>
<h3>Commands</h3>
<p>Show all images available</p>
<p><code>docker images</code></p>
<p>Run the given image(<code>ubuntu</code>) in the interactive mode(<code>-it</code>)</p>
<p><code>docker run -it ubuntu</code></p>
<p>Get an image from repository</p>
<p><code>docker pull &lt;image-name&gt;[:&lt;tag/version&gt;]</code></p>
<h2>Containers</h2>
<p>Container is a running instance of an image.</p>
<h2>Architechture</h2>
<p>Host: The system where docker is run<br />
Client: CLI interface to the docker daemon<br />
Registry: Docker Hub or other places where images are stored.</p>
<p><img decoding="async" src="https://alanhou.org/homepage/wp-content/uploads/2018/04/docker-architecture.png" alt="Docker Architechture" /></p>
<h2>Dockerfile</h2>
<p>Dockerfile is a text file with insturctions to build an image. Generally, it has the filename <code>Dockerfile</code>. Sample&#8230;</p>
<pre><code class="line-numbers"># The base image. This search locally - if not present, it gets pulled from repository
FROM ubuntu

# Run this command
RUN apt-get update

</code></pre>
<h3>Instructions</h3>
<ul>
<li><strong>FROM</strong>: Sets the Base Image for subsequent instructions.</li>
<li><strong>RUN</strong>: execute any commands in a new layer on top of the current image and commit the results.</li>
<li><strong>CMD</strong>: provide defaults for an executing container.</li>
<li><strong>EXPOSE</strong>: informs Docker that the container listens on the specified network ports at runtime. NOTE: does not actually make ports accessible.</li>
<li><strong>ENV</strong>: sets environment variable.</li>
<li><strong>COPY</strong>: copies new files or directories to container. By default this copies as root regardless of the USER/WORKDIR settings. Use &#8211;chown=USER:GROUP to give ownership to another user/group. (Same for ADD.)</li>
<li><strong>VOLUME</strong>: creates a mount point for externally mounted volumes or other containers.</li>
<li><strong>USER</strong>: sets the user name for following RUN / CMD / ENTRYPOINT commands.</li>
<li><strong>WORKDIR</strong>: sets the working directory.</li>
<li><strong>LABEL</strong>: apply key/value metadata to your images, containers, or daemons.</li>
</ul>
<p><a class="wp-editor-md-post-content-link" href="https://github.com/wsargent/docker-cheat-sheet#dockerfile">Dockerfile Cheetsheet</a><br />
<a class="wp-editor-md-post-content-link" href="https://docs.docker.com/engine/reference/builder/#environment-replacement">Dockerfile Reference</a></p>
<p>Run <code>docker build .</code> in the same folder to build an image from this Dockerfile.</p>
<h2>Docker Compose</h2>
<p>Its a tool for creating and running systems which has multiple containers within it. Eg. A web app will require an API Server, Frontend Server and Database Server. You can run all this together using docker compose.</p>
<p>You&#8217;ll have to <a class="wp-editor-md-post-content-link" href="https://docs.docker.com/compose/install/">install <code>docker-compose</code></a> before you use it &#8211; its NOT part of the default docker install in linux.</p>
<p>Use <code>docker-compose.yml</code> to design the system.</p>
<h3>Commands</h3>
<pre><code class="line-numbers">docker-compose config   # Checks validity of the docker-compose.yml file
docker-compose up       # Start all Services. Add -d flag to run in the background.
docker-compose down     # Stop all Services
</code></pre>
<h2>Volumes</h2>
<p>Think of Volumes as the &#8216;HardDisks&#8217; for the containers &#8211; the persintent data storage location. Containers can read and write to it &#8211; and the data will stay even after the containers are shut down.</p>
<h3>Uses</h3>
<ul>
<li>Decouple data storage from containers</li>
<li>Share data accross multiple containers</li>
<li>Persistant storage &#8211; when stoping the container, the data doesn&#8217;t get deleted.</li>
</ul>
<h3>Commands</h3>
<pre><code class="line-numbers">docker volume create NAME
docker volume ls
docker volume install NAME # Show details about the volume.
docker volume rm NAME # Remove volume
docker run -v NAME:/var/lib/www IMAGE_NAME # Attaching a volume to an IMAGE - and mount it at location /var/lib/www
</code></pre>
<h3>Bind Mounts</h3>
<p>An alternative to using volumes is bind mount. Bind mount is a location in the host system that is running the container. This can be changed by the host system/user(unlike volumes).</p>
<h2>Debugging</h2>
<p>Comnand to run an interactive shell with in a container&#8230;</p>
<p><code>docker exec -it NAME sh</code></p>
]]></content:encoded>
					
					<wfw:commentRss>https://txt.binnyva.com/2021/03/docker-basics/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Install and Configure Docker</title>
		<link>https://txt.binnyva.com/2021/03/install-and-configure-docker/</link>
					<comments>https://txt.binnyva.com/2021/03/install-and-configure-docker/#respond</comments>
		
		<dc:creator><![CDATA[Binny V A]]></dc:creator>
		<pubDate>Fri, 19 Mar 2021 20:29:12 +0000</pubDate>
				<category><![CDATA[Command Line]]></category>
		<category><![CDATA[Configuration]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[configure]]></category>
		<category><![CDATA[docker]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[ubuntu]]></category>
		<guid isPermaLink="false">https://txt.binnyva.com/?p=725</guid>

					<description><![CDATA[Install Docker on Ubuntu and Configure it to use a non-default directory.]]></description>
										<content:encoded><![CDATA[<h2>Install Docker</h2>
<p><a class="wp-editor-md-post-content-link" href="https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-20-04">Source</a></p>
<p>Run these commands on your ubuntu system to install Docker.</p>
<pre><code class="line-numbers">sudo apt update
sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
sudo apt update
sudo apt install docker-ce
</code></pre>
<p>Check the instalation using this command&#8230;</p>
<p><code>sudo systemctl status docker</code></p>
<p>Getting docker to run without the root user, add your username to the docker group&#8230;</p>
<p><code>sudo usermod -aG docker ${USER}</code></p>
<p>To apply the new group membership, log out of the server and back in.</p>
<h3>Test Docker</h3>
<p><code>docker run hello-world</code></p>
<h2>Basic Commands</h2>
<p>See all images</p>
<p><code>docker images</code></p>
<p>See all containers</p>
<p><code>docker containers</code></p>
<p>Running containers</p>
<p><code>docker ps</code></p>
<p>Others&#8230;</p>
<pre><code class="line-numbers">docker info
docker images
docker pull
docker run
docker start
docker stop
docker stats
docker system df
docker system prune
</code></pre>
<h2>Install <code>docker-compose</code></h2>
<p><a class="wp-editor-md-post-content-link" href="https://docs.docker.com/compose/install/">Source</a></p>
<pre><code class="line-numbers">sudo curl -L "https://github.com/docker/compose/releases/download/1.28.2/docker-compose-<span class="katex math inline">(uname -s)-</span>(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version # Test
</code></pre>
<h2>Configure Docker</h2>
<p><a class="wp-editor-md-post-content-link" href="https://blog.adriel.co.nz/2018/01/25/change-docker-data-directory-in-debian-jessie/">Source</a></p>
<p>We have to change the data directory from <code>/</code> to somewhere with more space &#8211; it will easily run into GBs.</p>
<p>Stop docker using command&#8230;</p>
<p><code>sudo systemctl stop docker</code></p>
<p>Edit /etc/docker/daemon.json (if it doesn’t exist, create it) and include:</p>
<pre><code class="line-numbers">{
  "data-root": "/new/path/to/docker-data"
}
</code></pre>
<p>Copy existing docker data to the new location&#8230;</p>
<p><code>sudo rsync -axPS /var/lib/docker/ /new/path/to/docker-data</code></p>
<p>Restart Docker and check&#8230;</p>
<pre><code class="line-numbers">sudo systemctl start docker
docker info | grep 'Docker Root Dir'
docker ps
</code></pre>
]]></content:encoded>
					
					<wfw:commentRss>https://txt.binnyva.com/2021/03/install-and-configure-docker/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
