Skip to content

Instantly share code, notes, and snippets.

@nknganda
nknganda / Header.tsx
Created December 21, 2022 20:58 — forked from pedronauck/Header.tsx
Tailwind, PostCSS, Styled-JSX and NextJS
import React from 'react'
import { Link } from 'systems/Core/Link'
import css from 'styled-jsx/css'
export const Header = () => {
return (
<header className="Root">
<img src="/logo.svg" width={100} />
<div className="MainMenu">
<ul className="MenuList">
@nknganda
nknganda / Ansible-create-AWS-environment.yml
Created March 29, 2021 21:08 — forked from nivleshc/Ansible-create-AWS-environment.yml
This Ansible playbook deploys an AWS environment, which consists of a VPC, a public and private subnet, a jumphost in the public subnet and a server in the private subnet
---
- hosts: localhost
connection: local
gather_facts: yes
vars:
- vpc_region: us-east-1
- my_useast1_key: my_northvirginia_keypair
tasks:
- name: create VPC for Ansible
@nknganda
nknganda / setup-postgresql-vagrant.md
Created April 19, 2020 07:57 — forked from carymrobbins/setup-postgresql-vagrant.md
Configure PostgreSQL in a Vagrant guest to allow connections from the host.

Configure Postgres

  • Update pg_hba.conf (most likely in /etc/postgresql/9.4/main) with -
    • host all all 0.0.0.0/0 trust
  • Update postgresql.conf to use listen_addresses = '*'
  • Be sure to sudo service postgresql restart

Configure Vagrant

Keybase proof

I hereby claim:

  • I am nknganda on github.
  • I am nkn (https://keybase.io/nkn) on keybase.
  • I have a public key ASB6CHd8b4H9GEDsMFZ6Bxs_AnGc3Q9JPosVGqgPaFs3TQo

To claim this, I am signing this object:

@nknganda
nknganda / Email Server (Linux, Unix, Mac).md
Created October 10, 2018 13:31 — forked from raelgc/Email Server (Linux, Unix, Mac).md
Setup a Local Only Email Server (Linux, Unix, Mac)

Setup a Local Only Email Server (Linux, Unix, Mac)

1 - Point localhost.com to your machine

Most of programs will not accept an email using just @localhost as domain. So, edit /etc/hosts file to make the domain localhost.com point to your machine, including this content to the file:

127.0.0.1 localhost.com

2 - Install Postfix

@nknganda
nknganda / odoo_install.sh
Created August 26, 2017 13:46 — forked from bistaray/odoo_install.sh
Install Odoo v10 Enterprise (with Bista repositories)
#!/bin/bash
################################################################################
# Script for installing Odoo V10 on Ubuntu 16.04, 15.04, 14.04
# Author: Yenthe Van Ginneken
# Adjusted: Ray Carnes
# Assumes you already have an Ubuntu user called "odoo" with a home folder
#-------------------------------------------------------------------------------
# Make a new file:
# sudo nano odoo-install.sh
# Place this content in it and then make the file executable:
@nknganda
nknganda / beautiful_idiomatic_python.md
Created January 31, 2017 10:45 — forked from JeffPaine/beautiful_idiomatic_python.md
Transforming Code into Beautiful, Idiomatic Python: notes from Raymond Hettinger's talk at pycon US 2013. The code examples and direct quotes are all from Raymond's talk. I've reproduced them here for my own edification and the hopes that others will find them as handy as I have!

Transforming Code into Beautiful, Idiomatic Python

Notes from Raymond Hettinger's talk at pycon US 2013 video, slides.

The code examples and direct quotes are all from Raymond's talk. I've reproduced them here for my own edification and the hopes that others will find them as handy as I have!

Looping over a range of numbers

for i in [0, 1, 2, 3, 4, 5]: