Skip to content

Instantly share code, notes, and snippets.

View vicradon's full-sized avatar
🥑
creating technical content

Osinachi Chukwujama vicradon

🥑
creating technical content
View GitHub Profile
@vicradon
vicradon / how-nginx-works.md
Last active June 6, 2024 09:03
How does Nginx Work?

How Nginx Works

Nginx works using configuration files. You define a configuration for a single site or all the sites in a machine and Nginx serves the content of that defined site. In the past, folks defined new sites in the /etc/nginx/sites-available and /etc/nginx/sites-enabled directories. These days, Nginx suggests that you use the conf.d directory. The default Nginx config serves the default Nginx page, i.e. welcome to Nginx. But you can easily replace it with something simple that reverse proxies your requests. Something like this:

http {
    server {
        listen 80;

 location / {
@vicradon
vicradon / python_ip_interfaces.py
Created May 25, 2024 20:05
This gist contains a python script that outputs IP addresses and assigned interfaces from a file generated by the command 'show ip interface brief'
def get_file_content(filelocation):
try:
with open(filelocation, "r") as file:
content = file.read()
return content
except FileNotFoundError:
print("The file was not found.")
except PermissionError:
print("Permission denied.")
except Exception as e:
@vicradon
vicradon / 0000-networking-notes.md
Last active May 30, 2024 07:40
Bunch of networking notes

Networking Notes

A bunch of notes about networking related concepts such as TCP/IP, DNS, BGP, OSPF, etc.

@vicradon
vicradon / 000-bunch-of-algo-solutions.md
Last active May 25, 2024 10:52
A bunch of Algo solutions

Bunch of Algo Solutions

This gist contains a bunch of algo solutions

Cisco IOS Images for GNS3

Working the CCNA exams with GNS3 software is a great way. But, you need Cisco IOS images for GNS3.

You can use many Cisco IOS images on GNS3, but most of them may be problematic.

I would recommend reading the related article to download Cisco IOS images running in GNS3.

Cisco IOS Images for GNS3

class Solution:
def removeElement(self, nums: List[int], val: int) -> int:
'''
while right pointer > left pointer
- check through from the right pointer
- move cursor to the left if the number there equals target
- else check through from the left pointer
- if number equals target, swap the left with the right
- move the left forward
@vicradon
vicradon / check-sorted-disk-usage.sh
Created May 9, 2024 15:32
Check the sorted disk usage of a particular directory on UNIX
du -cksh * | sort -hr
@vicradon
vicradon / download-images-and-replace-remote-urls.py
Created May 2, 2024 16:02
Download images and replace the previous remote URL with local URL
import requests
import os
from urllib.parse import urlparse
import re
def process_markdown(markdown_file):
"""
Analyzes a markdown file, downloads images (current folder), and replaces URLs.
Args:
@vicradon
vicradon / Setting-the-azure-subscription-for-an-azure-cli-session.md
Created March 28, 2024 11:47
How to list and set the current active subscription in an Azure CLI shell

Listing subscriptions

For an account, you can list the available subscriptions using the command below:

az account subscription list --output table

It should output something like: