Skip to content

Instantly share code, notes, and snippets.

View webgtx's full-sized avatar
😃
soft wrap users, what is it like to watch a tennis match in a fullscreen editor?

Alex Zolotarov webgtx

😃
soft wrap users, what is it like to watch a tennis match in a fullscreen editor?
View GitHub Profile
@webgtx
webgtx / kubernetes.repo
Created September 24, 2023 02:09
rpm kubernetes repository
[kubernetes]
name=Kubernetes
baseurl=https://pkgs.k8s.io/core:/stable:/v1.28/rpm/
enabled=1
gpgcheck=1
gpgkey=https://pkgs.k8s.io/core:/stable:/v1.28/rpm/repodata/repomd.xml.key
@webgtx
webgtx / cs101.md
Created September 16, 2023 22:29
Computer Science 101

Everything you need to know is...

  1. Turing Machine
  2. CPU
  3. Transistors
  4. Bit
  5. Byte
  6. Ascii Character Encoding
  7. Binary
  8. Hexadecimal
@webgtx
webgtx / end.c
Created September 8, 2023 04:14
Error and Die - Simple function to exit the program with error code
#include <stdarg.h>
// END - Error and Die
void end(const char *fmt, ...) {
va_list ap;
va_start(ap, fmt);
vfprintf(stdout, fmt, ap);
fprintf(stdout, "\n");
fflsuh(stdout);
va_end(ap);

TCP socket Error Codes

Code Description
0 Success
1 Operation not permitted
2 No such file or directory
3 No such process
4 Interrupted system call
5 Input/output error
@webgtx
webgtx / insecurypodmanregistry.md
Created August 10, 2023 17:51
How to access podman registry using http only

The next component to look at is the system-wide registries configuration file. On my system, that file resides at /etc/containers/registries.conf. And I will show a somewhat redacted version of mine as an example:

# This is a system-wide configuration file used to
# keep track of registries for various container backends.
# It adheres to TOML format and does not support recursive
# lists of registries.

[registries.search]
registries = ['docker.io', 'registry.fedoraproject.org', 'registry.access.redhat.com']
@webgtx
webgtx / portainerpluspodman.md
Last active August 9, 2023 23:47
How to run portainer agent with podman

use Portainer with Podman:

Podman root context

First make sure to enable the Podman socket:

systemctl enable --now podman.socket

Run the Portainer agent in a Podman root environment:

podman run -d --privileged \
 -p 9001:9001 \
@webgtx
webgtx / pipforcereinstall.sh
Created August 9, 2023 01:15
python-pip force reinstall script
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3 get-pip.py --force-reinstall
@webgtx
webgtx / eipninstance.tf
Created July 26, 2023 20:48
Attaching an EIP to an Instance with a pre-assigned private ip (VPC Only) [AWS]
resource "aws_vpc" "default" {
cidr_block = "10.0.0.0/16"
enable_dns_hostnames = true
}
resource "aws_internet_gateway" "gw" {
vpc_id = aws_vpc.default.id
}
resource "aws_subnet" "tf_test_subnet" {
@webgtx
webgtx / tfadv.md
Last active August 10, 2025 21:17
Terraform Pros and Cons.

Terraform is a popular infrastructure as code (IaC) tool used to provision and manage cloud resources from various providers like Amazon Web Services (AWS), Microsoft Azure, Google Cloud Platform (GCP), and others. It allows users to define infrastructure configurations in a declarative manner, making it easier to manage and automate the deployment process. Let's explore some of the advantages and disadvantages of using Terraform:

Advantages of Terraform:

  1. Infrastructure as Code (IaC): Terraform enables you to define your infrastructure in code, making it versionable, maintainable, and easier to collaborate on with other team members. This brings many benefits like reproducibility, consistency, and easier rollbacks.

  2. Multi-Cloud Support: Terraform provides a unified way to manage infrastructure across multiple cloud providers. This allows organizations to avoid vendor lock-in and leverage the best features of different cloud platforms.

  3. Declarative Syntax: Terraform uses a declarative la

@webgtx
webgtx / instance-by-resources.tf
Created July 16, 2023 17:34
Sample resources for instance in terraform declared only by resources
data "template_file" "user_data" {
template = file("cloudinit/addpubkey.yml")
}
resource "aws_vpc" "mainvpc" {
cidr_block = "10.1.0.0/16"
}
resource "aws_internet_gateway" "gw" {
vpc_id = aws_vpc.mainvpc.id