Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View AkashRajvanshi's full-sized avatar
😎
DevOps

Akash Rajvanshi AkashRajvanshi

😎
DevOps
View GitHub Profile
@AkashRajvanshi
AkashRajvanshi / docker_interview_question.md
Created May 12, 2022 05:47 — forked from bansalankit92/docker_interview_question.md
Docker interview questions and answers all level

What is Hypervisor?

A hypervisor is a software that makes virtualization possible. It is also called Virtual Machine Monitor. It divides the host system and allocates the resources to each divided virtual environment. You can basically have multiple OS on a single host system. There are two types of Hypervisors:

  • Type 1: It’s also called Native Hypervisor or Bare metal Hypervisor. It runs directly on the underlying host system. It has direct access to your host’s system hardware and hence does not require a base server operating system.
  • Type 2: This kind of hypervisor makes use of the underlying host operating system. It’s also called Hosted Hypervisor.

What is virtualization?

Virtualization is the process of creating a software-based, virtual version of something(compute storage, servers, application, etc.). These virtual versions or environments are created from a single physical hardware system. Virtualization lets you split one system into many different sections which act like separ

Questions are not from any actual exam!!!
Q: Create a job that calculates pi to 2000 decimal points using the container with the image named perl
and the following commands issued to the container: ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"]
Once the job has completed, check the logs to and export the result to pi-result.txt.
Solution:
@AkashRajvanshi
AkashRajvanshi / generate-ssh-key.sh
Created March 28, 2021 07:13 — forked from grenade/01-generate-ed25519-ssh-key.sh
Correct file permissions for ssh keys and config.
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/id_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/github_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/mozilla_rsa
@AkashRajvanshi
AkashRajvanshi / multiple_ssh_setting.md
Created March 5, 2021 11:15 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@AkashRajvanshi
AkashRajvanshi / postgres-dump-restore.markdown
Created June 9, 2020 08:08 — forked from jeremykendall/postgres-dump-restore.markdown
PostgreSQL: dump and restore (to db with different name and roles even)

Postgres Export and Import

Export

pg_dump -U [superuser] -Fc [dbname] > db.dump

Import

@AkashRajvanshi
AkashRajvanshi / mysql-docker.sh
Created June 6, 2020 05:22 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@AkashRajvanshi
AkashRajvanshi / run_RPI4B_from_SSD.md
Created June 2, 2020 07:43
Run a Raspberry Pi 4B from an SSD connected to a USB-3 port

Run Raspberry Pi 4 from SSD

Introduction

This gist builds on the excellent work done by Graham Garner, Andreas Spiess, and Peter Scargill to make it easy for Makers to install IOTstack on a Raspberry Pi.

One concern with any out-of-the-box Raspberry Pi is the limited lifespan of its SD card. You'd be pretty annoyed if you got your IOTstack up and running, only to find that you were one of the unlucky ones whose SD card wore out in less than six months!

SSDs, on the other hand, while not immune to the same kinds of failure, tend to have projected life expectancies in the hundreds of years.

= Arch Linux step-by-step installation =
= http://blog.fabio.mancinelli.me/2012/12/28/Arch_Linux_on_BTRFS.html =
== Boot the installation CD ==
== Create partition ==
cfdisk /dev/sda
* Create a partition with code 8300 (Linux)

Arch Linux btrfs install

0. Prerequisites

  1. Latest Arch Linux install iso because those have newer kernels and more bugfixes in btrfs.
  2. Have previous experience with installing Arch (like you can install arch with a blind fold).

1. Parititions

We will ne two of them, one for /boot and the other one will be a btrfs partition with subvolumes.

  1. /dev/sda1 - this will be /boot with vfat filesystem because UEFI or syslinux for legacy BIOS boot