Skip to content

Instantly share code, notes, and snippets.

View lohithn4's full-sized avatar
🎯
...

Lohith lohithn4

🎯
...
  • ECPL
  • bangalore
View GitHub Profile
@lohithn4
lohithn4 / 2019-https-localhost.md
Created December 8, 2022 09:49 — forked from cecilemuller/2019-https-localhost.md
How to create an HTTPS certificate for localhost domains

How to create an HTTPS certificate for localhost domains

This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.

Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).

zip -r zipperall.zip dir -x dir/subdir/**\* dir/anothersubdir/**\*
@lohithn4
lohithn4 / gist:7bd7968d74bce18b999567eb9f5c5b06
Created January 29, 2022 11:16
aws ec2 to web domain pointing with type A record.
https://w3path.com/point-domain-to-aws-ec2-instance/
@lohithn4
lohithn4 / systemsetup.sh
Last active August 30, 2022 05:56
Initial Setup Development Script
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get -y install vim git python3-pip
#postgresql
sudo sh -c 'echo "deb [arch=amd64] http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get -y install postgresql
sudo apt-get install libpq-dev
@lohithn4
lohithn4 / certbot
Last active December 20, 2022 15:19
lets encrypt certbot
https://tecadmin.net/install-lets-encrypt-create-ssl-ubuntu/
$ apt-get update
$ sudo apt-get install certbot
$ apt-get install python3-certbot-nginx
$ sudo certbot --nginx -d example.com -d www.example.com
server {
listen 80 default_server;
@lohithn4
lohithn4 / crontab-perm-denied.md
Created March 18, 2021 02:55 — forked from plembo/crontab-perm-denied.md
crontab says fopen: permission denied

When crontab gives fopen: permission denied error

While trying to open my user's crontab on Ubuntu, the system barked back:

$ crontab -l
crontabs/myuser/: fopen: Permission denied

This is due to improper permissions on crontab executable.

@lohithn4
lohithn4 / A Nuxt.js VPS production deployment.md
Created January 12, 2021 02:45 — forked from DreaMinder/A Nuxt.js VPS production deployment.md
Deployment manual for a real-world project built with nuxt.js + koa + nginx + pm2

Example of deployment process which I use in my Nuxt.js projects. I usually have 3 components running per project: admin-panel SPA, nuxt.js renderer and JSON API.

This manual is relevant for VPS such as DigitalOcean.com or Vultr.com. It's easier to use things like Now for deployment but for most cases VPS gives more flexebillity needed for projects bigger than a landing page.

UPD: This manual now compatible with nuxt@2.3. For older versions deployment, see revision history.


Let's assume that you have entered fresh installation of Ubuntu instance via SSH. Let's rock:

@lohithn4
lohithn4 / vscode.txt
Created July 23, 2020 05:33
Visual studio code basic settings
{
"editor.formatOnSave": true,
"editor.autoIndent": "advanced",
"editor.detectIndentation": true,
"files.insertFinalNewline": true,
"files.trimTrailingWhitespace": true,
"editor.formatOnPaste": true,
"editor.multiCursorModifier": "ctrlCmd",
"editor.snippetSuggestions": "top",
"editor.rulers": [
@lohithn4
lohithn4 / Vagrantfile
Created July 7, 2020 12:34
Vagrantfile for ubuntu/bionic64 version 20200701.0.0
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at