<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: jur erick</title>
    <description>The latest articles on Forem by jur erick (@jurerick).</description>
    <link>https://forem.com/jurerick</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F782995%2F86fa48d7-134d-45ab-9dcd-ac11676dc095.png</url>
      <title>Forem: jur erick</title>
      <link>https://forem.com/jurerick</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/jurerick"/>
    <language>en</language>
    <item>
      <title>My Go-To Development Commands Reference</title>
      <dc:creator>jur erick</dc:creator>
      <pubDate>Tue, 06 May 2025 07:06:27 +0000</pubDate>
      <link>https://forem.com/jurerick/my-development-favorite-commands-cheatsheet-1mik</link>
      <guid>https://forem.com/jurerick/my-development-favorite-commands-cheatsheet-1mik</guid>
      <description>&lt;h2&gt;
  
  
  RedHat (CentOS)
&lt;/h2&gt;

&lt;p&gt;List any process listening to the given port: &lt;code&gt;lsof -i:5000&lt;/code&gt;&lt;br&gt;
To kill a process by ID: &lt;code&gt;kill 12345&lt;/code&gt;&lt;br&gt;
Create a symbolic link: &lt;code&gt;ln -s [target dir] [symlink name]&lt;/code&gt;&lt;br&gt;
Find a symbolic link(s): &lt;code&gt;find . -type l -ls&lt;/code&gt;&lt;br&gt;
Create a recursive dir: &lt;code&gt;mkdir -p foo/bar/blek&lt;/code&gt;&lt;br&gt;
Remove user from a group: &lt;code&gt;gpasswd --delete user group&lt;/code&gt;&lt;br&gt;
Change file permission: &lt;code&gt;chmod -R 755 my/files&lt;/code&gt;&lt;br&gt;
Change ownership of file: &lt;code&gt;chown owner_name file_name&lt;/code&gt;&lt;br&gt;
Change the group ownership of file: &lt;code&gt;chown :group1 file1.text&lt;/code&gt;&lt;br&gt;
Check disk space: &lt;code&gt;df -h --total&lt;/code&gt;&lt;br&gt;
Generate ssh key: &lt;code&gt;ssh-keygen&lt;/code&gt;&lt;br&gt;
Verify that the swap space in disk is active: &lt;code&gt;sudo free -h&lt;/code&gt;&lt;br&gt;
Show disk usage including hidden files: &lt;code&gt;du -sh .[!.]* *&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Run script in the background. E.g:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;yarn command: &lt;code&gt;nohup yarn start &amp;amp;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;python command: &lt;code&gt;nohup python3 /path/to/app.py &amp;amp;&lt;/code&gt; &lt;/li&gt;
&lt;li&gt;npm command: &lt;code&gt;nohup npm run start:app &amp;amp;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;nohup w/out generating the output file: &lt;code&gt;nohup [some command] &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&amp;amp;&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Node
&lt;/h2&gt;

&lt;p&gt;Run js file with environment variables: &lt;code&gt;node --env-file .env build/src/index.js&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Nginx
&lt;/h2&gt;

&lt;p&gt;Restart nginx server: &lt;code&gt;service nginx restart&lt;/code&gt;&lt;br&gt;
Increase memory when running node: &lt;code&gt;set NODE_OPTIONS=--max_old_space_size=4096&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Git
&lt;/h2&gt;

&lt;p&gt;Clear cache: &lt;code&gt;git rm -r --cached .&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Python
&lt;/h2&gt;

&lt;p&gt;Install packages based on requirements: &lt;code&gt;pip3 install -r /path/to/requirements.txt&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Visual Studio Code
&lt;/h2&gt;

&lt;p&gt;Search Files: &lt;code&gt;Command + shift + F&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Copy line down: &lt;code&gt;Shift + alt + Down arrow&lt;/code&gt;&lt;br&gt;
Copy line up: &lt;code&gt;Shift + alt + Up arrow&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Delete line: &lt;code&gt;Ctrl + shift + K&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Plugin: &lt;strong&gt;Prettier&lt;/strong&gt;&lt;/em&gt;&lt;br&gt;
Format document: &lt;code&gt;Shift + alt + F&lt;/code&gt; &lt;/p&gt;

</description>
      <category>linux</category>
      <category>nginx</category>
      <category>python</category>
      <category>productivity</category>
    </item>
    <item>
      <title>How To Deploy Open Web Components to Heroku</title>
      <dc:creator>jur erick</dc:creator>
      <pubDate>Sat, 04 Jun 2022 06:30:47 +0000</pubDate>
      <link>https://forem.com/jurerick/how-to-deploy-open-web-components-to-heroku-4ic8</link>
      <guid>https://forem.com/jurerick/how-to-deploy-open-web-components-to-heroku-4ic8</guid>
      <description>&lt;h2&gt;
  
  
  Prerequisite
&lt;/h2&gt;

&lt;p&gt;This post assume you got the prerequisite items below:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Your app is scaffolded using the &lt;a href="https://open-wc.org/guides/developing-components/getting-started/"&gt;&lt;strong&gt;Open Web Components&lt;/strong&gt; generator.&lt;/a&gt; and...&lt;/li&gt;
&lt;li&gt;You already have your open-wc application &lt;strong&gt;working&lt;/strong&gt; in your local machine.&lt;/li&gt;
&lt;li&gt;You are now &lt;strong&gt;ready&lt;/strong&gt; to deploy your application to &lt;strong&gt;Heroku&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;You like using &lt;strong&gt;Github&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Building
&lt;/h2&gt;

&lt;p&gt;The goal right now is to generate the static files of your application. The complete steps in doing this can be found in open-wc website's &lt;a href="https://open-wc.org/docs/building/rollup/"&gt;rollup page&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For our convenience, listed below are items necessary for this basic deployment.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Install rollup packages.
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm i -D rollup @open-wc/building-rollup rimraf deepmerge es-dev-server
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Create a &lt;code&gt;rollup.config.js&lt;/code&gt; file in the root folder of your app.
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import merge from 'deepmerge';
import { createSpaConfig } from '@open-wc/building-rollup';

const baseConfig = createSpaConfig({
  developmentMode: process.env.ROLLUP_WATCH === 'true',
  injectServiceWorker: false,
});

export default merge(baseConfig, {
  input: './index.html'
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. Add the following NPM scripts to your &lt;code&gt;package.json&lt;/code&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "scripts": {
    "build": "rimraf dist &amp;amp;&amp;amp; rollup -c rollup.config.js",
    "start:build": "npm run build &amp;amp;&amp;amp; es-dev-server --root-dir dist --app-index index.html --compatibility none --open"
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  4. Run &lt;code&gt;npm run build&lt;/code&gt; command.
&lt;/h3&gt;

&lt;p&gt;This will generate a &lt;code&gt;dist&lt;/code&gt; folder that will contain the optimized static files of our project. &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FY2rZrA_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o7z2fnhae8keh13ypboc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FY2rZrA_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o7z2fnhae8keh13ypboc.png" alt="Image description" width="261" height="192"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  5. Breath, sip your coffee. Succeeding steps below are easy too!
&lt;/h3&gt;
&lt;h2&gt;
  
  
  Github
&lt;/h2&gt;

&lt;p&gt;Oh you like Github huh! Luckily, Heroku has the deployment method that connects your Github repository and allow you to manually (or automatically) deploy your application. We'll see that in a bit.&lt;/p&gt;

&lt;p&gt;From this point, we will focus on the &lt;code&gt;dist&lt;/code&gt; folder alone and it's contents. We aim to deploy this in Heroku.&lt;/p&gt;
&lt;h3&gt;
  
  
  1. http-server
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;cd&lt;/code&gt; to your &lt;code&gt;dist&lt;/code&gt; folder and let's install the &lt;code&gt;http-server&lt;/code&gt; package.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install http-server
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. package.json
&lt;/h3&gt;

&lt;p&gt;Make sure there are scripts section in your &lt;code&gt;package.json&lt;/code&gt; file of the &lt;code&gt;dist&lt;/code&gt; folder. The &lt;code&gt;package.json&lt;/code&gt; content should be similar to this:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zUuld6UQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/13nyv1vl1dc2qubdsio4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zUuld6UQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/13nyv1vl1dc2qubdsio4.png" alt="Image description" width="297" height="208"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  3. &lt;code&gt;git push&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;push&lt;/code&gt;&lt;/strong&gt; to your Github. Still in your &lt;code&gt;dist&lt;/code&gt; folder, run the commands below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git init
git remote add origin https://github.com/[yourname]/[yourrepository.git]
git branch -M master
git push -u origin master

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After this successful pushed to Github, let's go now to Heroku.&lt;/p&gt;

&lt;h2&gt;
  
  
  Deploy
&lt;/h2&gt;

&lt;p&gt;In your Heroku application page, go to the &lt;em&gt;Deploy&lt;/em&gt; page. Down below is the &lt;strong&gt;Deployment method&lt;/strong&gt; section. &lt;/p&gt;

&lt;h4&gt;
  
  
  - Choose Github.
&lt;/h4&gt;

&lt;h4&gt;
  
  
  - Search your repo name..
&lt;/h4&gt;

&lt;h4&gt;
  
  
  - and Connect!
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vMxBwAqQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rkab6sco6ph6fvs9mf41.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vMxBwAqQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rkab6sco6ph6fvs9mf41.png" alt="Image description" width="880" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once connected, &lt;strong&gt;click deploy button&lt;/strong&gt; in Manual deploy section below the page.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--sl6EDB4C--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cclpnq0x39d70ih0sjfk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--sl6EDB4C--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cclpnq0x39d70ih0sjfk.png" alt="Image description" width="880" height="194"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After the Heroku's build process, You should now be able to visit your application via Heroku's generated url.&lt;/p&gt;

</description>
      <category>openwc</category>
      <category>heroku</category>
      <category>httpserver</category>
      <category>webcomponents</category>
    </item>
  </channel>
</rss>
