Skip to content

Instantly share code, notes, and snippets.

View juanfdovilla's full-sized avatar
馃幆
Focusing

Juan F Villa juanfdovilla

馃幆
Focusing
View GitHub Profile
@juanfdovilla
juanfdovilla / gist:51953e96da6b2f5c9506146761288b9c
Created February 10, 2025 22:08
How to Set Up UFW Firewall on Ubuntu 24.04
How to Set Up UFW Firewall on Ubuntu 24.04
HomeUbuntuHow to Set Up UFW Firewall on Ubuntu 24.04
Christian Wells
February 5, 2025
No Comment
UFW (Uncomplicated Firewall) is a user-friendly firewall management tool for Linux systems, particularly designed to simplify the use of iptables. It is the default firewall configuration tool for Ubuntu and many other Debian-based distributions, providing an intuitive way to manage firewall rules without dealing with complex iptables commands.
Key Features of UFW
@juanfdovilla
juanfdovilla / gist:fe22a97f973fa9bc94620b53d3b3a1dd
Created February 10, 2025 22:07
How to Add Swap Memory in Ubuntu 24.04
How to Add Swap Memory in Ubuntu 24.04
HomeUbuntuHow to Add Swap Memory in Ubuntu 24.04
Christian Wells
February 5, 2025
No Comment
Swap memory (or swap space) is a dedicated portion of storage (disk or SSD) used by an operating system to temporarily hold data when physical RAM (Random Access Memory) is full. It acts as a backup for RAM, ensuring that the system can continue running smoothly even when memory demand exceeds available physical memory.
Key Features of Swap Memory
@juanfdovilla
juanfdovilla / gist:c244fbaae692e6016eb0edf8f8497598
Created February 10, 2025 22:06
Update the timezone System
Step 3: Update the System
Before making any changes, it鈥檚 a good practice to update your system to ensure all packages are up to date. Run the following command:
apt update
Step 4: Check Current Timezone
Check the current timezone settings on your server:
timedatectl
This command will display the current timezone along with other time and date information.
@juanfdovilla
juanfdovilla / gist:e9d7d0623f2700737e4d7fd971d0b594
Created February 10, 2025 22:04
Self-Hosting Guide - Debian/Ubuntu server Jitsi
Self-Hosting Guide - Debian/Ubuntu server
Follow these steps for a quick Jitsi-Meet installation on a Debian-based GNU/Linux system. The following distributions are supported out-of-the-box:
Debian 10 (Buster) or newer
Ubuntu 22.04 (Jammy Jellyfish) or newer (Ubuntu 18.04 or 20.04 can be used, but Prosody must be updated to version 0.11+ before installation)
note
Many of the installation steps require root or sudo access. So it's recommended to have sudo/root access to your system.
Required packages and repository updates
You will need the following packages:
@juanfdovilla
juanfdovilla / gist:12a59997d59f8f960b154a46fae977bd
Created February 10, 2025 22:02
How to Add Elements to an Array in Python
How to Add Elements to an Array in Python
HomePythonHow to Add Elements to an Array in Python
Christian Wells
December 1, 2023
No Comment
鈥岮rrays are essential data structures in programming that allow you to store and manipulate collections of values. In Python, there are different modules and methods available to add elements to an array. Whether you鈥檙e working with the built-in array module or the powerful NumPy module, this article will guide you through the process of adding elements to an array in Python.
@juanfdovilla
juanfdovilla / gist:dfb1c452923011b1316d10cdbe4a94bd
Created February 10, 2025 22:02
Dictionary in Python: A Comprehensive Guide
Dictionary in Python: A Comprehensive Guide
HomePythonHow to Add to a Dictionary in Python: A Comprehensive Guide
Christian Wells
December 2, 2023
No Comment
鈥峆ython dictionaries are an essential data type that allows you to store and retrieve data in key-value pairs. They are mutable objects, meaning that you can modify them after creation. In this article, we will explore various methods to add and update Python dictionaries, including the assignment operator, the update() method, the merge operator, and the update |= operator. By the end of this guide, you will have a solid understanding of how to expand the capabilities of your dictionaries and optimize your Python code.
@juanfdovilla
juanfdovilla / gist:9f1ae0cabdaf36b747467fdf2ce11523
Created February 10, 2025 22:00
A Comprehensive Guide to Implementing Stacks in Python
A Comprehensive Guide to Implementing Stacks in Python
HomePythonA Comprehensive Guide to Implementing Stacks in Python
Christian Wells
December 19, 2023
No Comment
鈥岻n the world of computer science and programming, data structures play a crucial role in organizing and manipulating data efficiently. One such data structure is a stack, which is widely used for its convenient last-in-first-out (LIFO) behavior. In this comprehensive guide, we will explore the concept of stacks, understand their implementation in Python, and discuss different methods of creating and using stacks effectively. So, whether you are a beginner or an experienced developer, this article will equip you with the knowledge and tools to implement stacks in Python.
@juanfdovilla
juanfdovilla / gist:2c57a34462afbb76b6b7f3f93c8be92f
Created February 10, 2025 21:59
Run a Python Script: A Comprehensive Guide
Run a Python Script: A Comprehensive Guide
HomePythonHow to Write and Run a Python Script: A Comprehensive Guide
Christian Wells
December 19, 2023
No Comment
Python is a versatile and widely-used programming language known for its simplicity, readability, and extensive library support. Whether you鈥檙e a beginner or an experienced programmer, understanding the basics of Python scripting is essential. In this comprehensive guide, we will explore the fundamental concepts of Python, including how to install and use Python modules, write and run Python scripts, and utilize common control structures, data structures, functions, and methods. So, let鈥檚 dive in and learn how to write and run a Python script!
1. Understanding How Python Works
@juanfdovilla
juanfdovilla / gist:f5fd33095e181413c1c80ae9ec50b49f
Created February 10, 2025 21:58
Convert Data Types in Python: A Comprehensive Guide
Convert Data Types in Python: A Comprehensive Guide
HomePythonConvert Data Types in Python: A Comprehensive Guide
Christian Wells
December 29, 2023
No Comment
鈥峆ython is a powerful programming language known for its flexibility and ease of use. One of its key features is dynamic typing, which allows programmers to create variables without explicitly declaring their data types. While dynamic typing offers convenience, there are situations where it becomes necessary to convert data from one type to another. This guide will walk you through the process of typecasting in Python, covering various examples to help you master this essential skill.
@juanfdovilla
juanfdovilla / gist:5d320f2d515c2873cca8de8fdfd89fcc
Created February 10, 2025 21:58
How to Reverse a String in Python: A Comprehensive Guide
How to Reverse a String in Python: A Comprehensive Guide
HomePythonHow to Reverse a String in Python: A Comprehensive Guide
Christian Wells
December 29, 2023
No Comment
Python is a powerful programming language that offers a wide range of string manipulation capabilities. While it provides several common string operations like slicing, indexing, and advanced formatting, it lacks a dedicated, built-in method for reversing strings. However, Python鈥檚 tools for working with sequences allow us to reverse a string effectively. In this comprehensive guide, we will explore five different ways to reverse a string in Python, providing you with the knowledge to choose the most efficient approach for your needs.
Method 1: Using Slicing