Skip to content

Instantly share code, notes, and snippets.

@mzaidannas
mzaidannas / ubuntu_setup.sh
Last active October 4, 2023 10:52
Ubuntu Initial Setup
#!/usr/bin/env bash
# Configure some system specifications
sudo usermod -G input -a $USER
# Max number of files (Required by services like docker/jvm)
sudo sysctl -w fs.inotify.max_user_watches=524288
sudo sysctl -w vm.max_map_count=262144
# Better swap if system have a lot of unused memory
sudo sysctl -w vm.swappiness=10
sudo sysctl -w vm.vfs_cache_pressure=100
@mzaidannas
mzaidannas / VPS rails server setup.md
Created June 25, 2020 06:37 — forked from ziaulrehman40/VPS rails server setup.md
Server setup on ubuntu VPS(DigitalOcean, EC2 or any other) for rails

Excellent GoRails Article(which is main source for this guide too). I did benefited from lot of other resources online as well.

Creating droplet on DigitalOcean(DO):

(Skip this if you are not using DO, and create your own VPS instance on the service of your choice. Steps below may still be helpful.)

There are few options for this step, DO provide us some pre built images for lot of platforms in which they have pre-installed nginx, node and other related dependencies for each image. Rails one is little outdated, I tried that but didn't go very well for me, you can give it a shot if you have enough time. For this guide we will go with bear bone ubuntu 18.04 server. While creating the droplet, you will be asked to set an ssh key, just generate an ssh key with ssh-keygen on your local system and copy contents of .pub file into the textbox provided.

@mzaidannas
mzaidannas / setup_zsh.zsh
Last active March 25, 2021 05:31
Setup ZSH plugins, theme and fonts
#!/usr/bin/env zsh
# Download required fonts to user font path
mkdir -p ~/.local/share/fonts
curl -fsSL https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/FiraCode/Retina/complete/Fira%20Code%20Retina%20Nerd%20Font%20Complete.ttf -o "${HOME}/.local/share/fonts/Fira Code Retina Nerd Font Complete.ttf"
curl -fsSL https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/FiraCode/Bold/complete/Fira%20Code%20Bold%20Nerd%20Font%20Complete.ttf -o "${HOME}/.local/share/fonts/Fira Code Bold Nerd Font Complete.ttf"
curl -fsSL https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/FiraCode/Light/complete/Fira%20Code%20Light%20Nerd%20Font%20Complete.ttf -o "${HOME}/.local/share/fonts/Fira Code Light Nerd Font Complete.ttf"
curl -fsSL https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/FiraCode/Medium/complete/Fira%20Code%20Medium%20Nerd%20Font%20Complete.ttf -o "${HOME}/.local/share/fonts/Fira Code Medium Nerd Font Complete.ttf"
curl -fsSL https://github.com/ryanoasis/nerd-fo
@mzaidannas
mzaidannas / better_cmd_tools.sh
Last active September 18, 2023 07:17
Better Command Line tools
#!/usr/bin/env bash
# Install common tools and utilities
sudo apt install -y unace unrar zip unzip p7zip-full p7zip-rar sharutils rar uudeview mpack arj cabextract
# Install build tools and programming languages
sudo apt install -y build-essential git git-lfs gitk openssl python3 python3-setuptools python3-pip python3-gi libssl-dev resolvconf default-jre default-jdk llvm clang clang-tools lldb lld cmake gradle nodejs ruby ruby-build rust-all golang
# Configure some system specifications
@mzaidannas
mzaidannas / elasticsearch_nfs.md
Last active April 22, 2022 07:50
Elasticsearch cluster setup with NFS data directory

Installing an Elasticsearch Cluster

As always, there are multiple ways of setting up an Elasticsearch cluster. In this case, we will be manually setting up a cluster consisting of one master node and two data nodes, all on Ubuntu 18.04 instances on AWS EC2 running in the same VPC. The security group was configured to enable access from anywhere using SSH and TCP 5601 (Kibana).


Installing Java

@mzaidannas
mzaidannas / rails_elastic.md
Last active June 4, 2020 00:48
Full Text searching setup using elasticsearch

Searching with elasticsearch

In this tutorial we are going to setup Elasticsearch and it's integration with rails. We will be using Searchkick gem for rails integration

Installing Elasticsearch

Make sure you already have openjdk10 or greater

MacOS

brew tap adoptopenjdk/openjdk
@mzaidannas
mzaidannas / Best Rolling Release Distros.md
Created April 24, 2019 14:54
Best Linux Rolling Release Distros

Best Rolling Release Linux Distributions

Rolling Release linux are those which once not based on a yearly release cycle. Once you update the packages, you have the latest version of that distribution. No need to upgrade system to next version.

Solus

Solus Budgie

Key features

  • Not based on any base distro(Debian, Arch)
@mzaidannas
mzaidannas / Visual Studio Code Extensions.md
Last active June 11, 2020 11:11
Visual Studio Code Extensions

General

  1. Bookmarks
  2. List item
  3. change-case
  4. Code Runner
  5. Code Spell Checker
  6. DotENV
@mzaidannas
mzaidannas / Android Power Tools.md
Last active October 6, 2018 09:14
Android Power Tools

Android Power Tools

  1. Systemless Root and modules installer. Bypasses google sceurity checks
  2. Various system modification modules. Requires root (can be installed as magisk module)
  3. Most comprehensive audio effects/modification app. (can be installed as magisk module)
@mzaidannas
mzaidannas / Simple Docker Setup with Rails+Nginx+Redis+Postgres.md
Last active March 26, 2024 19:55
Simple Docker Setup with Rails+Nginx+Redis+Postgres.md

Typical rails setup with docker+puma+nginx+postgres

Zaid Annas

Devsinc inc. 30/08/2018

Overview