Let’s provide axios as a Lambda layer
mkdir nodejs
cd nodejs
npm install axios
cd ..
zip -r axios.zip nodejs
Let’s combine everything together Node.js, MySQL, AWS EC2, Express, env, Docker Compose, GitHub
Few days ago I’ve helped out my friend to deploy Node.js application to AWS EC2. Now I’ll show you, how I did it.
Let’s init new Node.js application and install express as a dependency.
# Install GitHub CLI
brew install gh# Create private repo
gh repo create sample-app --private -ycd sample-app
npm init -y
npm i express
touch index.js
echo "node_modules" >> .gitignore
Let’s add “Hello, World” response and start the server in index.js.
const express = require("express");const app = express();
const port =…
Prepare your Mac for coding using this script
I’ve written this script…
You can run it using:
curl https://gist.githubusercontent.com/ljmocic/a72983b0d39632c9f88e62cc6bdc0c9f/raw/f8404920d71b8424c2d238bd33f93ffa068e38ee/mac-setup.sh|sh
But let’s see what I’ve added there…
The essential thing is the package manager Homebrew. It enables us to install so many useful tools without having to install every thing separately. But there’s many more stuff included:
It’s easy to customize this script and you can find many more Homebrew formulas to add. …
Replace your RSS reader with simple Telegram bot
Recently I’ve got order on Fiverr to create Telegram bot which would notify public channel with new job postings in Singapore.
The data from the website was available through RSS feed. The bot should check every 20 minutes for a new content.
It was very simple to create it, so I want to share with you, how I did it.
So let’s get started
/start
commandtoken
in the endSend an email as simple as possible
I’ve written a simple script for sending emails with just Python and Gmail account about year ago, but in a meantime, it stopped working. I discovered that different credentials are needed now in order to send mail via script.
So I wrote this short guide to explain which configuration is required now and how to make it work again.
React is lightweight, S3 is cheap, GitHub Actions make deployment easier. Why don’t we try to use them together?
React became dominant in frontend development and it became first choice library for front-end development.
S3 is actually very cheap.
GitHub Actions abstract away a lot of complexity inside CI/CD workflows and they give us a chance to create easily understandable workflows faster.
What we will need to make this work:
npx create-react-app react-github-actions
gh repo create react-github-actions
NOTE: It will ask you if you want to create local project directory, say yes. …
Don’t integrate a full IoT solution if you just want to control one lamp.
My previous lamp stopped working. So I replaced it with the small strip of LEDs which connect over USB and works non-stop when connected.
I wanted to control turning it on/off with the button.
I’ve looked for some prebuilt solutions, but everything I found was too complicated for this use-case, so I came up with some simple solution.
2. Create a Siri Shortcut action for turning it on and off. …
While there are many factors to be included for deciding on which company has the greatest potential, in this article I will pick the ones which description seems most interesting to me.
Y Combinator is a startup accelerator that helped to launch more than 2,000 companies including Stripe, Airbnb, Cruise Automation, DoorDash, Coinbase, Instacart, and Dropbox.
Every year they invest a small amount of money in a large number of companies.
They have summer and winter season and they’ve published descriptions of the companies from the Winter 2020 season, originally on TechCrunch.
I’ve picked 7 most interesting ones and briefly explained why they are interesting to…
Use the power of EC2 instance to execute a resource-hungry script
The other day I was approached by a client who had a 2011 MacBook Air. He was trying to execute some computationally intensive script which only required Python to be installed. His script took longer than 30 minutes to execute on his machine.
He wanted to place his script in S3 bucket and simply execute it in the cloud without worrying about anything else.
The first solution that came to me was the usage of AWS Lambda. But Lambda execution time limit was 5 minutes. …