Skip to content

Instantly share code, notes, and snippets.

View devinci-it's full-sized avatar
🐢

.vince devinci-it

🐢
View GitHub Profile
@devinci-it
devinci-it / ps1.sh
Created May 5, 2024 19:10
This function dynamically updates the Bash prompt based on the various customizations and indicators.
#!/bin/bash
# update_prompt() - Update the Bash prompt dynamically based on various conditions.
#
# This function dynamically updates the Bash prompt based on the following conditions:
# - Git status: Indicates if there are changes in the Git repository.
# - Python project: Displays "PY" if the current directory contains requirements.txt or Pipfile.
# - PHP project: Displays "PHP" if the current directory contains index.php.
# - Composer.json presence: Displays symbol ∬ if composer.json is present in the directory.
# - Presence of .env, venv, pipfile, or req.txt files: Displays symbol ≓ if any of these files are present.
@devinci-it
devinci-it / LICENSE.md
Created May 6, 2024 20:33
The gist offers a convenient command using `curl` to effortlessly download a `LICENSE.md` file. It aims to streamline the process of retrieving a standard license file during project development, particularly for projects relying on `curl` for file manipulation.

LICENSE.md

© 2024 | devinci-it

    Permission is hereby granted, free of charge, to any person obtaining
    a copy of this software and associated documentation files (the
 "Software"), to deal in the Software without restriction, including
@devinci-it
devinci-it / __init__.py
Last active May 7, 2024 01:38
This is a collection of Python utility modules aimed at streamlining development workflows and making the development process more enjoyable.
from .writer import write_file_with_prompt as write_cautious
from .banner import print_banner as banner
from .file_utils import copy_file_with_prompt as copy
@devinci-it
devinci-it / README.md
Created May 11, 2024 17:46
This Gist contains `.gitignore` templates tailored for different types of projects and environments. `.gitignore` files help ensure that certain files or directories are not tracked by Git, which can be useful for ignoring build artifacts, editor-specific files, and other generated files.

Useful .gitignore Templates

This Gist contains .gitignore templates tailored for different types of projects and environments. .gitignore files help ensure that certain files or directories are not tracked by Git, which can be useful for ignoring build artifacts, editor-specific files, and other generated files.

Usage

  1. Choose a Template: Browse through the available .gitignore templates in this Gist and select the one that best matches your project's requirements.

  2. Copy the Content: Open the chosen .gitignore file and copy its content.

@devinci-it
devinci-it / ubuntu_mantic_source_list
Created May 15, 2024 14:24
` sources.list` file for Ubuntu mantic repositories.
# Ubuntu Main Repositories
deb http://archive.ubuntu.com/ubuntu/ mantic main restricted
deb http://archive.ubuntu.com/ubuntu/ mantic-updates main restricted
deb http://security.ubuntu.com/ubuntu/ mantic-security main restricted
# Ubuntu Universe Repositories
deb http://archive.ubuntu.com/ubuntu/ mantic universe
deb http://archive.ubuntu.com/ubuntu/ mantic-updates universe
deb http://security.ubuntu.com/ubuntu/ mantic-security universe
@devinci-it
devinci-it / ssh_setup.sh
Created May 18, 2024 22:23
script snippet Script snippet to install OpenSSH server, configure it for key-based authentication, and add a public key for the specified user.
#!/bin/bash
# Update Ubuntu Packages
sudo apt update
sudo apt upgrade -y
# Install OpenSSH Server
sudo apt install openssh-server -y
# Start and Enable SSH Service
@devinci-it
devinci-it / xrdp.sh
Created May 19, 2024 18:59
This script installs and configures XRDP with XFCE on a Debian system.
#!/bin/bash
# This script installs and configures XRDP with XFCE on a Debian system.
#
# It performs the following steps:
# 1. Updates the system packages.
# 2. Installs XRDP.
# 3. Installs the XFCE desktop environment.
# 4. Configures XRDP to use XFCE by creating a .xsession file in the home directory.
# 5. Checks if the XRDP_PORT environment variable is set:
@devinci-it
devinci-it / Dockerfile
Created June 2, 2024 02:15
DOCKER file setup and config files for php/laravel local development environement.
; ******************************************************************************
; * Dockerfile for PHP Laravel Development Environment
; *
; * This Dockerfile creates a development environment for PHP Laravel projects.
; * It includes PHP 8.3, Composer, Node.js with npm, and Laravel Installer.
; *
; * Arguments:
; * - PROJECT_NAME: The name of the project/application.
; *
; * Environment Variables:

Quick Setup: Laravel with Docker

Step 1: Create Laravel Project with Docker

To set up a new Laravel project with Docker, you can use the following script. This will create a new Laravel project, set up Docker with a Dockerfile and docker-compose.yaml, and configure the .env file with MySQL settings.

Prerequisites

Make sure you have composer, docker, and docker-compose installed on your system.

@devinci-it
devinci-it / chroot_assist.sh
Created June 10, 2024 02:00
This script automates the process of entering a chroot environment.
#!/bin/bash
: '
Interactive Chroot Script
This script automates the process of entering a chroot environment. It lists available disks and partitions,
prompts the user to select a partition, mounts the necessary filesystems, and enters the chroot environment.
The script also provides a command (`exit-chroot`) to trigger the unmounting of filesystems and exit the script.
Functions: