[{"categories":["Python"],"content":"UV tutorial part 1: use uv, a very fast Python package manager, in place of pip, pyenv, virtualenv, and conda in your existing workflow.","date":"2024-11-23","objectID":"/posts/uv-tutorial-1/","tags":null,"title":"UV Tutorial Part 1: Lightning-Fast Old-style Python Project Management with UV","uri":"/posts/uv-tutorial-1/"},{"categories":["Python"],"content":" Part 1: Lightning-Fast Oldstyle Python Project Management with UV Part 2: Creating and Managing Python Projects with UV Part 3: Installing PyTorch with CUDA ","date":"2024-11-23","objectID":"/posts/uv-tutorial-1/:0:0","tags":null,"title":"UV Tutorial Part 1: Lightning-Fast Old-style Python Project Management with UV","uri":"/posts/uv-tutorial-1/"},{"categories":["Python"],"content":"Introduction\rHey there! If you’re used to managing your Python projects with tools like pip, pyenv, virtualenv, or conda, I’ve got some exciting news for you. There’s a tool called uv (Universal Virtualenv) that’s going to revolutionize your workflow. It’s unbelievably fast – we’re talking 10-100x faster than pip. Let’s dive into how you can get started with uv and make your project management a breeze. ","date":"2024-11-23","objectID":"/posts/uv-tutorial-1/:1:0","tags":null,"title":"UV Tutorial Part 1: Lightning-Fast Old-style Python Project Management with UV","uri":"/posts/uv-tutorial-1/"},{"categories":["Python"],"content":"Installation Guide\rFirst things first, let’s get uv installed on your system. ","date":"2024-11-23","objectID":"/posts/uv-tutorial-1/:2:0","tags":null,"title":"UV Tutorial Part 1: Lightning-Fast Old-style Python Project Management with UV","uri":"/posts/uv-tutorial-1/"},{"categories":["Python"],"content":"Windows Installation\rIf you’re on Windows, open PowerShell and run: powershell -c \"irm https://astral.sh/uv/install.ps1 | iex\" ","date":"2024-11-23","objectID":"/posts/uv-tutorial-1/:2:1","tags":null,"title":"UV Tutorial Part 1: Lightning-Fast Old-style Python Project Management with UV","uri":"/posts/uv-tutorial-1/"},{"categories":["Python"],"content":"Linux/Mac Installation\rFor those using Linux or Mac, you can install uv with this command: curl -LsSf https://astral.sh/uv/install.sh | sh ","date":"2024-11-23","objectID":"/posts/uv-tutorial-1/:2:2","tags":null,"title":"UV Tutorial Part 1: Lightning-Fast Old-style Python Project Management with UV","uri":"/posts/uv-tutorial-1/"},{"categories":["Python"],"content":"Installing via pip\rAlternatively, you can install uv using pip: pip install uv ","date":"2024-11-23","objectID":"/posts/uv-tutorial-1/:2:3","tags":null,"title":"UV Tutorial Part 1: Lightning-Fast Old-style Python Project Management with UV","uri":"/posts/uv-tutorial-1/"},{"categories":["Python"],"content":"Keeping UV Updated\rTo keep uv up to date, simply run: uv self update ","date":"2024-11-23","objectID":"/posts/uv-tutorial-1/:2:4","tags":null,"title":"UV Tutorial Part 1: Lightning-Fast Old-style Python Project Management with UV","uri":"/posts/uv-tutorial-1/"},{"categories":["Python"],"content":"Python Version Management\rOne of the coolest features of uv is its ability to manage different Python versions effortlessly. To see the list of available Python versions, use: uv python list ","date":"2024-11-23","objectID":"/posts/uv-tutorial-1/:3:0","tags":null,"title":"UV Tutorial Part 1: Lightning-Fast Old-style Python Project Management with UV","uri":"/posts/uv-tutorial-1/"},{"categories":["Python"],"content":"Traditional Python Project Setup vs UV Approach\rLet’s compare the traditional way of setting up a Python project with the uv approach. ","date":"2024-11-23","objectID":"/posts/uv-tutorial-1/:4:0","tags":null,"title":"UV Tutorial Part 1: Lightning-Fast Old-style Python Project Management with UV","uri":"/posts/uv-tutorial-1/"},{"categories":["Python"],"content":"Traditional Method with virtualenv\rHere’s how you might traditionally set up a new Python project using pip and virtualenv: Create a new directory Create a virtual environment: virtualenv venv Activate the virtual environment: Linux: source .venv/bin/activate Windows: .\\venv\\Scripts\\activate Install packages: pip install requests Generate requirements: pip freeze \u003e requirements.txt Project Migration (Traditional)\rWhen you want to move your project to another machine, you typically: Copy the project directory Create a new virtual environment Install dependencies: pip install -r requirements.txt ","date":"2024-11-23","objectID":"/posts/uv-tutorial-1/:4:1","tags":null,"title":"UV Tutorial Part 1: Lightning-Fast Old-style Python Project Management with UV","uri":"/posts/uv-tutorial-1/"},{"categories":["Python"],"content":"Modern Approach with UV\rNow, let’s see how uv can simplify this process and make it much faster: Create a new directory Create a virtual environment: uv venv or uv venv --python 3.10 for a specific Python version Activate the virtual environment: Linux: source .venv/bin/activate Windows: .\\venv\\Scripts\\activate Install packages: uv pip install requests Generate requirements: uv pip freeze \u003e requirements.txt Project Migration with UV\rMoving your project to another machine with uv is a breeze: Copy the project directory Create a virtual environment: uv venv or uv venv --python 3.10 Install dependencies: uv pip sync requirements.txt ","date":"2024-11-23","objectID":"/posts/uv-tutorial-1/:4:2","tags":null,"title":"UV Tutorial Part 1: Lightning-Fast Old-style Python Project Management with UV","uri":"/posts/uv-tutorial-1/"},{"categories":["Python"],"content":"Converting Existing virtualenv to UV\rAlready using a traditional virtualenv? No problem! Converting it to uv is super simple: Navigate to your project directory with the existing virtual environment. Run: uv init to adopt the existing environment. Convert dependencies: uv add -r requirements.txt to create pyproject.toml and uv.lock files. ","date":"2024-11-23","objectID":"/posts/uv-tutorial-1/:5:0","tags":null,"title":"UV Tutorial Part 1: Lightning-Fast Old-style Python Project Management with UV","uri":"/posts/uv-tutorial-1/"},{"categories":["Python"],"content":"Key Benefits of UV\rTo sum it up, here are some key benefits of using uv: Significantly faster package installation Better dependency management Easy Python version control Seamless conversion from existing virtualenv setups ","date":"2024-11-23","objectID":"/posts/uv-tutorial-1/:6:0","tags":null,"title":"UV Tutorial Part 1: Lightning-Fast Old-style Python Project Management with UV","uri":"/posts/uv-tutorial-1/"},{"categories":["Python"],"content":"What’s Next?\rStay tuned for Part 2, where we’ll explore how to create new projects with uv, add packages, and manage your project like a pro. In part 3, we will talk installing PyTorch with CUDA. ","date":"2024-11-23","objectID":"/posts/uv-tutorial-1/:7:0","tags":null,"title":"UV Tutorial Part 1: Lightning-Fast Old-style Python Project Management with UV","uri":"/posts/uv-tutorial-1/"},{"categories":["Python"],"content":"UV tutorial part 2: create a new Python project with uv and manage its dependencies, step by step.","date":"2024-11-23","objectID":"/posts/uv-tutorial-2/","tags":null,"title":"UV Tutorial Part 2: Creating and Managing Python Projects with UV","uri":"/posts/uv-tutorial-2/"},{"categories":["Python"],"content":" Part 1: Lightning-Fast Oldstyle Python Project Management with UV Part 2: Creating and Managing Python Projects with UV Part 3: Installing PyTorch with CUDA ","date":"2024-11-23","objectID":"/posts/uv-tutorial-2/:0:0","tags":null,"title":"UV Tutorial Part 2: Creating and Managing Python Projects with UV","uri":"/posts/uv-tutorial-2/"},{"categories":["Python"],"content":"Creating a New Project\rLet’s start by creating a new project using Python 3.10. It’s super easy with uv. Just run the following command: uv init --python 3.10 project_name This command does a lot for you behind the scenes. It creates a new directory called project_name and sets up the necessary files and directories. Here’s what your project structure will look like: project_name/\r├── .git/\r├── .gitignore\r├── .python-version\r├── README.md\r├── pyproject.toml\r├── hello.py","date":"2024-11-23","objectID":"/posts/uv-tutorial-2/:1:0","tags":null,"title":"UV Tutorial Part 2: Creating and Managing Python Projects with UV","uri":"/posts/uv-tutorial-2/"},{"categories":["Python"],"content":"Adding Packages to Your Project\rNow, let’s add some packages to our project. Packages are the backbone of any Python project as they provide the functionality you need. To add new packages, simply run: uv add fastapi sqlalchemy alembic This command does the following: Creates a new virtual environment called venv. Installs the specified packages (fastapi, sqlalchemy, and alembic) in the virtual environment. Updates the pyproject.toml file with the new package information. Creates a uv.lock file, which records the exact versions of all dependencies. This ensures consistent installations across different environments and machines. If you need to add more packages later, you can do so easily: uv add uvicorn ","date":"2024-11-23","objectID":"/posts/uv-tutorial-2/:2:0","tags":null,"title":"UV Tutorial Part 2: Creating and Managing Python Projects with UV","uri":"/posts/uv-tutorial-2/"},{"categories":["Python"],"content":"Editing Your Main Python File\rLet’s edit the hello.py file to create a simple FastAPI application. Open hello.py and add the following code: from fastapi import FastAPI app = FastAPI() @app.get(\"/\") def main(): return \"hello from FastAPI\" if __name__ == \"__main__\": main() This code sets up a basic FastAPI application that returns a simple “hello from FastAPI” message when accessed. ","date":"2024-11-23","objectID":"/posts/uv-tutorial-2/:3:0","tags":null,"title":"UV Tutorial Part 2: Creating and Managing Python Projects with UV","uri":"/posts/uv-tutorial-2/"},{"categories":["Python"],"content":"Running Your Project\rTo see your application in action, let’s run the project. Use the following command: uv run uvicorn hello:app --port 8000 --reload This command starts a Uvicorn server on port 8000 with automatic reloading enabled. You can now open your web browser and go to http://localhost:8000 to see your FastAPI application in action. ","date":"2024-11-23","objectID":"/posts/uv-tutorial-2/:4:0","tags":null,"title":"UV Tutorial Part 2: Creating and Managing Python Projects with UV","uri":"/posts/uv-tutorial-2/"},{"categories":["Python"],"content":"Syncing Your Project\rWhen you’re done with your project and have pushed it to a Git repository, others can clone the repository and set it up easily. They just need to run: uv sync This command will create the virtual environment and install all the required packages listed in the uv.lock file. ","date":"2024-11-23","objectID":"/posts/uv-tutorial-2/:5:0","tags":null,"title":"UV Tutorial Part 2: Creating and Managing Python Projects with UV","uri":"/posts/uv-tutorial-2/"},{"categories":["Python"],"content":"Managing Dependencies\r","date":"2024-11-23","objectID":"/posts/uv-tutorial-2/:6:0","tags":null,"title":"UV Tutorial Part 2: Creating and Managing Python Projects with UV","uri":"/posts/uv-tutorial-2/"},{"categories":["Python"],"content":"Adding Optional Dependencies\rSometimes you might want to add optional dependencies. For example, to add httpx as an optional dependency under a group called network, run: uv add httpx --optional network This will update the pyproject.toml file and add httpx to the network group. ","date":"2024-11-23","objectID":"/posts/uv-tutorial-2/:6:1","tags":null,"title":"UV Tutorial Part 2: Creating and Managing Python Projects with UV","uri":"/posts/uv-tutorial-2/"},{"categories":["Python"],"content":"Adding Development Dependencies\rTo add development dependencies, such as pytest, use: uv add pytest --dev ","date":"2024-11-23","objectID":"/posts/uv-tutorial-2/:6:2","tags":null,"title":"UV Tutorial Part 2: Creating and Managing Python Projects with UV","uri":"/posts/uv-tutorial-2/"},{"categories":["Python"],"content":"Removing a Dependency\rTo remove a dependency, for example, sqlalchemy, run: uv remove sqlalchemy ","date":"2024-11-23","objectID":"/posts/uv-tutorial-2/:6:3","tags":null,"title":"UV Tutorial Part 2: Creating and Managing Python Projects with UV","uri":"/posts/uv-tutorial-2/"},{"categories":["Python"],"content":"Viewing the Dependency Tree\rTo see a detailed view of your project’s dependencies, use: uv tree This will output a tree view of all the packages and their dependencies. ","date":"2024-11-23","objectID":"/posts/uv-tutorial-2/:6:4","tags":null,"title":"UV Tutorial Part 2: Creating and Managing Python Projects with UV","uri":"/posts/uv-tutorial-2/"},{"categories":["Python"],"content":"Running Inline Scripts with Dependencies\rYou can also specify dependencies directly within your Python scripts. For instance, if you have a file test.py and it requires certain packages, you can add those dependencies at the top of the script: # /// script # requires-python = \"\u003e=3.13\" # dependencies = [ # \"requests\", # \"rich\", # ] # /// import requests from rich.pretty import pprint resp = requests.get(\"https://peps.python.org/api/peps.json\") data = resp.json() pprint([(k, v[\"title\"]) for k, v in data.items()][:10]) To run this script without installing the dependencies in your virtual environment, use: uv run test.py ","date":"2024-11-23","objectID":"/posts/uv-tutorial-2/:7:0","tags":null,"title":"UV Tutorial Part 2: Creating and Managing Python Projects with UV","uri":"/posts/uv-tutorial-2/"},{"categories":["Python"],"content":"Creating and Managing Virtual Environments\r","date":"2024-11-23","objectID":"/posts/uv-tutorial-2/:8:0","tags":null,"title":"UV Tutorial Part 2: Creating and Managing Python Projects with UV","uri":"/posts/uv-tutorial-2/"},{"categories":["Python"],"content":"Creating a Virtual Environment\rTo create a new virtual environment using uv, run: uv venv Or, if you need a specific Python version: uv venv --python 3.13 ","date":"2024-11-23","objectID":"/posts/uv-tutorial-2/:8:1","tags":null,"title":"UV Tutorial Part 2: Creating and Managing Python Projects with UV","uri":"/posts/uv-tutorial-2/"},{"categories":["Python"],"content":"Activating the Virtual Environment\rTo activate the virtual environment: On Windows: .venv\\Scripts\\activate On MacOS/Linux: source .venv/bin/activate ","date":"2024-11-23","objectID":"/posts/uv-tutorial-2/:8:2","tags":null,"title":"UV Tutorial Part 2: Creating and Managing Python Projects with UV","uri":"/posts/uv-tutorial-2/"},{"categories":["Python"],"content":"Installing Packages\rTo install a package in the virtual environment: uv pip install requests ","date":"2024-11-23","objectID":"/posts/uv-tutorial-2/:8:3","tags":null,"title":"UV Tutorial Part 2: Creating and Managing Python Projects with UV","uri":"/posts/uv-tutorial-2/"},{"categories":["Python"],"content":"Installing from requirements.txt\rIf you have a requirements.txt file, you can install all listed packages: uv pip install -r requirements.txt ","date":"2024-11-23","objectID":"/posts/uv-tutorial-2/:8:4","tags":null,"title":"UV Tutorial Part 2: Creating and Managing Python Projects with UV","uri":"/posts/uv-tutorial-2/"},{"categories":["Python"],"content":"Listing Installed Packages\rTo list all installed packages: uv pip list ","date":"2024-11-23","objectID":"/posts/uv-tutorial-2/:8:5","tags":null,"title":"UV Tutorial Part 2: Creating and Managing Python Projects with UV","uri":"/posts/uv-tutorial-2/"},{"categories":["Python"],"content":"Generating requirements.txt\rTo generate a requirements.txt file: uv pip freeze \u003e requirements.txt ","date":"2024-11-23","objectID":"/posts/uv-tutorial-2/:8:6","tags":null,"title":"UV Tutorial Part 2: Creating and Managing Python Projects with UV","uri":"/posts/uv-tutorial-2/"},{"categories":["Python"],"content":"Checking for Dependency Conflicts\rTo check for conflicts and missing dependencies: uv pip check That’s it! You’ve now learned how to create, manage, and run Python projects using uv. Happy coding! ","date":"2024-11-23","objectID":"/posts/uv-tutorial-2/:8:7","tags":null,"title":"UV Tutorial Part 2: Creating and Managing Python Projects with UV","uri":"/posts/uv-tutorial-2/"},{"categories":["Python"],"content":"UV tutorial part 3: install PyTorch with CUDA support in a uv-managed Python project without the usual dependency headaches.","date":"2024-11-23","objectID":"/posts/uv-tutorial-3/","tags":null,"title":"UV Tutorial Part 3: Installing PyTorch with CUDA","uri":"/posts/uv-tutorial-3/"},{"categories":["Python"],"content":" Part 1: Lightning-Fast Oldstyle Python Project Management with UV Part 2: Creating and Managing Python Projects with UV Part 3: Installing PyTorch with CUDA ","date":"2024-11-23","objectID":"/posts/uv-tutorial-3/:0:0","tags":null,"title":"UV Tutorial Part 3: Installing PyTorch with CUDA","uri":"/posts/uv-tutorial-3/"},{"categories":["Python"],"content":"Why Installing Torch with CUDA is Challenging\rInstalling PyTorch (torch) with CUDA can be quite challenging due to fact that CUDA installation often involves installing system-level dependencies, which can vary depending on the operating system. Managing these dependencies in a virtual environment adds another layer of complexity, especially when different projects require different versions. Even with conda, mamba, poetry this process is slow and challenging. Even with uv, you might face some challenges. While uv simplifies many aspects of project management, dealing with system-level dependencies like CUDA still requires careful handling. ","date":"2024-11-23","objectID":"/posts/uv-tutorial-3/:1:0","tags":null,"title":"UV Tutorial Part 3: Installing PyTorch with CUDA","uri":"/posts/uv-tutorial-3/"},{"categories":["Python"],"content":"Creating a New Project with UV\rFirst, let’s create a new project using uv: uv init --python 3.10 project_name Note: I couldn’t install torch using uv for Python 3.13, so we are using Python 3.10 here. ","date":"2024-11-23","objectID":"/posts/uv-tutorial-3/:2:0","tags":null,"title":"UV Tutorial Part 3: Installing PyTorch with CUDA","uri":"/posts/uv-tutorial-3/"},{"categories":["Python"],"content":"Entering the Project Directory\rNavigate to your project directory: cd project_name ","date":"2024-11-23","objectID":"/posts/uv-tutorial-3/:3:0","tags":null,"title":"UV Tutorial Part 3: Installing PyTorch with CUDA","uri":"/posts/uv-tutorial-3/"},{"categories":["Python"],"content":"Creating and Activating a Virtual Environment\rNow, create a virtual environment with uv: uv venv To activate the virtual environment on Windows: .venv\\Scripts\\activate Usually, uv doesn’t require you to activate the virtual environment. However, in this case, we need to activate it to ensure proper installation of torch with CUDA. ","date":"2024-11-23","objectID":"/posts/uv-tutorial-3/:4:0","tags":null,"title":"UV Tutorial Part 3: Installing PyTorch with CUDA","uri":"/posts/uv-tutorial-3/"},{"categories":["Python"],"content":"Installing Torch with CUDA\rVisit the PyTorch official website to get the installation command. We’ll slightly modify the command to install torch with CUDA: For Windows: uv pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124 For Linux, you can ignore the --index-url option: uv pip install torch torchvision torchaudio ","date":"2024-11-23","objectID":"/posts/uv-tutorial-3/:5:0","tags":null,"title":"UV Tutorial Part 3: Installing PyTorch with CUDA","uri":"/posts/uv-tutorial-3/"},{"categories":["Python"],"content":"Adding Packages to pyproject.toml\rTo add these packages to the pyproject.toml file: uv add torch torchvision torchaudio ","date":"2024-11-23","objectID":"/posts/uv-tutorial-3/:6:0","tags":null,"title":"UV Tutorial Part 3: Installing PyTorch with CUDA","uri":"/posts/uv-tutorial-3/"},{"categories":["Python"],"content":"Verifying the Installation\rTo check if torch is installed with CUDA, let’s create a new Python file hello.py: import torch print(torch.cuda.is_available()) Run the file to verify: uv run hello.py If the output is True, then torch is successfully installed with CUDA. ","date":"2024-11-23","objectID":"/posts/uv-tutorial-3/:7:0","tags":null,"title":"UV Tutorial Part 3: Installing PyTorch with CUDA","uri":"/posts/uv-tutorial-3/"},{"categories":["Python"],"content":"Uninstalling Torch\rIf you need to uninstall torch, you can do so with: uv pip uninstall torch torchvision torchaudio To remove it from the pyproject.toml file: uv remove torch torchvision torchaudio This concludes the third part of the UV tutorial. You’ve learned how to handle the installation of complex packages like PyTorch with CUDA using uv. Happy coding!— ","date":"2024-11-23","objectID":"/posts/uv-tutorial-3/:8:0","tags":null,"title":"UV Tutorial Part 3: Installing PyTorch with CUDA","uri":"/posts/uv-tutorial-3/"},{"categories":["Linux"],"content":"Tmux guide and cheat sheet: keep remote server sessions running for days after you close your terminal, with key commands and shortcuts.","date":"2024-06-17","objectID":"/posts/tmux-guide-and-cheat-sheet/","tags":null,"title":"How to Keep Remote Servers Running with Tmux for Days Even If You Close Your Terminal","uri":"/posts/tmux-guide-and-cheat-sheet/"},{"categories":["Linux"],"content":"Tmux is a powerful terminal multiplexer that allows you to manage multiple terminal sessions within a single window. This capability is incredibly useful for keeping remote servers running for days, even if you close your terminal. In this cheat sheet, we’ll cover essential commands and keyboard shortcuts to help you get started with Tmux. ","date":"2024-06-17","objectID":"/posts/tmux-guide-and-cheat-sheet/:0:0","tags":null,"title":"How to Keep Remote Servers Running with Tmux for Days Even If You Close Your Terminal","uri":"/posts/tmux-guide-and-cheat-sheet/"},{"categories":["Linux"],"content":"Why Tmux is Useful\rRun and manage multiple terminal sessions within a single window. Easily switch between them using keyboard shortcuts. Detach from a session and reattach later to pick up right where you left off. Keep processes running even after you close your terminal, ensuring uninterrupted server tasks. ","date":"2024-06-17","objectID":"/posts/tmux-guide-and-cheat-sheet/:1:0","tags":null,"title":"How to Keep Remote Servers Running with Tmux for Days Even If You Close Your Terminal","uri":"/posts/tmux-guide-and-cheat-sheet/"},{"categories":["Linux"],"content":"Installation\r","date":"2024-06-17","objectID":"/posts/tmux-guide-and-cheat-sheet/:2:0","tags":null,"title":"How to Keep Remote Servers Running with Tmux for Days Even If You Close Your Terminal","uri":"/posts/tmux-guide-and-cheat-sheet/"},{"categories":["Linux"],"content":"Ubuntu\rsudo apt-get update sudo apt-get install tmux ","date":"2024-06-17","objectID":"/posts/tmux-guide-and-cheat-sheet/:2:1","tags":null,"title":"How to Keep Remote Servers Running with Tmux for Days Even If You Close Your Terminal","uri":"/posts/tmux-guide-and-cheat-sheet/"},{"categories":["Linux"],"content":"Creating and Managing Sessions\rCreate a New Session tmux new -s session_name To attach to an existing session: tmux a -t session_name To kill a session: tmux kill-session -t session_name To list all sessions: tmux ls To exit a session: exit ","date":"2024-06-17","objectID":"/posts/tmux-guide-and-cheat-sheet/:3:0","tags":null,"title":"How to Keep Remote Servers Running with Tmux for Days Even If You Close Your Terminal","uri":"/posts/tmux-guide-and-cheat-sheet/"},{"categories":["Linux"],"content":"Keyboard Shortcuts\rNote: To use these shortcuts, press Ctrl+b first, release it, and then press the corresponding key. Ctrl-b % - Split the current pane vertically. Ctrl-b \" - Split the current pane horizontally. Ctrl-b arrow - Move between panes. Ctrl-b c - Create a new window. Ctrl-b n - Move to the next window. Ctrl-b p - Move to the previous window. Ctrl-b d - Detach from the current session. ctrl-b 0-9 - Move to the window number 0-9. Ctrl-b l - Move to the previously selected window. Ctrl-b w - List all windows. Ctrl-b \u0026 - Kill the current window. Ctrl-b , - Rename the current window. ctrl-b space - Toggle between pane layouts. Ctrl-b ! - Convert the current pane into a window. Ctrl-b x - Close the current pane. Ctrl-b o - Switch to the next pane. Ctrl-b z - Toggle pane zoom. Ctrl-b q - Show pane numbers (used to switch between panes). Ctrl-b ? - List all keybindings. ","date":"2024-06-17","objectID":"/posts/tmux-guide-and-cheat-sheet/:4:0","tags":null,"title":"How to Keep Remote Servers Running with Tmux for Days Even If You Close Your Terminal","uri":"/posts/tmux-guide-and-cheat-sheet/"},{"categories":["Linux"],"content":"Customizing Tmux: Mouse Scrolling, Status Bar, and More\rYou can customize Tmux by editing the configuration file located at ~/.tmux.conf. Here are a few examples of customizations: # Enable mouse scrolling set -g mouse on # Enable two prefix keys set-option -g prefix C-a unbind-key C-b bind-key C-a send-prefix # Set the status bar to display in the bottom set-option -g status-position bottom # Set the status bar colors set-option -g status-style fg=white,bg=black # Customize the window list format set-option -g window-status-format \" #[fg=yellow]#I:#W#[fg=default]\" # Set the window list colors set-option -g window-status-current-style fg=black,bg=yellow # Customize the pane border colors set-option -g pane-active-border-style fg=green set-option -g pane-border-style fg=default # Set the default shell set-option -g default-shell \"/bin/bash\" These are just a few examples of customizations you can make to your Tmux configuration. Feel free to explore the Tmux manual and experiment with different settings to suit your preferences. Remember to save the changes to your ~/.tmux.conf file and restart your Tmux session for the new settings to take effect. With these essential commands, keyboard shortcuts, and customization options, you’ll be able to enhance your productivity and efficiently manage multiple terminal sessions using Tmux. This approach ensures that your remote servers and processes can continue running seamlessly, even if you disconnect from your terminal. Enjoy using Tmux! ","date":"2024-06-17","objectID":"/posts/tmux-guide-and-cheat-sheet/:5:0","tags":null,"title":"How to Keep Remote Servers Running with Tmux for Days Even If You Close Your Terminal","uri":"/posts/tmux-guide-and-cheat-sheet/"},{"categories":["Python"],"content":"Fix common relative path errors in Python projects so your scripts run correctly no matter where or how they are executed.","date":"2024-06-16","objectID":"/posts/handling-relative-paths-in-python-projects/","tags":null,"title":"Handling Relative Paths in Python Projects","uri":"/posts/handling-relative-paths-in-python-projects/"},{"categories":["Python"],"content":"Working on Python projects often requires managing complex directory structures and handling relative paths efficiently. In this blog post, we will explore common issues related to handling relative paths and provide solutions to ensure your scripts run smoothly, regardless of how and where they are executed. ","date":"2024-06-16","objectID":"/posts/handling-relative-paths-in-python-projects/:0:0","tags":null,"title":"Handling Relative Paths in Python Projects","uri":"/posts/handling-relative-paths-in-python-projects/"},{"categories":["Python"],"content":"Project Structure\rBefore diving into the details, let’s first understand the typical structure of a Python project. A Python project usually consists of the following directories: my_project/ │ ├── src/ │ ├── __init__.py │ ├── main.py │ ├── config/ │ │ ├── __init__.py │ │ └── data_config.py │ │ │ └── utils/ │ ├── __init__.py │ └── load_data.py │ ├── data/ │ └── simple.csv │ ├── .env (put apykeys and folders) │ └── README.md In this example, the src directory contains the main Python scripts, while the data directory stores the input data files. The .env file contains sensitive information such as API keys and database credentials. The config and utils directories contain configuration files and utility scripts, respectively. ","date":"2024-06-16","objectID":"/posts/handling-relative-paths-in-python-projects/:1:0","tags":null,"title":"Handling Relative Paths in Python Projects","uri":"/posts/handling-relative-paths-in-python-projects/"},{"categories":["Python"],"content":"VSCode Workspace Setup\rAdd a .env file to the root directory of your project with the following content: PYTHONPATH=path_to_project_folder/ For instance, if path_to_project_folder is E:\\projects\\my_project, your .env file should look like this: PYTHONPATH=E:\\projects\\my_project Additionally, add a .vscode/settings.json file with the following content: { \"terminal.integrated.env.linux\": { \"PYTHONPATH\": \"${workspaceFolder}\" } } This setup ensures that the PYTHONPATH environment variable is set to the root directory of your project when running Python scripts from VSCode. ","date":"2024-06-16","objectID":"/posts/handling-relative-paths-in-python-projects/:2:0","tags":null,"title":"Handling Relative Paths in Python Projects","uri":"/posts/handling-relative-paths-in-python-projects/"},{"categories":["Python"],"content":"Issues with Relative Paths\rWhen working with relative paths in Python projects, you may encounter the following issues: Inconsistent Behavior: The behavior of relative paths may vary depending on the execution context. For example, running a script from the command line or an IDE may yield different results. Working Directory: The working directory from which the script is executed affects the resolution of relative paths. If the working directory changes, the relative paths may no longer point to the correct locations. Module Imports: When importing modules from different directories, you need to ensure that the paths are correctly resolved. Incorrect imports can lead to module not found errors. Deployment: When deploying your project to a different environment, such as a server or a container, you need to ensure that the paths are correctly configured to work in the new environment. ","date":"2024-06-16","objectID":"/posts/handling-relative-paths-in-python-projects/:3:0","tags":null,"title":"Handling Relative Paths in Python Projects","uri":"/posts/handling-relative-paths-in-python-projects/"},{"categories":["Python"],"content":"A specific example of handling relative paths\rConsider the script my_project/src/utils/load_data.py: import pandas as pd df = pd.read_csv(\"data/simple.csv\") print(df.head()) When you open this file and run it using VS Code (Ctrl+F5), it should work as expected. It will also work fine if you run python my_project/src/utils/load_data.py from the project root directory. However, if you navigate to the utils folder and run python load_data.py, you’ll encounter the file not found error. To fix this issue, you can use the os module to construct the absolute path to the data file: import os import pandas as pd project_dir = os.path.join(os.path.dirname(__file__), \"..\", \"..\") data_path = os.path.join(project_dir, \"data\", \"simple.csv\") df = pd.read_csv(data_path) print(df.head()) In this modified version, we construct the absolute path to the data file by joining the directory of the current script (__file__) with the relative path to the data file. This ensures that the script can locate the data file regardless of the working directory. ","date":"2024-06-16","objectID":"/posts/handling-relative-paths-in-python-projects/:4:0","tags":null,"title":"Handling Relative Paths in Python Projects","uri":"/posts/handling-relative-paths-in-python-projects/"},{"categories":["AI"],"content":"Set up Invoke AI on Windows to generate images locally with open-source AI models, from hardware requirements to installation.","date":"2024-06-12","objectID":"/posts/how-to-generate-images-locally-using-open-source-ai-models/","tags":null,"title":"How to Generate Images Locally Using Open Source AI Models","uri":"/posts/how-to-generate-images-locally-using-open-source-ai-models/"},{"categories":["AI"],"content":"Generating images locally using open-source AI models is a fascinating way to leverage AI’s creative potential. Among the available tools, Invoke AI stands out due to its ease of installation and robust features. While Automatic1111 is popular, Invoke AI offers a more streamlined experience for beginners and advanced users alike. Here’s a guide to help you set up and run Invoke AI on your local Windows computer. ","date":"2024-06-12","objectID":"/posts/how-to-generate-images-locally-using-open-source-ai-models/:0:0","tags":null,"title":"How to Generate Images Locally Using Open Source AI Models","uri":"/posts/how-to-generate-images-locally-using-open-source-ai-models/"},{"categories":["AI"],"content":"Prerequisites\rBefore diving into the installation process, ensure you have the following: Hardware Requirements: An NVIDIA-based graphics card with at least 12 GB of main memory RAM. For Stable Diffusion 1.5: At least 4 GB VRAM. For Stable Diffusion XL: At least 8 GB VRAM. Software Requirements: Python 3.11. CUDA enabled on your system. Verify CUDA installation by running nvidia-smi in the terminal. ","date":"2024-06-12","objectID":"/posts/how-to-generate-images-locally-using-open-source-ai-models/:1:0","tags":null,"title":"How to Generate Images Locally Using Open Source AI Models","uri":"/posts/how-to-generate-images-locally-using-open-source-ai-models/"},{"categories":["AI"],"content":"Installation Steps\rDownload Invoke AI: Download the latest version of Invoke AI from the official GitHub releases page. To download v4.2.4 directly, click here. Extract the downloaded files to your desired location. Run the Installer Script: Navigate to the extracted files. Double-click on the install.bat script to begin the installation. Follow the prompts to specify an installation location and select your GPU type. Locate the Installation Directory: Once the installation is complete, find the directory you specified. The default location is C:\\Users\\Username\\invokeai for Windows. Run the Launcher Script: Navigate to the installation directory. Double-click on invoke.bat to launch Invoke AI. Start the Application: Select option 1 to start the application. Once it starts up, open your browser and go to http://localhost:9090. Install a Starter Model: Open the model manager tab within the Invoke AI interface. Install a starter model to begin generating images. You are now ready to explore the creative possibilities of AI image generation using Invoke AI. This powerful tool provides an accessible entry point for both hobbyists and professionals looking to delve into AI-driven art. Stay tuned for our next tutorial where we’ll delve deeper into using Invoke AI to create stunning images. ","date":"2024-06-12","objectID":"/posts/how-to-generate-images-locally-using-open-source-ai-models/:2:0","tags":null,"title":"How to Generate Images Locally Using Open Source AI Models","uri":"/posts/how-to-generate-images-locally-using-open-source-ai-models/"},{"categories":["AI"],"content":"Invoke AI Tutorial\rComing soon… ","date":"2024-06-12","objectID":"/posts/how-to-generate-images-locally-using-open-source-ai-models/:3:0","tags":null,"title":"How to Generate Images Locally Using Open Source AI Models","uri":"/posts/how-to-generate-images-locally-using-open-source-ai-models/"},{"categories":["AI"],"content":"Run a ChatGPT-like chatbot locally on Windows with an open-source LLM using Ollama and Open WebUI. Step-by-step setup guide.","date":"2024-06-12","objectID":"/posts/how-to-create-ai-chatbot/","tags":null,"title":"How to create a chatbot like ChatGPT by running LLM locally in Windows via Ollama and Open WebUI","uri":"/posts/how-to-create-ai-chatbot/"},{"categories":["AI"],"content":"In this post we will see that how to create a chatbot like ChatGPT by running Large Language Model (LLM) locally in Windows via Ollama and Open WebUI Creating a chatbot that runs a large language model (LLM) on your local machine can be done in several ways. Here are some methods you might consider: Using API and Programming: This approach is often difficult and time-consuming. Chatbot UI: This method requires API access from OpenAI. It’s very good if you want to use it remotely, but as of my knowledge, it may not support local model access. Ollama and Open WebUI: These can be used with APIs from OpenAI and locally stored, trained LLM models. In this post, I will discuss how we can use Ollama and Open WebUI. ","date":"2024-06-12","objectID":"/posts/how-to-create-ai-chatbot/:0:0","tags":null,"title":"How to create a chatbot like ChatGPT by running LLM locally in Windows via Ollama and Open WebUI","uri":"/posts/how-to-create-ai-chatbot/"},{"categories":["AI"],"content":"Install Ollama\rOllama is a framework for building and running language models on a local machine. It can be used for not only chatbots but also AI assistants inside your editor like VSCode. For more information, you can explore Ollama’s blog and Continue Code Assistant. Ollama supports Nvidia and Apple’s M-series GPUs. Nvidia GPUs with at least 4 GB of memory will work, and for M-series Macs, at least 16 GB of memory is recommended. I suggests using at least a GeForce RTX 3060 Ti GPU with 8 GB GDDR6 memory. While Ollama can run in CPU-only mode, the responses may be slow or poor quality. For instance, one user reported that a smaller model, tinyllama, was able to stream responses at a normal rate but the quality was poor. Download Ollama from here and install it. Available Ollama models can be found here. To run a particular model, open the terminal and run the Ollama command. For example, to run llama3:8B, use: ollama run llama3:8B Once running, you can visit http://localhost:11434/ to confirm if Ollama is running. For additional documentation, refer to their documentation. ","date":"2024-06-12","objectID":"/posts/how-to-create-ai-chatbot/:1:0","tags":null,"title":"How to create a chatbot like ChatGPT by running LLM locally in Windows via Ollama and Open WebUI","uri":"/posts/how-to-create-ai-chatbot/"},{"categories":["AI"],"content":"Install Open WebUI\rWe will be using Docker Desktop. Download and install Docker Desktop from here. To confirm the Docker installation, run the following command in the terminal: docker --version and it should display the Docker version. If you have an Nvidia GPU and want GPU support with the OpenAI API, use the following command: docker run -d -p 3000:8080 --gpus all --add-host=host.docker.internal:host-gateway -e OPENAI_API_KEY=openai_secret_key -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:cuda Remember to replace openai_secret_key with your secret key, which can be found here. If you want to install without GPU or without OpenAI API, follow the instructions provided here. Once installed, you can visit http://localhost:3000/, sign up, and start using it. ","date":"2024-06-12","objectID":"/posts/how-to-create-ai-chatbot/:2:0","tags":null,"title":"How to create a chatbot like ChatGPT by running LLM locally in Windows via Ollama and Open WebUI","uri":"/posts/how-to-create-ai-chatbot/"},{"categories":["AI"],"content":"Installing New Models\rTo install a new model, you can use ollama run \u003cmodel name\u003e in the terminal. To find new models visit Ollama model repository. For example: ton install qwen2:0.5b which is is a new series of large language models from the Alibaba group. Now you will have the option to choose the model from the Open WebUI portal. Moreover, you can also download new models in the settings of the Open WebUI portal. ","date":"2024-06-12","objectID":"/posts/how-to-create-ai-chatbot/:3:0","tags":null,"title":"How to create a chatbot like ChatGPT by running LLM locally in Windows via Ollama and Open WebUI","uri":"/posts/how-to-create-ai-chatbot/"},{"categories":["AI"],"content":"How to start using Open WebUI later on\rStart Ollama from the Start menu. Open Docker Desktop and run the following command in the terminal: docker start open-webui ","date":"2024-06-12","objectID":"/posts/how-to-create-ai-chatbot/:4:0","tags":null,"title":"How to create a chatbot like ChatGPT by running LLM locally in Windows via Ollama and Open WebUI","uri":"/posts/how-to-create-ai-chatbot/"},{"categories":["AI"],"content":"Troubleshooting\rSometimes, after restarting your PC, you may encounter some port errors with Docker when starting open-webui. In such cases, delete open-webui from Docker and restart your computer. Then run: docker run -d -p 3000:8080 --gpus all --add-host=host.docker.internal:host-gateway -e OPENAI_API_KEY=openai_secret_key -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:cuda Now, you have a powerful local setup for running a chatbot using large language models. Enjoy! ","date":"2024-06-12","objectID":"/posts/how-to-create-ai-chatbot/:4:1","tags":null,"title":"How to create a chatbot like ChatGPT by running LLM locally in Windows via Ollama and Open WebUI","uri":"/posts/how-to-create-ai-chatbot/"},{"categories":["LaTeX"],"content":"Practical LaTeX tips for cleaner typesetting: keeping text together, quotation marks, spacing, inline math, fractions, and equation references.","date":"2023-11-16","objectID":"/posts/latex-tips-for-effective-typesetting/","tags":null,"title":"LaTeX Tips for Effective Typesetting","uri":"/posts/latex-tips-for-effective-typesetting/"},{"categories":["LaTeX"],"content":"LaTeX is a powerful typesetting system used extensively for scientific documents, academic papers, and any situation which requires precision in presentation. Below are some effective tips and tricks to enhance your LaTeX typesetting, ensuring consistency and clarity in your documents. ","date":"2023-11-16","objectID":"/posts/latex-tips-for-effective-typesetting/:0:0","tags":null,"title":"LaTeX Tips for Effective Typesetting","uri":"/posts/latex-tips-for-effective-typesetting/"},{"categories":["LaTeX"],"content":"Keeping Text Together and Box Usage\r","date":"2023-11-16","objectID":"/posts/latex-tips-for-effective-typesetting/:1:0","tags":null,"title":"LaTeX Tips for Effective Typesetting","uri":"/posts/latex-tips-for-effective-typesetting/"},{"categories":["LaTeX"],"content":"Ensuring Word Cohesion with mbox and fbox\rTo prevent LaTeX from breaking up text between lines or pages, you can use the \\mbox{} command, which will keep the text inside intact regardless of formatting. It’s particularly useful when dealing with text that must stay together, such as proper names or specific code snippets. My phone number will change soon. It will be \\\\mbox{0116 291 2319}. My phone number will change soon. It will be 0116 291 2319. Similarly, \\fbox{} wraps the content with a visible box, which can be helpful for highlighting information or creating distinct sections visually. \\fbox{This text is boxed.} To stop specific ligatures—two or more letters combined into a single character (ff fi fl f) —from being used, insert an \\mbox{} between the characters. shelf\\\\mbox{}ful shelfful ","date":"2023-11-16","objectID":"/posts/latex-tips-for-effective-typesetting/:1:1","tags":null,"title":"LaTeX Tips for Effective Typesetting","uri":"/posts/latex-tips-for-effective-typesetting/"},{"categories":["LaTeX"],"content":"Typography and Quotation Marks\rIn LaTeX, the correct way to start and end quotes is to use a grave accent ` for opening quotes and a simple vertical quote ' for closing quotes. For double quotes, use two grave accents and two vertical quotes. `single quotes' ","date":"2023-11-16","objectID":"/posts/latex-tips-for-effective-typesetting/:1:2","tags":null,"title":"LaTeX Tips for Effective Typesetting","uri":"/posts/latex-tips-for-effective-typesetting/"},{"categories":["LaTeX"],"content":"Word Separation with slash\rUsing \\slash allows you to correctly separate words, particularly useful in compound words that require a “read or write” representation. read\\slash write read\\write ","date":"2023-11-16","objectID":"/posts/latex-tips-for-effective-typesetting/:1:3","tags":null,"title":"LaTeX Tips for Effective Typesetting","uri":"/posts/latex-tips-for-effective-typesetting/"},{"categories":["LaTeX"],"content":"Math Expressions in LaTeX\r","date":"2023-11-16","objectID":"/posts/latex-tips-for-effective-typesetting/:2:0","tags":null,"title":"LaTeX Tips for Effective Typesetting","uri":"/posts/latex-tips-for-effective-typesetting/"},{"categories":["LaTeX"],"content":"Roman Letters in Equations\rTo use Roman letters within an equation, you should use the \\mathrm{} directive. \\int\\_{0}^{\\infty} x\\^{}2 \\\\mathrm{e}\\^{-x} \\\\mathrm{d}x $$\\int_{0}^{\\infty} x^{2} \\mathrm{e}^{-x} \\mathrm{d}x$$ ","date":"2023-11-16","objectID":"/posts/latex-tips-for-effective-typesetting/:2:1","tags":null,"title":"LaTeX Tips for Effective Typesetting","uri":"/posts/latex-tips-for-effective-typesetting/"},{"categories":["LaTeX"],"content":"Ellipsis Representations\rLaTeX offers different types of ellipsis () representations: \\ldots for a horizontal ellipsis in text. ($\\ldots$) \\cdots for centered ellipsis dots in math mode. ($\\cdots$) \\vdots for vertical ellipsis dots in math mode. ($\\vdots$) \\ddots for diagonal ellipsis dots in math mode. ($\\ddots$) \\cdot for a single centered dot in math mode. ($\\cdot$) ","date":"2023-11-16","objectID":"/posts/latex-tips-for-effective-typesetting/:2:2","tags":null,"title":"LaTeX Tips for Effective Typesetting","uri":"/posts/latex-tips-for-effective-typesetting/"},{"categories":["LaTeX"],"content":"Spacing and Non-Breaking in LaTeX\rThe tilde character ~ in LaTeX creates a non-breakable space, ensuring that certain elements stay together. This generates a space that cannot be enlarged and additionally prohibits a line break. Dr.~Dre Dr. Dre When using \\@ before a period, LaTeX understands the period as the end of a sentence even if it is preceded by an uppercase letter. PROF.~SMITH WAS HAPPY TO SEE HER \\@. PROF. SMITH WAS HAPPY TO SEE HER. ","date":"2023-11-16","objectID":"/posts/latex-tips-for-effective-typesetting/:2:3","tags":null,"title":"LaTeX Tips for Effective Typesetting","uri":"/posts/latex-tips-for-effective-typesetting/"},{"categories":["LaTeX"],"content":"In-Line Math Expressions\rWhen typesetting in-line math expressions that are tall or deep, the \\smash{} command can help avoid irregular spacing in the surrounding text. A $d_{e_{e_p}}$ mathematical\rexpression followed by a $h^{i^{g^h}}$ expression. As opposed to a smashed \\smash{$d_{e_{e_p}}$} expression followed by a \\smash{$h^{i^{g^h}}$} expression.\rA $d_{e_{e_p}}$ mathematical expression followed by a $h^{i^{g^h}}$ expression. As opposed to a smashed \\smash{$d_{e_{e_p}}$} expression followed by a \\smash{$h^{i^{g^h}}$} expression. The example above is not correct and cannot be displayed in the browser. ","date":"2023-11-16","objectID":"/posts/latex-tips-for-effective-typesetting/:2:4","tags":null,"title":"LaTeX Tips for Effective Typesetting","uri":"/posts/latex-tips-for-effective-typesetting/"},{"categories":["LaTeX"],"content":"Displaying Fractions\rUsing \\frac{numerator}{denominator} you can display fractions. For in-line equations, fractions will be resized to fit the line, but you can use \\dfrac{} for a display-size fraction within text. $1\\frac{1}{2}$~hours $\\qquad 1\\dfrac{1}{2}$~hours $1\\frac{1}{2}$ hours $\\qquad 1\\dfrac{1}{2}$ hours. The slashed form 1/2 is often preferable for simple fractions due to its clarity and the fact that it takes less vertical space. \\tfrac{1}{2} can be used in equation mode to shrink the size of the fraction. \\begin{equation*}\r3/8 \\qquad \\frac{3}{8}\r\\qquad \\tfrac{3}{8}\r\\end{equation*}$$3/8 \\qquad \\frac{3}{8} \\qquad \\tfrac{3}{8}$$ ","date":"2023-11-16","objectID":"/posts/latex-tips-for-effective-typesetting/:2:5","tags":null,"title":"LaTeX Tips for Effective Typesetting","uri":"/posts/latex-tips-for-effective-typesetting/"},{"categories":["LaTeX"],"content":"Referencing Equations\rInside the equation environment, you can label an equation with \\label{} and refer to it anywhere in the text using \\eqref{}. \\begin{equation}\rE = mc^2 \\label{eq:energy\\_mass}\r\\end{equation}As shown in equation \\eqref{eq:energy\\_mass} … If you want to assign a custom name to an equation, use \\tag{} instead. ","date":"2023-11-16","objectID":"/posts/latex-tips-for-effective-typesetting/:2:6","tags":null,"title":"LaTeX Tips for Effective Typesetting","uri":"/posts/latex-tips-for-effective-typesetting/"},{"categories":["LaTeX"],"content":"Underlines and Overlines\rTo create horizontal lines over or under expressions, use \\overline{} and \\underline{} respectively. \\\\underline{x+y} $$\\underline{x+y}$$ For double underlines, you can stack the command: \\\\underline{\\\\underline{x+y}} $$\\underline{\\underline{x+y}}$$ ","date":"2023-11-16","objectID":"/posts/latex-tips-for-effective-typesetting/:2:7","tags":null,"title":"LaTeX Tips for Effective Typesetting","uri":"/posts/latex-tips-for-effective-typesetting/"},{"categories":["LaTeX"],"content":"Advanced Mathematical Customizations\rLaTeX also offers commands for more advanced operations: \\stackrel{#1}{#2}: Places a symbol over another in superscript size. f_n(x) \\stackrel{*}{\\approx} 1 $f_n(x) \\stackrel{*}{\\approx} 1$ \\DeclareMathOperator: Declares a new operator (must be used in the preamble). \\DeclareMathOperator{\\func}{Function} Then use \\func to display the operator. \\bmod and \\pmod: Used for modulus operations in math mode. a \\bmod b \\qquad x \\equiv a \\pmod{b} $a \\bmod b \\qquad x \\equiv a \\pmod{b}$ \\newtheorem: For defining new theorem-like environments. \\newtheorem{name}[counter]{text}[section] Here, name is the short keyword to identify the theorem, and text is the text to be displayed. The optional section argument allows you to define the sectional unit that the theorem will be numbered with. the counter argument to specify the name of a previously declared “theorem”. The new “theorem” will then be numbered in the same sequence. \\newcommand: To define new, custom commands for repetitive use. \\newcommand{name}[num]{definition} Here, name and definition are required, and num is optional. If num is specified, the command will expect that number of arguments. Upto 9 arguments can be specified. #1, #2, etc. are used to refer to the arguments in the definition. \\providecommand is similar to \\newcommand, but it does nothing if the command is already defined. \\newenvironment: To define new environments. \\newenvironment{name}[num]{before}{after} Here, name is the name of the environment, before is the text to be printed before the environment, and after is the text to be printed after the environment. If num is specified, the environment will expect that number of arguments. Upto 9 arguments can be specified. #1, #2, etc. are used to refer to the arguments in the definition. \\ignorespacesafterend and \\ignorespaces are useful commands to ignore spaces after the environment. \\newenvironment{myenvironment}{\\begin{center}}{\\end{center}} Read 6.1.5 of the source for more information about creating package. ","date":"2023-11-16","objectID":"/posts/latex-tips-for-effective-typesetting/:3:0","tags":null,"title":"LaTeX Tips for Effective Typesetting","uri":"/posts/latex-tips-for-effective-typesetting/"},{"categories":["LaTeX"],"content":"Adjusting Spacing\r","date":"2023-11-16","objectID":"/posts/latex-tips-for-effective-typesetting/:4:0","tags":null,"title":"LaTeX Tips for Effective Typesetting","uri":"/posts/latex-tips-for-effective-typesetting/"},{"categories":["LaTeX"],"content":"Horizontal and Vertical Spaces\rTo manage horizontal and vertical spaces within your document, LaTeX offers various commands: \\hspace{length} and \\vspace{length}: To add space horizontally or vertically. Supported units are pt, mm, cm, in, ex, em, mu, fil, fill, and filll. pt: point (1/3 mm); em: width of the letter M in the current font; mu: math unit, 1/18 em; ex: height of the letter x in the current font. \\bigskip and \\smallskip: For predefined vertical skipping. Additional space between two lines of the same paragraph or within a table is specified with the \\\\[length] command. \\!, \\,, \\quad, and \\qquad: For fine-tuning spacing in math mode. Flexible spacing can be achieved with \\stretch{n} which expands to fill all available space. ","date":"2023-11-16","objectID":"/posts/latex-tips-for-effective-typesetting/:4:1","tags":null,"title":"LaTeX Tips for Effective Typesetting","uri":"/posts/latex-tips-for-effective-typesetting/"},{"categories":["LaTeX"],"content":"Changing Line Spacing\rTo modify line spacing, use \\setlength{\\baselineskip} followed by a scaling factor. \\setlength{\\baselineskip}{1.5\\baselineskip} Source: The Not So Short Introduction to LaTeX2e http://tug.ctan.org/info/lshort/english/lshort.pdf ","date":"2023-11-16","objectID":"/posts/latex-tips-for-effective-typesetting/:4:2","tags":null,"title":"LaTeX Tips for Effective Typesetting","uri":"/posts/latex-tips-for-effective-typesetting/"},{"categories":["Web Development"],"content":"Step-by-step guide to installing Hugo on Windows and building a website with a blog using this fast static site generator.","date":"2023-10-01","objectID":"/posts/creating-website-with-hugo-on-windows/","tags":null,"title":"Create Website with Blog using Hugo on Windows","uri":"/posts/creating-website-with-hugo-on-windows/"},{"categories":["Web Development"],"content":"Hugo is a popular open-source static site generator (SSG) that’s known for its speed, flexibility, and ease of use. In this post, I’ll walk you through the process of creating a website using Hugo on Windows. ","date":"2023-10-01","objectID":"/posts/creating-website-with-hugo-on-windows/:0:0","tags":null,"title":"Create Website with Blog using Hugo on Windows","uri":"/posts/creating-website-with-hugo-on-windows/"},{"categories":["Web Development"],"content":"Installing Hugo\r","date":"2023-10-01","objectID":"/posts/creating-website-with-hugo-on-windows/:1:0","tags":null,"title":"Create Website with Blog using Hugo on Windows","uri":"/posts/creating-website-with-hugo-on-windows/"},{"categories":["Web Development"],"content":"Using winget\rInstall Hugo: Open PowerShell as an administrator. Run winget install Hugo. Verify Installation: Run hugo version in PowerShell to verify the installation. ","date":"2023-10-01","objectID":"/posts/creating-website-with-hugo-on-windows/:1:1","tags":null,"title":"Create Website with Blog using Hugo on Windows","uri":"/posts/creating-website-with-hugo-on-windows/"},{"categories":["Web Development"],"content":"Manual Installation\rDownload Hugo: To install Hugo, you can clone the repository: git clone https://github.com/gohugoio/hugo.git. Alternatively, for the latest release, visit Hugo Releases. Download the appropriate version and extract hugo.exe. Set Up Hugo: Place hugo.exe in a preferred location, such as C:\\hugo\\bin. Add the path of hugo.exe to your system’s environment variables. Verify Installation: Open PowerShell and run hugo version to verify the installation. Alternative Setup: If you prefer, you can keep hugo.exe in your project directory. In this case, use .\\hugo version to check the version. ","date":"2023-10-01","objectID":"/posts/creating-website-with-hugo-on-windows/:1:2","tags":null,"title":"Create Website with Blog using Hugo on Windows","uri":"/posts/creating-website-with-hugo-on-windows/"},{"categories":["Web Development"],"content":"Creating a Website\rInitiate a New Website: Run hugo new site \u003cwebsite-name\u003e to create a new folder named \u003cwebsite-name\u003e. Choose a Theme: Visit Hugo Themes to download a theme of your choice. Extract the theme and place it in the \u003cwebsite-name\u003e/themes folder. Configure the Website: Edit the config.toml file inside your \u003cwebsite-name\u003e folder. You can use this sample config file as reference. baseURL = 'https://www.example.com/' # provide valid url languageCode = 'en-us' title = 'Website Name' theme = \"hermit\" Preview the Site: Run hugo server to preview the website locally. Even if you provide a baseURL for a remote host, it will run locally. Generate the Static Website: Create a folder named public. Run hugo -t \u003ctheme-name\u003e to generate the static website, which will be stored in the public folder. Deploy the Website: Transfer the files from the public directory to the public directory of your chosen web hosting service. ","date":"2023-10-01","objectID":"/posts/creating-website-with-hugo-on-windows/:2:0","tags":null,"title":"Create Website with Blog using Hugo on Windows","uri":"/posts/creating-website-with-hugo-on-windows/"},{"categories":["Web Development"],"content":"Creating a Post or Page\rTo create a new post, run hugo new posts/.md. This will create a markdown file for your post in the content/posts folder. Edit the markdown file to add your content using your preferred text editor. To create a new page, run hugo new .md. The markdown file will be created in the content folder. Again, edit the markdown file to add content for your page. Font Awesome icons can be added using :(fas fa-\u003cicon-name\u003e fa-fw): When linking images in your markdown file in relation to your post, take into account the structure of the leaf bundle directory, as shown below. content \\__posts | \\__post_about_blah | | |--index.md | | |--picture_1.jpg | | \\__images | | | |--picture_2.jpg | | | |--picture_3.jpg | \\__blah_blah_post | | |--index.md | | |--picture_1.jpg | | \\__images | | | |--picture_2.jpg | | | |--picture_3.jpg ","date":"2023-10-01","objectID":"/posts/creating-website-with-hugo-on-windows/:3:0","tags":null,"title":"Create Website with Blog using Hugo on Windows","uri":"/posts/creating-website-with-hugo-on-windows/"},{"categories":["Web Development"],"content":"Hosting Hugo Website on GitHub Pages\rCreate a GitHub Repository: Create a new repository on GitHub with the name \u003cusername\u003e.github.io. Initialize Git: Run git init in your project directory. Add the GitHub repository as a remote: `git remote add origin Generate the Website: Run hugo -t \u003ctheme-name\u003e to generate the static website. Push to GitHub: Push the generated files to the GitHub repository: git push -u origin main. Enable GitHub Pages: Go to the repository settings on GitHub. Under the GitHub Pages section, select the main branch as the source. Access the Website: Visit https://\u003cusername\u003e.github.io to access your Hugo website. ","date":"2023-10-01","objectID":"/posts/creating-website-with-hugo-on-windows/:4:0","tags":null,"title":"Create Website with Blog using Hugo on Windows","uri":"/posts/creating-website-with-hugo-on-windows/"},{"categories":["Web Development"],"content":"Hugo FixIt Themes Installation\rHugo offers a wide range of themes that you can use to customize your website. One of my favorite themes is LoverIt, which offers a clean and modern design. However, there is a bug-fixed version of LoverIt called FixIt. To use the FixIt theme, you can follow these steps: Clone the FixIt repository into the themes folder of your Hugo project. git clone git clone https://github.com/hugo-fixit/FixIt.git themes/FixIt To use the FixIt theme, update the theme field in your config.toml file. theme = \"FixIt\" Run hugo server to preview your website with the FixIt theme. To generate the static website with the FixIt theme, run hugo -t FixIt. Push the changes to your GitHub repository to update your website with the FixIt theme. ","date":"2023-10-01","objectID":"/posts/creating-website-with-hugo-on-windows/:5:0","tags":null,"title":"Create Website with Blog using Hugo on Windows","uri":"/posts/creating-website-with-hugo-on-windows/"},{"categories":["Python"],"content":"Learn the basics of testing in Python with pytest: writing test cases, fixtures, parameterized tests, and test discovery.","date":"2023-06-12","objectID":"/posts/python-testing-basics-pytest/","tags":null,"title":"Testing in Python Fundamentals with Pytest","uri":"/posts/python-testing-basics-pytest/"},{"categories":["Python"],"content":"Testing is an essential part of developing applications. It helps ensure that the code works as expected and catches bugs early in the development process. In this article, we will explore the basics of testing in Python using the popular testing framework, Pytest. ","date":"2023-06-12","objectID":"/posts/python-testing-basics-pytest/:0:0","tags":null,"title":"Testing in Python Fundamentals with Pytest","uri":"/posts/python-testing-basics-pytest/"},{"categories":["Python"],"content":"What is Pytest?\rPytest is a testing framework for Python that makes writing and running tests simple and efficient. It provides a rich set of features for writing test cases, including fixtures, parameterized tests, and test discovery. Pytest is widely used in the Python community and is known for its simplicity and ease of use. ","date":"2023-06-12","objectID":"/posts/python-testing-basics-pytest/:1:0","tags":null,"title":"Testing in Python Fundamentals with Pytest","uri":"/posts/python-testing-basics-pytest/"},{"categories":["Python"],"content":"Setting Up Pytest\r","date":"2023-06-12","objectID":"/posts/python-testing-basics-pytest/:2:0","tags":null,"title":"Testing in Python Fundamentals with Pytest","uri":"/posts/python-testing-basics-pytest/"},{"categories":["Python"],"content":"Installation\rTo install Pytest, use pip: pip install pytest To verify installation: pytest --version ","date":"2023-06-12","objectID":"/posts/python-testing-basics-pytest/:2:1","tags":null,"title":"Testing in Python Fundamentals with Pytest","uri":"/posts/python-testing-basics-pytest/"},{"categories":["Python"],"content":"Basic Structure\rPytest automatically discovers tests based on a few conventions: Test files: Test files should start with test_ or end with _test.py. Test functions: Test functions should start with test_. Test classes: Test classes should start with Test. Let’s create a simple project structure: my_project/ │ ├── src/ │ └── calculator.py └── tests/ └── test_calculator.py Writing a simple test: # src/calculator.py def add(a, b): return a + b def subtract(a, b): return a - b # tests/test_calculator.py from src.calculator import add, subtract def test_add(): assert add(3, 5) == 8 assert add(-1, 1) == 0 assert add(-1, -1) == -2 def test_subtract(): assert subtract(10, 5) == 5 assert subtract(-1, 1) == -2 assert subtract(-1, -1) == 0 To run the tests, simply navigate to your project directory and execute: pytest Pytest will automatically discover and run the test functions in the test_calculator.py file. if you want to run a specific test file, you can specify the file name, even without following the naming convention, however, the function names should still start with test_: pytest non_standard_test_file.py ","date":"2023-06-12","objectID":"/posts/python-testing-basics-pytest/:2:2","tags":null,"title":"Testing in Python Fundamentals with Pytest","uri":"/posts/python-testing-basics-pytest/"},{"categories":["Python"],"content":"Fixtures\rFixtures are functions that provide data to test functions. They help set up the test environment and provide reusable data for multiple tests. Fixtures are defined using the @pytest.fixture decorator. Let’s create a fixture that provides a calculator object to our test functions: import pytest @pytest.fixture def some_data(): return 42 def test_some_data(some_data): assert some_data == 42 In the above example, the some_data fixture provides the value 42 to the test_some_data test function. Fixtures can also be used to set up resources, such as database connections or temporary files. ","date":"2023-06-12","objectID":"/posts/python-testing-basics-pytest/:3:0","tags":null,"title":"Testing in Python Fundamentals with Pytest","uri":"/posts/python-testing-basics-pytest/"},{"categories":["Python"],"content":"Parameterized Tests\rParameterize tests to run with multiple sets of arguments. import pytest @pytest.mark.parametrize(\"input1, input2, expected\", [ (1, 2, 3), (0, 0, 0), (-1, 1, 0), ]) def test_add(input1, input2, expected): assert add(input1, input2) == expected In the above example, the test_add function is parameterized with three sets of input arguments and expected results. Pytest will run the test with each set of arguments and report the results. ","date":"2023-06-12","objectID":"/posts/python-testing-basics-pytest/:4:0","tags":null,"title":"Testing in Python Fundamentals with Pytest","uri":"/posts/python-testing-basics-pytest/"},{"categories":["Python"],"content":"Python debugging with Pytest\rPytest provides a useful feature for debugging tests using the --pdb flag. When a test fails, you can drop into the Python debugger to inspect the state of the test environment. pytest --pdb This will drop you into the Python debugger when a test fails, allowing you to inspect variables, step through code, and diagnose the issue. ","date":"2023-06-12","objectID":"/posts/python-testing-basics-pytest/:5:0","tags":null,"title":"Testing in Python Fundamentals with Pytest","uri":"/posts/python-testing-basics-pytest/"},{"categories":["Linux"],"content":"Linux fundamentals part 1: essential Bash commands for working with files, directories, permissions, and operators.","date":"2022-04-12","objectID":"/posts/linux-fundamentals/linux-fundamentals-1/","tags":null,"title":"Linux Fundamentals 1","uri":"/posts/linux-fundamentals/linux-fundamentals-1/"},{"categories":["Linux"],"content":"Linux is a operating system like OS X and Windows, however much more lightweight. It is built upon UNIX, which is an open-source operating system. Two of the most common distribution of Linux are Ubuntu and Debian. Useful links: Command line reference: https://ss64.com/bash Let’s get started with some of the most useful commands in Linux: echo - Outputs text to the terminal. user@linux:~$ echo \"Hello, World!\" Hello, World! whoami - Prints the username of the current user. user@linux:~$ whoami user man - Displays the manual page of a command. user@linux:~$ man ls ","date":"2022-04-12","objectID":"/posts/linux-fundamentals/linux-fundamentals-1/:0:0","tags":null,"title":"Linux Fundamentals 1","uri":"/posts/linux-fundamentals/linux-fundamentals-1/"},{"categories":["Linux"],"content":"Interacting with Files and Directories\r","date":"2022-04-12","objectID":"/posts/linux-fundamentals/linux-fundamentals-1/:1:0","tags":null,"title":"Linux Fundamentals 1","uri":"/posts/linux-fundamentals/linux-fundamentals-1/"},{"categories":["Linux"],"content":"ls\rLists all files and directories in the current directory. To list files and directories in long format with human-readable file sizes: ls -lh (current directory) ls -lh /usr/bin (specific directory) ls -lh *.txt (specific file type) ls -lh file* (specific file name) ls -lh /usr/bin \u003e file1.txt (redirecting the output to a file) ls -al (lists all files and directories, including hidden ones) ls -lASh (lists files and directories in long format, sorted by size, and human-readable file sizes) Option Description -a Lists all files and directories, including hidden ones. -l Lists files and directories in long format. -h Makes file sizes human-readable. -t Sorts files and directories by modification time. -lh Lists files and directories in long format with human-readable file sizes. -F Appends a character to the end of each file name to indicate the type of file. -R Lists files and directories recursively. -S Sorts files and directories by size. -A Lists files and directories, excluding . and ... ","date":"2022-04-12","objectID":"/posts/linux-fundamentals/linux-fundamentals-1/:1:1","tags":null,"title":"Linux Fundamentals 1","uri":"/posts/linux-fundamentals/linux-fundamentals-1/"},{"categories":["Linux"],"content":"cd\rChanges the current directory. user@linux:~$ cd Documents user@linux:~/Documents$ cd .. can be used to move up one directory. cd can also be used to move to absolute paths, like cd /usr/bin. ","date":"2022-04-12","objectID":"/posts/linux-fundamentals/linux-fundamentals-1/:1:2","tags":null,"title":"Linux Fundamentals 1","uri":"/posts/linux-fundamentals/linux-fundamentals-1/"},{"categories":["Linux"],"content":"pwd\rPrints the current working directory. user@linux:~$ pwd /home/user ","date":"2022-04-12","objectID":"/posts/linux-fundamentals/linux-fundamentals-1/:1:3","tags":null,"title":"Linux Fundamentals 1","uri":"/posts/linux-fundamentals/linux-fundamentals-1/"},{"categories":["Linux"],"content":"mkdir\rCreates a new directory. mkdir new_directory creates a new directory named new_directory. Option Description -p Creates parent directories as needed. mkdir -p directory1/directory2/directory3 -v Displays a message for each directory created. mkdir -pv directory1/directory2/directory3 -m Sets the permissions for the directory. mkdir -m 777 new_directory ","date":"2022-04-12","objectID":"/posts/linux-fundamentals/linux-fundamentals-1/:1:4","tags":null,"title":"Linux Fundamentals 1","uri":"/posts/linux-fundamentals/linux-fundamentals-1/"},{"categories":["Linux"],"content":"rm\rRemoves files or directories. It does not move files to the trash, it deletes them permanently. user@linux:~$ rm file1.txt Option Description -r Removes directories and their contents recursively. -f Removes files without prompting for confirmation. To remove a directory and its contents: rm -r directory1 To remove multiple files: rm file1.txt file2.txt To remove all files with a specific extension: rm *.txt To remove all files starting with a specific name: rm file* To remove all files in a directory: rm * ","date":"2022-04-12","objectID":"/posts/linux-fundamentals/linux-fundamentals-1/:1:5","tags":null,"title":"Linux Fundamentals 1","uri":"/posts/linux-fundamentals/linux-fundamentals-1/"},{"categories":["Linux"],"content":"rmdir\rRemoves empty directories. rmdir * removes all empty directories in the current directory. ","date":"2022-04-12","objectID":"/posts/linux-fundamentals/linux-fundamentals-1/:1:6","tags":null,"title":"Linux Fundamentals 1","uri":"/posts/linux-fundamentals/linux-fundamentals-1/"},{"categories":["Linux"],"content":"cp\rCopies files and directories. cp file1.txt directory1 copies the file to the directory. cp file1.txt file2.txt copies the file. cp -i file1.txt directory1 prompts for confirmation before overwriting files. cp -r directory1 directory2 copies directories and their contents recursively. ","date":"2022-04-12","objectID":"/posts/linux-fundamentals/linux-fundamentals-1/:1:7","tags":null,"title":"Linux Fundamentals 1","uri":"/posts/linux-fundamentals/linux-fundamentals-1/"},{"categories":["Linux"],"content":"mv\rMoves files and directories. mv file1.txt directory1 moves the file to the directory. mv file1.txt file2.txt renames the file. mv directory1 directory2 moves the directory. mv -i file1.txt directory1 prompts for confirmation before overwriting files. ","date":"2022-04-12","objectID":"/posts/linux-fundamentals/linux-fundamentals-1/:1:8","tags":null,"title":"Linux Fundamentals 1","uri":"/posts/linux-fundamentals/linux-fundamentals-1/"},{"categories":["Linux"],"content":"touch\rCreates an empty file. touch file1.txt creates a new file named file1.txt. ","date":"2022-04-12","objectID":"/posts/linux-fundamentals/linux-fundamentals-1/:1:9","tags":null,"title":"Linux Fundamentals 1","uri":"/posts/linux-fundamentals/linux-fundamentals-1/"},{"categories":["Linux"],"content":"cat\rReads and displays the contents of files sequentially. For example: To read contents of a file named file1.txt and file2.txt: user@linux:~$ cat file1.txt This is file1 to display line numbers with the contents of the file, use the -n option. cat -n filename to concatenate the contents of two files and store them in a new file, use the \u003e operator. cat file1.txt file2.txt \u003e file3.txt to append the contents of a file to another file, use the \u003e\u003e operator. cat file1.txt \u003e\u003e file2.txt to display the contents of a file in reverse order, use the tac command. tac filename ","date":"2022-04-12","objectID":"/posts/linux-fundamentals/linux-fundamentals-1/:1:10","tags":null,"title":"Linux Fundamentals 1","uri":"/posts/linux-fundamentals/linux-fundamentals-1/"},{"categories":["Linux"],"content":"find\rSearches for files and directories. user@linux:~$ find / -name file1.txt ./home/user/Documents/file1.txt To search every txt files: find / -name \"*.txt\". Remember to use quotes. To search files whose name starts with fi: find / -name \"fi*\" ","date":"2022-04-12","objectID":"/posts/linux-fundamentals/linux-fundamentals-1/:1:11","tags":null,"title":"Linux Fundamentals 1","uri":"/posts/linux-fundamentals/linux-fundamentals-1/"},{"categories":["Linux"],"content":"grep\rgrep shorts for Global Regular Expression Print. It searches for a pattern in a file or files. let’s we have a file named file1.txt with the following content: This is file1 with example content. this is the line 2. To search for the word example in the file, use the following command: user@linux:~$ grep \"example\" file1.txt This is file1 with example content. Option Description -i Ignores case. -n Displays line numbers. -c Displays the count of matching lines. -r Searches recursively in directories. -lr Displays only the names of files with matching lines, recursively. ","date":"2022-04-12","objectID":"/posts/linux-fundamentals/linux-fundamentals-1/:1:12","tags":null,"title":"Linux Fundamentals 1","uri":"/posts/linux-fundamentals/linux-fundamentals-1/"},{"categories":["Linux"],"content":"head and tail\rhead Displays the first few lines of a file. head file1.txt displays the first 10 lines of the file. head -n 5 file1.txt displays the first 5 lines of the file. tail Displays the last few lines of a file. tail file1.txt displays the last 10 lines of the file. tail -n 5 file1.txt displays the last 5 lines of the file. ","date":"2022-04-12","objectID":"/posts/linux-fundamentals/linux-fundamentals-1/:1:13","tags":null,"title":"Linux Fundamentals 1","uri":"/posts/linux-fundamentals/linux-fundamentals-1/"},{"categories":["Linux"],"content":"less\rDisplays the contents of a file one page at a time. less file1.txt displays the contents of the file. Press q to exit the less command. ","date":"2022-04-12","objectID":"/posts/linux-fundamentals/linux-fundamentals-1/:1:14","tags":null,"title":"Linux Fundamentals 1","uri":"/posts/linux-fundamentals/linux-fundamentals-1/"},{"categories":["Linux"],"content":"Introduction to shell operators\r","date":"2022-04-12","objectID":"/posts/linux-fundamentals/linux-fundamentals-1/:2:0","tags":null,"title":"Linux Fundamentals 1","uri":"/posts/linux-fundamentals/linux-fundamentals-1/"},{"categories":["Linux"],"content":"\u0026\rRuns a command in the background. command \u0026 ","date":"2022-04-12","objectID":"/posts/linux-fundamentals/linux-fundamentals-1/:2:1","tags":null,"title":"Linux Fundamentals 1","uri":"/posts/linux-fundamentals/linux-fundamentals-1/"},{"categories":["Linux"],"content":"\u0026\u0026\rRuns a command only if the previous command was successful. command1 \u0026\u0026 command2 ","date":"2022-04-12","objectID":"/posts/linux-fundamentals/linux-fundamentals-1/:2:2","tags":null,"title":"Linux Fundamentals 1","uri":"/posts/linux-fundamentals/linux-fundamentals-1/"},{"categories":["Linux"],"content":"\u003e\rRedirects the output of a command to a file. If the file already exists, it is overwritten. command \u003e file1.txt ","date":"2022-04-12","objectID":"/posts/linux-fundamentals/linux-fundamentals-1/:2:3","tags":null,"title":"Linux Fundamentals 1","uri":"/posts/linux-fundamentals/linux-fundamentals-1/"},{"categories":["Linux"],"content":"»\rAppends the output of a command to a file. If the file already exists, the output is appended to the end. command \u003e\u003e file1.txt ","date":"2022-04-12","objectID":"/posts/linux-fundamentals/linux-fundamentals-1/:2:4","tags":null,"title":"Linux Fundamentals 1","uri":"/posts/linux-fundamentals/linux-fundamentals-1/"},{"categories":["Linux"],"content":"|\rPipes the output of one command to another command. command1 | command2 pipes the output of command1 to command2. ls -l | grep \".txt\" lists all files in the current directory and pipes the output to grep to search for files with the .txt extension. ps aux --sort=-%mem | head -n 5 lists the top 5 processes consuming the most memory. du -h | sort -rh | head -n 5 lists the top 5 directories consuming the most disk space. ","date":"2022-04-12","objectID":"/posts/linux-fundamentals/linux-fundamentals-1/:2:5","tags":null,"title":"Linux Fundamentals 1","uri":"/posts/linux-fundamentals/linux-fundamentals-1/"},{"categories":["Linux"],"content":"File Permissions in Linux\rIn Linux, each file and directory has three types of permissions: read, write, and execute. These permissions are assigned to three entities: the owner, the group, and others. To view the permissions of a file or directory, use the ls -l command. user@linux:~$ ls -l file1.txt -rw-r--r-- 1 user user 0 Jun 12 00:37 file1.txt - indicates a regular file. rw- indicates that the owner has read and write permissions. r-- indicates that the group has read permissions. r-- indicates that others have read permissions. Numeric values are used to represent permissions. r is represented by 4, w is represented by 2, and x is represented by 1. rwx is represented by 7, rw- is represented by 6, r-x is represented by 5, and r-- is represented by 4, --- is represented by 0. Some Basic Permissions: Symbolic Representation Numeric Value Description rw-r–r– 644 Read and write permissions for the owner, read permissions for the group and others. rwxr-xr-x 755 Read, write, and execute permissions for the owner, read and execute permissions for the group and others. rwxrwxrwx 777 Read, write, and execute permissions for the owner, group, and others. rw-rw-rw- 666 Read and write permissions for the owner, group, and others. rwx—— 700 Read, write, and execute permissions for the owner only. r——– 400 Read permissions for the owner only. r-x—— 500 Read and execute permissions for the owner only. ","date":"2022-04-12","objectID":"/posts/linux-fundamentals/linux-fundamentals-1/:3:0","tags":null,"title":"Linux Fundamentals 1","uri":"/posts/linux-fundamentals/linux-fundamentals-1/"},{"categories":["Linux"],"content":"chmod\rChanges the permissions of a file or directory. chmod 777 file1.txt grants read, write, and execute permissions to the owner, group, and others. chmod 755 file1.txt grants read, write, and execute permissions to the owner and read and execute permissions to the group and others. ","date":"2022-04-12","objectID":"/posts/linux-fundamentals/linux-fundamentals-1/:3:1","tags":null,"title":"Linux Fundamentals 1","uri":"/posts/linux-fundamentals/linux-fundamentals-1/"},{"categories":["Linux"],"content":"chown\rChanges the owner of a file or directory. chown user1 file1.txt changes the owner of the file to user1. chown user1:group1 file1.txt changes the owner and group of the file to user1 and group1. ","date":"2022-04-12","objectID":"/posts/linux-fundamentals/linux-fundamentals-1/:3:2","tags":null,"title":"Linux Fundamentals 1","uri":"/posts/linux-fundamentals/linux-fundamentals-1/"},{"categories":["Linux"],"content":"Common Directories\r/etc - Contains system-wide configuration files. /var - Contains variable data files, such as logs and databases. /tmp - Contains temporary files. Once the system is rebooted, the files are deleted. /root - Home directory of the root user. ","date":"2022-04-12","objectID":"/posts/linux-fundamentals/linux-fundamentals-1/:4:0","tags":null,"title":"Linux Fundamentals 1","uri":"/posts/linux-fundamentals/linux-fundamentals-1/"},{"categories":["Linux"],"content":"Linux fundamentals part 2: practical pipes and filters in Bash, with commands like grep, awk, and sort explained step by step.","date":"2022-04-12","objectID":"/posts/linux-fundamentals/linux-fundamentals-2/","tags":null,"title":"Linux Fundamentals 2","uri":"/posts/linux-fundamentals/linux-fundamentals-2/"},{"categories":["Linux"],"content":"Let’s learn the practical use of pipes and filter. ls -l ~ | grep -v r$ | awk '{print $8}'|sort -nr The above command will list all the files in the home directory, exclude the files ending with ‘r’, print the 8th column, and sort the output in reverse order. Let’s break down the command: ls -l ~: Lists all the files in the home directory with detailed information. grep -v r$: Excludes the files ending with ‘r’. Here, -v is used to invert the match. $ is used to match the end of the line. ^ is used to match the beginning of the line. awk '{print $8}': Prints the 8th column of the output. awk is a powerful text processing tool. {print $8} is the action to be performed on the input. sort -nr: Sorts the output in reverse order. ","date":"2022-04-12","objectID":"/posts/linux-fundamentals/linux-fundamentals-2/:0:0","tags":null,"title":"Linux Fundamentals 2","uri":"/posts/linux-fundamentals/linux-fundamentals-2/"},{"categories":["Linux"],"content":"awk\rawk is a powerful text processing tool that allows you to manipulate text files. It is particularly useful for processing structured text files, such as CSV files. file.txt: Name, Age, Address Alice, 25, New York Bob, 30, Los Angeles Charlie, 22, Chicago To print the first column of the file, you can use the following awk command: awk -F, '{print $1}' file.txt Option Description -F, Specifies the field separator as a comma. Default is whitespace. {print $n} Prints the n-th field. $0 represents the entire line. $1, $2, etc., represent the first, second, etc., fields. ","date":"2022-04-12","objectID":"/posts/linux-fundamentals/linux-fundamentals-2/:0:1","tags":null,"title":"Linux Fundamentals 2","uri":"/posts/linux-fundamentals/linux-fundamentals-2/"},{"categories":null,"content":"About Chandra Kundu, a postdoc at the University of Central Florida: research on noisy and incomplete data, teaching, awards, and technical skills.","date":"0001-01-01","objectID":"/about/","tags":null,"title":"About","uri":"/about/"},{"categories":null,"content":"Hello, I’m Chandra Kundu, a postdoctoral scholar in the School of Data, Mathematical, and Statistical Sciences at the University of Central Florida, working with Dr. HanQin Cai. I received my Ph.D. in Big Data Analytics from UCF under his supervision. My research delves into the development and application of advanced machine learning and optimization techniques, particularly focusing on deep learning-augmented non-convex algorithms for large-scale matrix completion and Euclidean Distance Geometry problems. Supported by prestigious NSF grants, my work addresses critical challenges in areas such as image and video processing, hyperspectral imaging, biomedical data analysis, and sensor networks. My research contributions are aimed at pushing the boundaries of data science, uncovering meaningful insights, and solving complex real-world problems through innovative data-driven solutions. In addition to my research endeavors, I am deeply committed to education and mentorship. As an instructor of record at UCF, I have successfully guided over 300 undergraduate students through courses like Principles of Statistics, fostering a robust understanding of statistical methodologies and data science principles. My role extends beyond teaching, as I mentor students in advanced data analysis, machine learning, and data visualization techniques, preparing them to excel in the dynamic field of data science. My technical expertise spans a wide array of tools and technologies, including Python, R, MATLAB, PyTorch, TensorFlow, and cloud platforms like AWS and GCP. This diverse skill set enables me to craft sophisticated solutions and interactive visualizations that translate complex data into actionable insights. Recognized for my contributions, I have received numerous awards, including the Algorithms for Threat Detection (ATD) Challenge Winner by the National Geospatial Intelligence Agency and multiple scholarships and fellowships from UCF. These accolades reflect my commitment to excellence and my drive to make impactful contributions to the field of data science. Through the synergy of rigorous research and effective teaching, I strive to advance the frontier of data science and artificial intelligence and contribute to solving pressing societal challenges with data-driven innovations. ","date":"0001-01-01","objectID":"/about/:0:0","tags":null,"title":"About","uri":"/about/"},{"categories":null,"content":"Chandra Kundu develops principled, AI-driven algorithms for robust matrix completion, distance geometry, and recovering noisy or incomplete data.","date":"0001-01-01","objectID":"/research/","tags":null,"title":"Research","uri":"/research/"},{"categories":null,"content":"Research Overview\rMy research lies at the intersection of Mathematics and Artificial Intelligence. I develop efficient, theoretically grounded algorithms augmented by machine learning and neural networks for analyzing high-dimensional data that are often noisy, incomplete or corrupted. These methods have broad impact across hyperspectral imaging, video surveillance, biomedical data, and Internet of Things (IoT) systems. ","date":"0001-01-01","objectID":"/research/:1:0","tags":null,"title":"Research","uri":"/research/"},{"categories":null,"content":"Robust Matrix Completion\rA core area of my work is Robust Matrix Completion, an approach designed to simultaneously handle incomplete data and sparse outliers. I have developed algorithms such as Robust CUR Completion (RCURC) and Learned Robust Matrix Completion (LRMC), a deep learning-augmented framework that demonstrate strong performance across multiple domains: Video Surveillance: Video background subtraction. Imaging: Ultrasound imaging and face modeling. Remote Sensing: Cloud removal from multi-temporal satellite imagery. Video 1: Background subtraction using LRMC ","date":"0001-01-01","objectID":"/research/:1:1","tags":null,"title":"Research","uri":"/research/"},{"categories":null,"content":"Distance Geometry Problems\rI also focus on Distance Geometry problems, which involve finding the point configurations from the distances measured among those points. I’ve developed algorithms like Structured Robust Euclidean Distance Geometry (SREDG) and Robust Euclidean Distance Geometry via Dual Basis (RoDEoDB), which show strong results in critical applications: Localization: Sensor localization. Bioinformatics: Protein structure prediction (molecular conformation). Figure 1: Visual representation of reconstruction of Protein 1AX8 by RoDEoDB under different corruption levels. The reconstructed protein structure (in brown) closely aligns with the true protein structure (in blue). ","date":"0001-01-01","objectID":"/research/:1:2","tags":null,"title":"Research","uri":"/research/"},{"categories":null,"content":"Weighted Matrix Completion\rWeighted Matrix Completion (WMC) is another key area of my research, aimed at incorporating prior subspace information to improve recovery performance. One primary application is compressive hyperspectral imaging in pushbroom remote sensing. Hyperspectral data are acquired as a 3D cube of spatial pixels $(x, y)$ and spectral channels $(z)$, as shown in Figure 2. The central challenge is to reconstruct each high-dimensional data slice $D$ in real time from only a small, incomplete set of observed entries $b$. Figure 2: From satellite acquisition to ground reconstruction: DMD-based compression produces sparse measurements $b$, then weighted matrix completion recovers the hyperspectral slice $D$. We are currently developing a streaming WMC framework that leverages information from the previously reconstructed slice to guide recovery of the current slice. In addition, we use machine learning to adaptively learn slice-specific weights, enabling fast and accurate real-time reconstruction. ","date":"0001-01-01","objectID":"/research/:1:3","tags":null,"title":"Research","uri":"/research/"},{"categories":null,"content":"Collaborative Research\rAs a Data Scientist, my expertise extends to interdisciplinary research where I apply data-driven methods to challenges beyond core algorithms. I have worked with colleagues at the Nanoscience and Technology Center, UCF, applying machine learning to predict the discharge capacity of $\\text{MnO}_2$ cathodes for high-performance zinc-ion batteries. I have also contributed to digital humanities, using statistical techniques for authorship attribution. I am eager to continue pursuing research that bridges disciplines and leverages my strengths in data science. ","date":"0001-01-01","objectID":"/research/:1:4","tags":null,"title":"Research","uri":"/research/"},{"categories":null,"content":"Research \u0026 Publication\rCai, HanQin; Kundu, Chandra; Liu, Jialin; Yin, Wotao (2026). Deeply Learned Robust Matrix Completion for Large-scale Low-rank Data Recovery. IEEE Transactions on Pattern Analysis and Machine Intelligence (TPAMI). arXiv. (Equal contribution) Yengejeh, Amir Alipour; Tang, Larry; Bridge, Candice; Kundu, Chandra (2026). Exploring Scientific Literature Using Topic Modeling: A Practical Framework for Discovery and Classification. Informatics. Kundu, Chandra; Tasissa, Abiy; Cai, HanQin (2025). Structured Sampling for Robust Euclidean Distance Geometry. 59th Annual Conference on Information Sciences and Systems (CISS 2025). arXiv. Kundu, Chandra; Tasissa, Abiy; Cai, HanQin (2025). A Dual Basis Approach for Structured Robust Euclidean Distance Geometry. arXiv preprint arXiv:2505.18414. Chowdhury, N. A.; et al. (2025). Machine learning based prediction of MnO2 cathode discharge capacity for high-performance zinc-ion batteries. Physical Chemistry Chemical Physics (Royal Society of Chemistry). Cai, HanQin; Huang, Longxiu; Kundu, Chandra; Su, Bowen (2024). On the Robustness of Cross-Concentrated Sampling for Matrix Completion. 58th Annual Conference on Information Sciences and Systems (CISS 2024). arXiv. Zheng, L.; Zheng, H.; Kundu, Chandra (2023). Authorship Attribution via Occupancy Problem Type Indices. Journal of Quantitative Linguistics. Kundu, Chandra (2020). Book Genre Classification By Its Cover Using A Multi-view Learning Approach. M.S. thesis, Western Kentucky University. ","date":"0001-01-01","objectID":"/research/:2:0","tags":null,"title":"Research","uri":"/research/"},{"categories":null,"content":"Presentations and Talks\rUCF Statistics \u0026 Data Science Colloquium, Orlando, Florida. Talk: Learning Low-Rank Structure in Imaging and Geometry (with Dr. HanQin Cai). (April 2026) Foundations of AI Seminar, University of Central Florida, Orlando, Florida. Talk: Data-Driven Algorithms for Generalized Low-Rank Matrix Recovery. (March 2026) SIAM Conference on Mathematical \u0026 Computational Issues in the Geosciences (GS25) in Baton Rouge, Louisiana. Co-Author Presentation: Weighted Matrix Completion: Applications to Compressive Hyperspectral Imaging (Presented by Oscar Lopez). (October 2025) 59th Annual Conference on Information Sciences and Systems (CISS 2025), Baltimore, Maryland. Talk: Structured Sampling for Robust Euclidean Distance Geometry. (March, 2025) Annual ASA Florida Chapter Meeting, Orlando, Florida. Poster Presentation: Deep Learning-Augmented Robust Matrix Completion for Cloud Removal in Satellite Imagery. (February, 2025) SIAM Conference on Mathematics of Data Science (MDS24), Atlanta, Georgia. Poster Presentation: Learned Large-Scale Robust Matrix Completion Via Deep Unfolding - Application to Cloud Removal from Multi-Temporal Satellite Imagery. (October, 2024) SIAM Conference on Imaging Science (IS24), Atlanta, Georgia. Poster Presentation: Learned Large-Scale Robust Matrix Completion Via Deep Unfolding - Application to Video Background Subtraction. (May, 2024) 58th Annual Conference on Information Sciences and Systems (CISS 2024), Princeton, New Jersey. Co-Author Presentation: On the Robustness of Cross-Concentrated Sampling for Matrix Completion (Presented by Dr. HanQin Cai). (March, 2024) Math Graduate Student Seminar, Western Kentucky University. Invited Talk: A Trainable Approach to Large-Scale Robust Matrix Completion. (February, 2024) Algorithms for Threat Detection (ATD) PI Workshop, Fairfax, Virginia. Co-Author Presentation: Geopolitical Event Forecasting: A Quantile-Based Approach Integrating Gaussian Process Regression and Temporal Fusion Transformer (Presented by Hayden Hampton). (October 2023) 39th Annual Mathematics Symposium, Western Kentucky University. Talk: Authorship Attribution via Occupancy Problem Type Indices. (November, 2019) ","date":"0001-01-01","objectID":"/research/:3:0","tags":null,"title":"Research","uri":"/research/"},{"categories":null,"content":"Reviewer Service\rInternational Conference on Big Data, IoT and Machine Learning (BIM) (2023) ","date":"0001-01-01","objectID":"/research/:4:0","tags":null,"title":"Research","uri":"/research/"},{"categories":null,"content":"Funding \u0026 Support\rNonconvex Models for Structured Sensing: Theory, Algorithms, and Applications, NSF. ($121,425) Role: Research Assistant PI: HanQin Cai ","date":"0001-01-01","objectID":"/research/:5:0","tags":null,"title":"Research","uri":"/research/"},{"categories":null,"content":"Chandra Kundu taught Principles of Statistics at UCF and College Algebra at Western Kentucky University, and assisted in statistics and calculus courses.","date":"0001-01-01","objectID":"/teaching/","tags":null,"title":"Teaching","uri":"/teaching/"},{"categories":null,"content":"My teaching philosophy centers on the 3Cs: Curiosity, Clarity, and Connection. I believe effective instruction should move beyond content delivery to spark intellectual exploration and empower students to become confident, competent contributors to their fields. I foster Curiosity by integrating real-world data and applications from diverse fields (healthcare, business, social sciences) to demonstrate the practical relevance of statistics and data science. I promote Clarity by structuring every class with clear learning goals, using guided notes to facilitate active learning, and providing prompt, actionable feedback through low-stakes quizzes and mid-semester surveys. Finally, I build Connection by establishing a welcoming classroom culture where students feel safe to ask questions, learn collaboratively through guided notes, and know that I am genuinely invested in their academic success and growth. ","date":"0001-01-01","objectID":"/teaching/:0:0","tags":null,"title":"Teaching","uri":"/teaching/"},{"categories":null,"content":"Teaching Experience\rGraduate Teaching Associate, University of Central Florida, Orlando, Florida (August 2020 – May 2024) Graduate Teaching Assistant, Western Kentucky University, Bowling Green, Kentucky (August 2018 – May 2020) ","date":"0001-01-01","objectID":"/teaching/:1:0","tags":null,"title":"Teaching","uri":"/teaching/"},{"categories":null,"content":"Courses Taught\r","date":"0001-01-01","objectID":"/teaching/:2:0","tags":null,"title":"Teaching","uri":"/teaching/"},{"categories":null,"content":"Instructor - University of Central Florida\rSTA 2014: Principles of Statistics (Enrollment: 62) - Fall 2023 STA 2014: Principles of Statistics (Enrollment: 58) - Fall 2022 STA 2014: Principles of Statistics (Enrollment: 60) - Spring 2022 STA 2014: Principles of Statistics (Enrollment: 63) - Fall 2021 STA 2014: Principles of Statistics (Enrollment: 58) - Spring 2021 STA 2014: Principles of Statistics (Enrollment: 62) - Fall 2020 ","date":"0001-01-01","objectID":"/teaching/:2:1","tags":null,"title":"Teaching","uri":"/teaching/"},{"categories":null,"content":"Invited Guest Lecturer - University of Central Florida\rSTA 4365: Statistical Foundations of Data Science and Artificial Intelligence II (Topic: Learning to Optimize) - Spring 2025 STA 6367: Statistical Methodology for Data Science II (Topic: Data Science Project Management) - Spring 2024 ","date":"0001-01-01","objectID":"/teaching/:2:2","tags":null,"title":"Teaching","uri":"/teaching/"},{"categories":null,"content":"Teaching Assistant - University of Central Florida\rSTA 6367: Statistical Methodology for Data Science II (Enrollment: 18) - Spring 2024 STA 6246: Linear Models (Enrollment: 15) - Spring 2024 STA 4164: Statistical Method III (Section 1, Enrollment: 35) - Spring 2023 STA 4164: Statistical Method III (Section 2, Enrollment: 23) - Spring 2023 ","date":"0001-01-01","objectID":"/teaching/:2:3","tags":null,"title":"Teaching","uri":"/teaching/"},{"categories":null,"content":"Instructor - Western Kentucky University\rMATH 116: College Algebra (Enrollment: 32) - Spring 2020 ","date":"0001-01-01","objectID":"/teaching/:2:4","tags":null,"title":"Teaching","uri":"/teaching/"},{"categories":null,"content":"Teaching Assistant - Western Kentucky University\rMATH 136H: Calculus I (2 Sections) - Fall 2019 MATH 237: Multivariable Calculus - Summer 2019 MATH 136: Calculus I (2 Sections) - Spring 2019 MATH 136: Calculus I (2 Sections) - Fall 2018 ","date":"0001-01-01","objectID":"/teaching/:2:5","tags":null,"title":"Teaching","uri":"/teaching/"}]