{"id":36838070,"url":"https://github.com/racoelhosilva/scripts","last_synced_at":"2026-01-12T14:25:54.822Z","repository":{"id":212854650,"uuid":"695871563","full_name":"racoelhosilva/scripts","owner":"racoelhosilva","description":"Collection of custom-made shell scripts to automate frequent operations on my Linux system both project and customization related","archived":false,"fork":false,"pushed_at":"2025-06-21T08:47:55.000Z","size":11,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-21T09:32:11.181Z","etag":null,"topics":["custom-scripts","linux-scripts","shell","shell-scripts"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/racoelhosilva.png","metadata":{"files":{"readme":"README.org","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-09-24T13:42:30.000Z","updated_at":"2025-06-21T08:47:59.000Z","dependencies_parsed_at":"2024-03-04T15:12:31.863Z","dependency_job_id":null,"html_url":"https://github.com/racoelhosilva/scripts","commit_stats":null,"previous_names":["racoelhosilva/scripts"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/racoelhosilva/scripts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/racoelhosilva%2Fscripts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/racoelhosilva%2Fscripts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/racoelhosilva%2Fscripts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/racoelhosilva%2Fscripts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/racoelhosilva","download_url":"https://codeload.github.com/racoelhosilva/scripts/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/racoelhosilva%2Fscripts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28340397,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T12:22:26.515Z","status":"ssl_error","status_checked_at":"2026-01-12T12:22:10.856Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["custom-scripts","linux-scripts","shell","shell-scripts"],"created_at":"2026-01-12T14:25:53.579Z","updated_at":"2026-01-12T14:25:54.796Z","avatar_url":"https://github.com/racoelhosilva.png","language":"Python","readme":"#+TITLE: Custom Shell Scripts\n#+AUTHOR: racoelhosilva\n#+DESCRIPTION: Collection of custom made shell scripts for various linux operations\n#+STARTUP: showeverything\n\nCollection of custom made shell scripts for various linux operations\n\n*** Table Of Contents :toc:\n- [[#desktop-configuration][Desktop Configuration]]\n  - [[#alacritty-theme-changer][Alacritty Theme Changer]]\n  - [[#background-changer][Background Changer]]\n- [[#leet-code][Leet Code]]\n  - [[#initialize-directory-structure][Initialize Directory Structure]]\n  - [[#create-a-problem-file][Create a Problem file]]\n  - [[#archive-the-file-and-update][Archive the File and Update]]\n\n* Desktop Configuration\n\n** Alacritty Theme Changer\n\nCustom script to quickly change the alacritty theme.\nTheme changes instantly. Themes should be placed inside \"THEME_DIR\".\nAlacritty config file should import that same theme file.\n\n*Commands:*\n- alacritty-themer ls :: Lists possible theme options\n- alacritty-themer \u003ctheme\u003e :: Changes the current theme\n\n#+BEGIN_SRC sh :tangle alacritty-themer :shebang \"#!/bin/bash\"\n\n# Specify the alacritty config and theme directory\nALACRITTY_DIR=\"$HOME/.config/alacritty\"\nTHEME_DIR=\"$HOME/.config/alacritty/themes\"\n\n# List theme options\nif [ \"$#\" = 0 ] || [ \"$1\" = \"ls\" ]; then\n\techo \"The current options are:\"\n\tls \"$THEME_DIR\" | sed 's/\\([a-z_0-9]*\\).yaml/ - \\1/g'\n\texit 0\nfi\n\n# Try to update the current theme\nif ls $THEME_DIR | grep -w \"$1.yaml\" \u003e/dev/null; then\n\tsed -i 's|\\('\"$THEME_DIR\"'/\\)[a-z_0-9]*\\(.yaml\\)|\\1'\"$1\"'\\2|' \"$ALACRITTY_DIR\"/alacritty.yml\n    exit 0\nelse\n\techo \"Couldn't change the theme. Please check spelling.\"\n\texit 1\nfi\n\n#+END_SRC\n\n** Background Changer\n\nCustom script to quickly change the background image.\nThis script assumes there is a single file in \"WALLPAPER_SRC\" which is the background sourced when booting the pc.\nWhat it does is replacing that file with copy of an image chosen from the \"WALLPAPER_DIR\".\n\n*Commands:*\n- chbg ls :: Lists possible wallpaper options\n- chbg \u003cimage\u003e :: Changes the wallpaper file and reloads it using 'feh'\n\n\n#+BEGIN_SRC sh :tangle chbg :shebang \"#!/bin/sh\"\n\n# Specify wallpaper directory and wallpaper sourced by applications\nWALLPAPER_DIR=\"$HOME/.config/wallpaper/collection\"\nWALLPAPER_SRC=\"$HOME/.config/wallpaper/wallpaper.png\"\n\n# List wallpaper options\nif [ \"$#\" = 0 ] || [ \"$1\" = \"ls\" ]; then\n\techo \"The wallpaper options are:\"\n\tls \"$WALLPAPER_DIR\" | sed 's/\\([a-z_0-9]*\\).png/ - \\1/g'\n\texit 0\nfi\n\n# Try to update the current wallpaper\nif ls $WALLPAPER_DIR | grep -w \"$1.png\" \u003e/dev/null; then\n\tcp \"$WALLPAPER_DIR\"/\"$1\".png \"$WALLPAPER_SRC\" 2\u003e/dev/null\n    feh --bg-fill $WALLPAPER_SRC\n    exit 0\nelse\n\techo \"Couldn't change the wallpaper. Please check spelling.\"\n\texit 1\nfi\n\n#+END_SRC\n\n* Leet Code\n\n** Initialize Directory Structure\n\n#+BEGIN_SRC sh :tangle lc-init :shebang \"#!/bin/bash\"\n\nif [ $# -gt 1 ] || [ \"$1\" = \"-h\" ] || [ \"$1\" = \"--help\" ]; then\n    echo \"$0 initializes the directory structure for LeetCode problem solving\"\n    echo \"$0 also creates a README file to track the progress of solved problems\"\n    exit 1\nfi\n\nTOPICS=(\n    \"Arrays \u0026 Hashing\"\n    \"Backtracking\"\n    \"Binary Search\"\n    \"Binary Trees\"\n    \"Bit Manipulation\"\n    \"Dynamic Programming 1D\"\n    \"Dynamic Programming 2D\"\n    \"Graphs\"\n    \"Graphs Advanced\"\n    \"Greedy\"\n    \"Intervals\"\n    \"Linked Lists\"\n    \"Math \u0026 Geometry\"\n    \"Priority Queue\"\n    \"Sliding Window\"\n    \"Stack\"\n    \"Tries\"\n    \"Two Pointers\"\n)\nDIFFICULTIES=(\n    \"Easy\"\n    \"Medium\"\n    \"Hard\"\n)\n\nfor TOPIC in \"${TOPICS[@]}\"; do\n    for DIFFICULTY in \"${DIFFICULTIES[@]}\"; do\n        mkdir -p \"$(pwd)\"/\"$TOPIC\"/\"$DIFFICULTY\"\n    done\ndone\n\n\ncat \u003e README.md \u003c\u003c EOF\n# LeetCode Solutions/Analysis\n\n\u003e Collection of my solutions to [LeetCode](https://leetcode.com) problems\n\n## Table of Contents\n  - [Progress Tracking](#progress-tracking)\n  - [Milestones](#milestones)\n  - [Useful Links](#useful-links)\n\n## Progress Tracking\n\n### Problems Solved\n\n| Total | 0 |\n|:---:|:---:|\n\n#### Search By Topic\n\n| Topic | Number |\n|:---|---:|\nEOF\n\nfor TOPIC in \"${TOPICS[@]}\"; do\n    echo \"| $TOPIC | 0 |\" \u003e\u003e README.md\ndone\n\ncat \u003e\u003e README.md \u003c\u003c EOF\n\n#### Search By Difficulty\n\n| Difficulty | Number |\n|:---|---:|\nEOF\n\nfor DIFFICULTY in \"${DIFFICULTIES[@]}\"; do\n    echo \"| $DIFFICULTY | 0 |\" \u003e\u003e README.md\ndone\n\ncat \u003e\u003e README.md \u003c\u003c EOF\n\n\n\n## Milestones\n\n| Date | Description |\n|------|-------------|\n|      |             |\n\n## Useful Links\nEOF\n\nexit 0\n\n#+END_SRC\n\n\n** Create a Problem file\n\n#+BEGIN_SRC sh :tangle lc-new :shebang \"#!/bin/bash\"\n\nif [ $# -lt 2 ] || [ \"$1\" = \"-h\" ] || [ \"$1\" = \"--help\" ]; then\n    echo \"$0 creates a new file to solve a specific problem\"\n    echo \"$0 takes at least two parameters (number and name)\"\n    echo \"Usage: $0 \u003cproblem_number\u003e \u003cproblem_name\u003e \u003cdifficulty\u003e \u003ctopic\u003e\"\n    exit 1\nfi\n\nNAME=${2// /}\ncat \u003e \"$1\"_\"$NAME\".cpp \u003c\u003c-EOF\n/* \n * Problem: $1 \n * Name: $2\n * Difficulty: $3\n * Topic: \n * Link: https://leetcode.com/problems/\n */\n \n#include \u003cbits/stdc++.h\u003e\nusing namespace std;\nEOF\n\nexit 0\n\n#+END_SRC\n\n** Archive the File and Update\n\n#+BEGIN_SRC sh :tangle lc-ar :shebang \"#!/bin/bash\"\n\nif [ $# -gt 2 ] || [ \"$1\" = \"-h\" ] || [ \"$1\" = \"--help\" ]; then\n    echo \"$0 archives a solve in the correct directory based on the Difficulty and Topic comments\"\n    echo \"$0 updates the README file, incrementing the corresponding values for the solved problems\"\n    echo \"$0 creates a commit with the file in the right position and a simple commit message\"\n    exit 1\nfi\n\nNUMBER=$(head -n 2 \u003c\"$1\" | tail -n 1 | cut -b 13-255)\nNAME=$(head -n 3 \u003c\"$1\" | tail -n 1 | cut -b 10-255)\nDIFFICULTY=$(head -n 4 \u003c\"$1\" | tail -n 1 | cut -b 16-255)\nTOPIC=$(head -n 5 \u003c\"$1\" | tail -n 1 | cut -b 11-255)\n\ncase \"$DIFFICULTY\" in\n\"Easy\" | \"Medium\" | \"Hard\") ;;\n*)\n    echo \"ERROR! Incorrect Difficulty value!\"\n    exit 1\n    ;;\nesac\n\ncase \"$TOPIC\" in\n\"Arrays \u0026 Hashing\" | \"Backtracking\" | \"Binary Search\" | \"Binary Trees\" | \"Bit Manipulation\" | \"Dynamic Programming 1D\" | \"Dynamic Programming 2D\" | \"Graphs\" | \"Graphs Advanced\" | \"Greedy\" | \"Intervals\" | \"Linked Lists\" | \"Math \u0026 Geometry\" | \"Priority Queue\" | \"Sliding Window\" | \"Stack\" | \"Tries\" | \"Two Pointers\") ;;\n*)\n    echo \"ERROR! Incorrect Topic Name!\"\n    exit 1;\n    ;;\nesac\n\nmv \"$1\" \"$TOPIC\"/\"$DIFFICULTY\"\n\nsed -ri 's/(\\| )('\"$TOPIC\"'[[:space:]]\\|[[:space:]])([0-9]+)( \\|)/echo \"\\1\\2$((\\3+1))\\4\"/ge' README.md\n\nsed -ri 's/(\\| )('\"$DIFFICULTY\"'[[:space:]]\\|[[:space:]])([0-9]+)( \\|)/echo \"\\1\\2$((\\3+1))\\4\"/ge' README.md\n\nsed -ri 's/(\\| )(Total[[:space:]]\\|[[:space:]])([0-9]+)( \\|)/echo \"\\1\\2$((\\3+1))\\4\"/ge' README.md\n\n\ngit add \"$TOPIC\"/\"$DIFFICULTY\"/\"$1\" README.md\ngit commit -a -m \"Solved problem $NUMBER: $NAME\"\n\nexit 0\n#+END_SRC\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fracoelhosilva%2Fscripts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fracoelhosilva%2Fscripts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fracoelhosilva%2Fscripts/lists"}