Skip to content

Instantly share code, notes, and snippets.

@bglopez
bglopez / Bash Script for Package Installation and Error Handling.md
Created February 7, 2026 19:25 — forked from peers8862/Bash Script for Package Installation and Error Handling.md
This code snippet sets up a bash environment for bash session, clears any previously cached commands or functions. It also checks if the backports repo is added and installs it from another repository using Docker's package-cache command.

Bash Script for Package Installation and Error Handling

Preview:
#!/usr/bin/env bash
set -euo pipefail

# -------------------------------
# Force clean start for Bash session
# -------------------------------
# Clear any previously cached commands or functions
for line in $(cat docker-compose-integration-tests.yml | tr ' ' '\n' | sort -u | grep -Po '\${.+}' )
do
var="${line/\$/""}"
var="${var/\{/""}"
var="${var/\}/""}"
var=$(echo "$var" | cut -d ":" -f 1 | xargs)
if [[ -z "${!var}" ]]; then
echo "Enter $var value:" && read _value
export $var=$_value
echo "$var=$_value" >>.env
@bglopez
bglopez / README.md
Created February 7, 2026 16:56 — forked from devinci-it/README.md
This repository contains a collection of utility bash scripts for various tasks.

Utility Bash Scripts

This repository contains a collection of utility bash scripts for various tasks.

Usage

To use any of the scripts in this repository:

  1. Clone the repository or download the desired script.
  2. Make the script executable using the chmod +x command.
@bglopez
bglopez / gist:6c7817cfe6b7acfba73e79b57b7fdad6
Created May 26, 2024 13:57 — forked from chrisdone/gist:02e165a0004be33734ac2334f215380e
Build and run minimal Linux / Busybox systems in Qemu

Common

export OPT=/opt
export BUILDS=/some/where/mini_linux
mkdir -p $BUILDS

Linux kernel

@bglopez
bglopez / settings.jsonc
Created March 6, 2024 02:41 — forked from hyperupcall/settings.jsonc
VSCode config to disable popular extensions' annoyances (telemetry, notifications, welcome pages, etc.)
// I'm tired of extensions that automatically:
// - show welcome pages / walkthroughs
// - show release notes
// - send telemetry
// - recommend things
//
// This disables all of that stuff.
// If you have more config, leave a comment so I can add it!!
{
@bglopez
bglopez / convert.sh
Last active May 30, 2023 03:43 — forked from Lili1228/convert.sh
Convert Manjaro to Arch
#!/bin/bash
# https://www.gnu.org/licenses/old-licenses/gpl-2.0.html, who cares
#
# Tested on freshly installed Manjaro 22.0.5 Gnome.
pamac build trizen
cat >/tmp/convert.sh <<EOF
pacman -Qq | grep pamac | xargs pacman -Rs --noconfirm pamac-gtk web-installer-url-handler manjaro-hello libpamac pamac-cli libpamac-flatpak-plugin manjaro-application-utility
pacman -Rdd manjaro-release bashrc-manjaro manjaro-keyring
pacman -U https://www.archlinux.org/packages/core/x86_64/pacman/download/ https://www.archlinux.org/packages/core/any/pacman-mirrorlist/download/ https://www.archlinux.org/packages/community/any/lsb-release/download/
mv /etc/pacman.d/mirrorlist.pacnew /etc/pacman.d/mirrorlist
@bglopez
bglopez / nb_to_mvn.pl
Created May 29, 2023 21:36 — forked from abbaspour/nb_to_mvn.pl
Convert a NetBeans project to Maven
#!/usr/bin/perl
# generates Maven pom.xml based on nbproject
# d640492
use strict;
use warnings;
use File::Basename;
@bglopez
bglopez / rscan.js
Created May 25, 2023 17:02 — forked from 80sVectorz/rscan.js
Recursive scan terminal command for outputing an ascii tree representation of the network.
//Bitburner script: https://github.com/bitburner-official/bitburner-src https://store.steampowered.com/app/1812820/Bitburner/
//Recursive scan terminal command for displaying an ascii art tree representation of the full network:
// rscan --detailed
// -------------------Network Tree-------------------|-|Balance|-|Hack Chance|-|Security LVL|-|Root?|
// home----------------------------------------------| $387.370m 99% 1% [X]
// ├─n00dles | $62.856k 99% 1% [X]
// │ ├─zer0------------------------------------------| $3.717m 75% 8% [X]
// │ │ ├─silver-helix | $20.868m 57% 11% [X]
// . . . . ... ... ... ...
// . . . . ... ... ... ...
@bglopez
bglopez / sentinel.mrc
Created December 20, 2022 22:01 — forked from EdGruberman/sentinel.mrc
mIRC TFC Server Management Script
on *:START:{ sentinel.load }
on *:EXIT:{ sentinel.unload }
on *:CONNECT:{ if ( $hget(sentinel.general,autoactivate) == 1 && $hget(sentinel.general.status,activated) != 1 ) sentinel.activate }
alias sentinel.load {
;--Load settings from ini file into hash tables
hmake sentinel.irc 5
hload -i sentinel.irc sentinel.ini irc
if ( $hget(sentinel.irc,admin) == $null ) hadd sentinel.irc admin #clan.private password
if ( $hget(sentinel.irc,tv) == $null ) hadd sentinel.irc tv #clan.tv
if ( $hget(sentinel.irc,monitor) == $null ) hadd sentinel.irc monitor #clan