Skip to content

Instantly share code, notes, and snippets.

View royki's full-sized avatar
😃
I may be slow to respond.

ROY royki

😃
I may be slow to respond.
View GitHub Profile
@royki
royki / Raft
Created January 12, 2021 00:05
Consensus Algorithm
- Consensus Algoriithm must have -
- Agreement -> Where every correct process must agree on the same value.
- Validity -> The value agreed on must have been proposed by another process.
- Termination -> A value will eventually be decided by every correct process.
- CAP Theorem -> An algorithm cannot provide more than of the three following properties -
- Consistency
- Availability
- Partition Tolerance
- There are different types of failure that a consensus algorithm might have to deal with fail.
- Fail-stop
@royki
royki / Bash.md
Created January 11, 2021 22:42
Bash Tricks
@royki
royki / Playground.hs
Last active July 25, 2020 12:04
Plutus Playground Smart Contract
-- Crowdfunding contract implemented using the [[Plutus]] interface.
-- This is the fully parallel version that collects all contributions
-- in a single transaction.
--
-- Note [Transactions in the crowdfunding campaign] explains the structure of
-- this contract on the blockchain.
import qualified Language.PlutusTx as PlutusTx
import Language.PlutusTx.Prelude
@royki
royki / fdisk.md
Last active November 29, 2020 19:31
Increase partition size in Ubuntu

➜ ~ sudo fdisk /dev/sda

Welcome to fdisk (util-linux 2.34).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): p
Disk /dev/sda: 24.42 GiB, 26214400000 bytes, 51200000 sectors
@royki
royki / .tmux.conf
Created April 8, 2020 21:26
Tmux Conf file
# Send prefix
set-option -g prefix C-a
unbind-key C-a
bind-key C-a send-prefix
# Use Alt-arrow keys to switch panes
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
@royki
royki / shell-zsh-key.md
Last active February 29, 2020 18:34
Shelll/Zsh key short cut
  • Beginning of a line ctrl + a
  • End of a line ctrl + e
  • Delete entire line(zsh) or delete(shell) words where the cursor places ctrl + u
  • Delete word before the cursor ctrl + w
  • Delete word after the cursor alt + d
  • Paste line/word ctrl + y
  • Swap 2 chars of a word ctrl + t and move at the end.
  • Swap 2 words esc + t
  • Capitalize a word alt + u. Decapitalize a word(shell) alt + l, in zsh it binds with ls
  • Execute last command !!
@royki
royki / kubectl.md
Last active July 15, 2021 01:48
Kubernetes Command

kubectl (command in default namespace)

  • kubectl version
  • kubectl api-versions
  • kubectl cluster-info & kubectl cluster-info dump
  • kubectl get namespace
  • kubectl get all
  • kubectl get cs or
  • kubectl get nodes
  • kubectl describe nodes
@royki
royki / grub.md
Last active July 11, 2023 03:40
GRUB Command or Recovery
  • In legacy GRUB the default is /boot/grub/menu.list
  • In GRUB2 the default is /boot/grub/grub.cfg
  • We mainly edit /etc/default/grub, which controls mainly the appearance of the GRUB menu.
  • We may also edit the scripts in /etc/grub.d/
  • These are the scripts that boot your operating systems, control external applications such as memtest & os_prober
  • theming./boot/grub/grub.cfg is built from /etc/default/grub & /etc/grub.d/*
  • update-grub
  • grub> prompt, that is the full GRUB 2 command shell.
  • GRUB2 started normally and loaded the normal.mod module other modules which are located in /boot/grub/[arch]/
  • If GRUB2 didn’t find grub.cfg file then, grub rescue> is prompted that means it couldn’t find normal.mod, so it probably couldn’t find any of the boot files.
@royki
royki / LinuxCommand.md
Last active July 11, 2023 03:38
Linux Administration
  • Users are on the system are listed in an alphabetical order - cut /etc/passwrd -d":" -f1 | sort
  • User has shell access - cat /etc/passwd | cut -d":" -f4,5,6,7 | grep "^0" or count - cat /etc/passwd | cut -d":" -f4 | grep "^0" | wc -l
  • Export the Users' list to a file - cut /etc/passwd -d ":" -f1 > system_users.txt
  • Count the number of Users - cat ./system_users.txt | sort | wc –l
  • Compare - cat ./system_users.txt - cut /etc/passwd -d ":" -f1 > system_users002.txt && cat system_users002.txt | sort | wc -l
  • Diff - diff ./system_users.txt ./system_users002.txt
  • how many words begin with the letter a from the main user dictionary - egrep '^a.*$' /usr/share/dict/words | wc -l
  • tee to both view and write files and directories in /etc - ls -d /etc/a* | tee ./etc_report_a.txt
  • Kernel Info - lsb_release -a or uname -a or hostnamectl or cat /proc/os-release
AWS Fargate allows you to run containers without worrying about provisioning or managing the underlying infrastructure, like Amazon EC2 instances.
It is a fully managed service, and is therefore inherently highly available and highly scalable.
When using AWS Fargate, you use container orchestration tools to define what containers you want to run, like Amazon Elastic Container Service or Amazon Elastic Kubernetes Service.
Once your containers are defined, you can launch them onto an AWS Fargate cluster.
There is no need to bring up the cluster on your own, AWS Fargate will handle the provisioning and management of the resources needed to run those containers.
AWS Fargate is the serverless compute launch type you can use with Amazon Elastic Container Service or Amazon Elastic Kubernetes Service.