Skip to content

Instantly share code, notes, and snippets.

View LukeSavefrogs's full-sized avatar
💭
Thinking about what to script next

Luca Salvarani LukeSavefrogs

💭
Thinking about what to script next
View GitHub Profile

Cygwin Package Manager (native)

There are many alternatives out there for having an apt-like Package Manager for Cygwin (as well documented here) like:

But, as a challange, i didn't want to install anything and do everything i needed using only Cygwin inbuilt CLI commands.

On Cygwin FAQ webpage at chapter 2.3 you can find a list of all the parameters you can pass to the setup to automate things, like specify which architecture, proxy to use AND which packages to install or uninstall.

@LukeSavefrogs
LukeSavefrogs / test_parallel_processes.sh
Last active October 18, 2020 11:35
This gist shows an interesting use i've found of background processes and `wait` keyword. I spawn two processes with different duration and then wait for them to finish. The 2 processes run simultaneously and the script finishes once both have finished. It can be useful when you have to deal with long-running processes and want to optimize the t…
#!/bin/bash
# --------------------------------------------
# Here we could define our GLOBAL variables.
# Using `declare -r` makes the variable read-only (just like a constant in other languages)
# --------------------------------------------
declare -r BOLD='\033[1m';
declare -r NORMAL='\033[0m';
@LukeSavefrogs
LukeSavefrogs / install_apt-cyg.sh
Last active February 18, 2021 12:27
Utility to install and automatically configure `apt-cyg` with autocompletions
#!/bin/env bash
# Styling
declare -r red='\033[0;31m';
declare -r green='\033[0;32m';
declare -r yellow='\033[0;33m';
declare -r default='\033[0m';
declare -r bold='\033[1m';
declare -r underlined="\033[4m";
@LukeSavefrogs
LukeSavefrogs / progress-bar.sh
Last active January 2, 2022 02:27 — forked from F1LT3R/progress-bar.sh
Bash Progress Bar
#!/bin/bash
# Bash Progress Bar: https://gist.github.com/F1LT3R/fa7f102b08a514f2c535
# Function to draw progress bar
progressBar () {
local __message="";
local -i __current=0 __total=100;
local -i __progress_bar_width=50;
local -i __highlight_items=0 __highlighted=0;