How to Configure Vim as Your Go IDE

Vim/Neovim is my IDE for day-to-day work. My vimrc file can be found here.

This article is all about Vim(not Neovim), and I assume that you have already configured Vim as your code editor.

Okay, let’s get started by installing fatih/vim-go plugin with your favorite vim plugin manager.

After that, if you have Go installed correctly on your machine already, you will be able to run :GoInstallBinaries.

Next, install coc.nvim plugin, which is a great language server host for Vim.

How to Setup Eslint and Prettier With Git Precommit Hooks in React Typescript Project

You may create a new react app with typescript like so:

1
npx create-react-app my-app --template typescript

Now let’s setup eslint and prettier.

Remove eslintConfig from package.json.

Install prettier using these commands:

1
2
3
yarn add --dev --exact prettier
# these are for making eslint and prettier to play well together
yarn add --dev eslint-config-prettier eslint-plugin-prettier

Create config files like this:

Improve Your Wireguard Server's Performance

The default MTU(Maximum Transmission Unit) is 1420 in wireguard, while the most other devices use 1496 or 1500.

Read here for more info.

TL;DR

Stop the wireguard interface in use:

sudo systemctl stop wg-quick@wg0
# or
sudo wg-quick down wg0

Edit the wireguard config file:

sudo vim /etc/wireguard/wg0.conf

Add MTU=1400 to the Interface section like this:

1
2
3
4
5
6
[Interface]
Address = 10.10.10.1/24
SaveConfig = true
ListenPort = 51820
MTU = 1400
PrivateKey = xxxxxx

And start the stopped service:

Redux Setup in Your React Project - Personal Preference

The first thing is to install libraries for redux, as you may guess:

1
npm install -S redux react-redux redux-logger reselect redux-persist

redux-logger is a redux middleware which is really really helpful in development, but it’s up to you whether to use it or not. reselect is a memoization implementation for redux. redux-persist is for leveraging localStorage/sessionStorage browser APIs in redux.

Assuming that you have the react project structured in your own way, I’d create a new folder named redux inside the src/app folder:

Setup a Wireguard VPN Server on Ubuntu

This tutorial is going to show you how to set up your own WireGuard VPN server on Ubuntu.

WireGuard is made specifically for the Linux kernel. It runs inside the Linux kernel and allows you to create fast, modern, and secure VPN tunnel.

TL;DR

Prerequisites

This tutorial assumes that the VPN server and VPN client are both going to be running on Ubuntu 20.04 operating system.

Setting Up the WireGuard Server

Install Wireguard from the default Ubuntu repository: