Skip to content

Instantly share code, notes, and snippets.

View Dzhan85's full-sized avatar

Atadzhan Dzhan85

View GitHub Profile

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
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:

Top Questions for Sysadmin Interview:

Disclaimer: These questions and answers aren't at all mine. These were scavanged around in the web. I hope it helps.

Basic:
  1. What is Linux and also explain the basic components of Linux?

    Answer: Linux is the most commonly used operating system that is open source and free. For any computer, the operating system acts as the backbone, and it is most important software that is required for any computer.

@Dzhan85
Dzhan85 / Jenkinsfile
Created June 8, 2021 20:31 — forked from merikan/Jenkinsfile
Some Jenkinsfile examples
Some Jenkinsfile examples
@Dzhan85
Dzhan85 / postgres-cheatsheet.md
Created September 17, 2020 11:38 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@Dzhan85
Dzhan85 / firewall.iptables.txt.txt
Created August 13, 2020 07:36 — forked from anonymous/firewall.iptables.txt.txt
firewall.iptables.txt
echo "Обнуляем правила"
iptables -X
iptables -t nat -X
iptables -F
iptables -t nat -F
echo "Блокируем весь трафик"
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD DROP
@Dzhan85
Dzhan85 / net.sh
Created August 13, 2020 07:20 — forked from goffinet/net.sh
Centos7 router config iptables/ip6tables/ifcg-files
#!/bin/bash
ip4="192.168.168"
ip6="fd00:168:168"
lan="eth0"
wan="eth1"
1_interfaces () {
cat << EOF > /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="no"

IPTables setup for a Linux-based Router

The following script will set the router's firewall to reject every thing coming from the WAN, while forwarding all the traffic from LAN to WAN.

#!/bin/sh

PATH=/usr/sbin:/sbin:/bin:/usr/bin

WAN=enp2s0
@Dzhan85
Dzhan85 / Cheatsheet
Created June 12, 2020 09:43 — forked from PierreZ/Cheatsheet
CISCO Cheat sheet
#configuration of router
conf t
hostname ""
enable secret ""
line console 0
logging synchronous
password ""
login
exit
line vty 0 4
@Dzhan85
Dzhan85 / private-docker-regs-with-free-tiers.markdown
Created April 22, 2020 08:36 — forked from JakubOboza/private-docker-regs-with-free-tiers.markdown
Private Docker registry with free tiers for Developers.

List of sites with free tier limits

  • Docker Hub - One private repo/image spot for free
  • Three Scale - Very generous free tier 50GB of space, 500 Pulls a month etc..
  • Canister - 20 private repos with almost no limits on free tier
  • Code Fresh - Free tier for developers

Setup your own private registry