Linux things You must know

Some Cool Linux Uber-cool things I learned this year


i3wm

Starting with i3wm, I know its not a new thing out there in the open source market but still I see many people suffering in managing their task management thing. So here we start with i3 Window Manager.

Platform Availability:

Available for various Linux sweet flavors.


Stable Version: [Click here]
Download Link : [Click here]


or install using Cli.

sudo apt install i3

Setting up i3wm

As of now, I won’t be mentioning the steps which I used in setting up my i3wm but will share resources which are really good to start with and believe me they are really good even I started with these resources only. I will also be sharing complete layman written documentation of my own on setting up i3wm.

Resource 1 (Code Cast): Watch here

Notes:
1. Watch carefully each step and would recommend having patience and trying the steps shown in the tutorial again and again in case you find yourself stuck somewhere.
2. Don’t try to copy and paste someone else i3 dotfiles as it might mess your entire Linux environment because there may be different dependencies or tools installed while writing those dotfiles.

Resource 2(i3wm docs): Read here

Resource 3(Docs Links): Read here
Read here

Running your application Inside Linux Containers

We all use application, tools or say softwares in our linux OS but what if we somehow run everything inside linux containers which will provide isolation, save memory and a lot of other things.

If you don’t get it then say running each application virtually or say in virtual machines. The only difference will be that it will be linux container technology instead of virtual machines. If you want to learn the difference between container technology and Virtual machines, I recommend reading my gitbook page where I have explained with pictorial example.

Click me

Okay I hope you read it and understand what we are dealing with now.

Motivation: Jessie Frazelle - Dockercon SF 2015

well thats true I got motivated to use everything inside containers just after I saw Jessie Frazelle giving her talk Container Hacks and Fun Images.

How To:

Wireshark in Container

Steps:

First of all we need to write dockerfunctions which on called will run container. Either you can write your own or you may use Jessie Frazzle github repo where she has created various functions under .dockerfunc file for different software and services.

Clone the repo Clone and then move .dockerfunc to home directory
Change diretory to cloned directory which in this case will be dotfiles

mv .dockerfunc /home/${USER}

It will move .dockerfunc to logged user home directory.

Now open Bashrc file i.e, .bashrc

cd ~
nano .bashrc

and paste the following code at the end of .bashrc file before unset file.

for file in ~/.{dockerfunc}; do
if [[ -r "$file" ]] && [[ -f "$file" ]]; then
	source "$file"
fi
done

Now try to run the container for example wireshark or any other software or service defined in .dockerfunc file. NOTE that sometimes it gives error for incorrect username and Password in that case just login again to docker into your CLI

docker login

Note: First when you run any service, it will first download the container image locally so that it can store it into local image repository for lator use.

Everytime you run a new service, it will fetch images from jess Docker repo. You may also download all the dockerFiles written by Jessie Frazzle and can build images again and push to your own DockerHub repo to make it do a pull from your repo.

But I would recommend contributing to Jessie Frazzle repo.

Download DockerFiles from Here

You are all set, now just run application or service available or say written inside .dockerfunc. Also contribute to Jessie Frazzle repo to add more docker function of tools and services which should be run in container and are missing from the .dockerfunc file.

Linux Commands

Use of Aliases to make things short and to save more time.

Example:

alias h="history"
alias update="sudo apt update"

Now what you can do is to write all the shortform name or say aliases of commands which you want to and save it inside .bashrc file.

You might also give a look at Jessie Frazzle aliases file for better examples and use.

Alias dotfile

create a file in your user home directory named .aliases

cd ~
nano .aliases

and paste all the content from this github file

Now open .bashrc file and at the end add aliases in the for loop we created while playing with linux containers.

for file in ~/.{dockerfunc,aliases}; do
if [[ -r "$file" ]] && [[ -f "$file" ]]; then
	source "$file"
fi
done

You are all done to use aliases for commands which you feel take your time.

zsh

It is a open source project or say framework to add themes to your terminal or increase it capabilities

Some cool themes of this framework are:

Ohmyz.sh

In order to install it, you may follow these below mentioned resources.

Resources 1: Install Ohmyzsh

Resource 2: Installation Guide

Note

It does not end here, I have so many other things on my plate which I will keep adding lator on