Linux on Business

Why Linux 🐧? the question isn’t why Linux ? the real question is why not ? did you try it? Linux is widely regarded as the best option for development, DevOps, hybrid cloud solutions, and even as a desktop for home and office environments due to its open-source nature, robust ecosystem, scalability, security, and cost-effectiveness. Its flexibility allows seamless integration across diverse platforms, from small IoT devices to large-scale cloud infrastructures, making it the backbone of modern technology stacks. ...

🎨 Customize Your Terminal Shell with Oh My Bash

Oh My Bash is a powerful framework for managing your Bash configuration. By default, it offers various themes to personalize your terminal. But what if you want your terminal to dynamically change its theme based on the environment or directory you’re working in? This post will guide you through a script that achieves just that. The Script: Dynamic Theme Switching The following script dynamically updates the Oh My Bash theme based on your current environment and directory. Here’s the code: ...

2025-01-14 · map[name:Jose Castrillo]

👨‍💻 Tunning your Devbox shell

Using Oh-My-Bash with Jetify Devbox: A Step-by-Step Guide If you’re a developer working with Jetify Devbox, you might have noticed that its shell environment doesn’t always play nicely with Oh-My-Bash. By following these steps, you can customize and personalize your themes and PS1 prompt to create a more enjoyable and productive shell experience. Step 1: Install Oh-My-Bash First, you need to install Oh-My-Bash. You can do this by running the following command in your terminal: ...

Automation a Nextcloud as a Podman Container

I’ve been thinking to upgrade my Nextcloud service also switching to another alternative rather than docker, hence I used podman and buildah in my solution. From the rockylinux.org I found a nice post where it describes how to build and provisioning by using buildah and podman, it works pretty good and I added a tool in order to run it faster, called taskfile. Requirements: Podman Buildah Taskfile Install taskfile Clone my project From the project you can see the task defined: version: "3" tasks: up-db: dir: "db/mariadb" preconditions: - test -f db-init.sh cmds: - bash db-init.sh create-app: dir: "app" preconditions: - test -f run.sh cmds: - mkdir nc nc/nextcloud nc/apps nc/config nc/data - task: up-db - bash run.sh build_base: dir: "db/base" preconditions: - test -f build.sh cmds: - bash build.sh build_tools: dir: "db/db-tools" preconditions: - test -f build.sh cmds: - bash build.sh build_maria: dir: "db/mariadb" preconditions: - test -f build.sh cmds: - bash build.sh build_db: cmds: - task: build_base - task: build_tools - task: build_maria up-app: cmds: - podman container start nextcloud Main task to build and run nextcloud: ...

2024-06-30 · map[name:Jose Castrillo]

Goland CORS, logs and healtcheck

In this guide, we’ll walk through how to create CORS (Cross-Origin Resource Sharing) and a health check endpoint in a Golang application using the Chi router. Setting Up Chi and CORS Middleware We’ll use the go-chi/chi and go-chi/cors packages to handle routing and CORS in our application. Step 1: Import Required Packages First, make sure to import the necessary packages: import ( "fmt" "net/http" "log" "github.com/go-chi/chi" "github.com/go-chi/chi/middleware" "github.com/go-chi/cors" AdminMiddleware "github.com/project/api/middleware" "github.com/project/api/services" "gorm.io/gorm" ) Step 2: Define the CORS AllowOriginFunc We’ll define a function to specify the allowed origins for CORS. This function also logs disallowed origins: ...

2024-06-01 · map[name:Jose Castrillo]

Python & Virtual Environments

When starting a Python 3 project in Linux, it’s essential to follow best practices to ensure a clean and isolated development environment. One of the recommended approaches is to utilize virtual environments. Virtual environments allow you to create an isolated environment for each project, preventing conflicts between different packages and dependencies. In this guide, we’ll walk you through the steps to set up and activate a virtual environment for your Python 3 project. ...

2023-03-15 · map[name:Jose Castrillo]

Java Native Memory Tracking in GNU/linux

Java provides a Native Memory Tracking feature that enables you to monitor the memory usage of your Java application. This feature is particularly useful for identifying memory leaks and optimizing the memory usage of your application. In this post, we will discuss how to activate Native Memory Tracking for a Java jar application in Linux. Step 1: Check Java Version First, you need to check the version of Java installed on your system using the following command: ...

2023-01-10 · map[name:Jose Castrillo]

setup auto mount smb v1.0

In any case you still having a device that works with smb v1.0 you can use the following way in order to mount it on your Fedora host: Path: /etc/NetworkManager/dispatcher.d/smb-setup.sh #!/bin/sh -e # Script to dispatch NetworkManager events # more over: https://stackoverflow.com/questions/16848021/linux-networkmanagers-etc-networkmanager-dispatcher-d-test-script-does-not # Runs ifupdown scripts when NetworkManager fiddles with interfaces. # See NetworkManager(8) for further documentation of the dispatcher events. INF="$1" # your current interface name such as eth0, wlp4s0 and so on STA="$2" # status such as UP or DOWN # Send message to /var/log/messages logger -s "$0 called for interface named $INF with $STA ..." if [ "$INF" == "eno1" ] then mount -t cifs -o vers=1.0,username=admin,password=Tr3x_1986,uid=1000,gid=1000,forceuid,forcegid //10.34.1.1/1fea-6abb /home/jose/homedisk fi more info: ...

2022-05-27 · map[name:Jose Castrillo]

Ansible missing sudo

Ansible FAILED! => {"msg": "Missing sudo password"} I have a couple of ansible-playbook, from one of my endpoint device started to prompt missing sudo password due there is needed a sudoers access, thus this is one of the solutions. login by ssh to the device, where ansible can’t login. go to /etc/sudoers.d/ create a new entry eg: “023_user-nopass” add the following line “user ALL=(ALL) NOPASSWD: ALL” into the file “023_user-nopass” change the permission by using: sudo chmod 440 023_user-nopass NOTE: please change value for your normal user access -not the root one- ...

Install Hetzner-CLi on Fedora by Toolbox

On this new entry I will share a briefly installation step by step by using Toolbox at Fedora 34 to use the hcloud-cli. Due we do not have an official package on fedora git-repo yet, hence we can create this container. Pre-requirement: Visit Hetzner Cloud Console at https://console.hetzner.cloud, select your project, and create a new API Token. Let’s start: 1- Create a file named Dockerfile.debian with the following contents(the following image is made to use a script to named and set a token_key): ...

2021-07-04 · map[name:Jose Castrillo]