Ausnahme gefangen: SSL certificate problem: certificate is not yet valid ๐Ÿ“Œ HPR4088: Today I Learnt more Bash tips

๐Ÿ  Team IT Security News

TSecurity.de ist eine Online-Plattform, die sich auf die Bereitstellung von Informationen,alle 15 Minuten neuste Nachrichten, Bildungsressourcen und Dienstleistungen rund um das Thema IT-Sicherheit spezialisiert hat.
Ob es sich um aktuelle Nachrichten, Fachartikel, Blogbeitrรคge, Webinare, Tutorials, oder Tipps & Tricks handelt, TSecurity.de bietet seinen Nutzern einen umfassenden รœberblick รผber die wichtigsten Aspekte der IT-Sicherheit in einer sich stรคndig verรคndernden digitalen Welt.

16.12.2023 - TIP: Wer den Cookie Consent Banner akzeptiert, kann z.B. von Englisch nach Deutsch รผbersetzen, erst Englisch auswรคhlen dann wieder Deutsch!

Google Android Playstore Download Button fรผr Team IT Security



๐Ÿ“š HPR4088: Today I Learnt more Bash tips


๐Ÿ’ก Newskategorie: Podcasts
๐Ÿ”— Quelle: hackerpublicradio.org

Today I Learnt more Bash tips

Sgoti talks about supplying options to bash scripts

  • Tags: Bash tips, TIL, getopts
#!/bin/bash
# License: GPL v3
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <https://www.gnu.org/licenses/>.

#Name: showtime.sh
#Purpose: Time to make a show.
#Version: beta 0.01
#Author: SGOTI (Some Guy On The Internet)
#Date: 2023-12-29

#variables:

bindir=/usr/bin/

cat=${bindir}cat
date=${bindir}date
echo=${bindir}echo
mkdir=${bindir}mkdir

dirshow0=${HOME}/Music/hpr/shows
dirshow1=${dirshow0}/$(${date} +%Y)
dirqueue=${dirshow1}/queue/$(${date} +%F)
dirreserve=${dirshow1}/reserve-queue/$(${date} +%F)

#start:

function help() {
${cat} << EOH
Usage: $0 [-s] [-r] [-q] [-h] name-of-show

    -s    (Regular queue)
    -r    (Reserve queue)
    -q    (quit)
    -h    (help)

Examples:
        $0 -s name-of-show
        $0 -r name-of-show
        $0 -q
        $0 -h

EOH
}

## Use `getopts` to read user option into script. ##
while getopts ":s:r:q:h" option; do
    case $option in
        s)
        show=$OPTARG

function mkq () {
    ${mkdir} -v -p ${dirqueue}/${show}/edit;
    ${mkdir} -v -p ${dirqueue}/${show}/prod;
    ${cat} > ${dirqueue}/${show}/edit/${show}.md << _EOD_
# ${show} #

## subtitle ##

- Tags:



This work is licensed under a [Creative Commons Attribution-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-sa/4.0/ "CC-BY-SA 4.0 International").

_EOD_

    builtin pushd -n ${dirqueue}/${show}/edit;
    builtin pushd -n ${dirqueue}/${show}/prod;
}

        if [ -d ${dirshow1} ]; then
            mkq
        else
            ${echo} "Good Heavens! It's a new year.";
            ${mkdir} -v -p ${dirshow1};

            mkq
        fi
        ;;

        r)
        reserve=$OPTARG
function mkr () {
    ${mkdir} -v -p ${dirreserve}/${reserve}/edit;
    ${mkdir} -v -p ${dirreserve}/${reserve}/prod;
    ${cat} > ${dirreserve}/${reserve}/edit/${reserve}.md << _EOD_
# ${reserve} #

## subtitle ##

- Tags:



This work is licensed under a [Creative Commons Attribution-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-sa/4.0/ "CC-BY-SA 4.0 International").

_EOD_

    builtin pushd -n ${dirreserve}/${reserve}/edit;
    builtin pushd -n ${dirreserve}/${reserve}/prod;
}

        if [ -d ${dirshow1} ]; then
            mkr
        else
            ${echo} "Good Heavens! It's a new year.";
            ${mkdir} -v -p ${dirshow1};

            mkr
        fi
        ;;

        q)
        ${echo} "Goodbye.";
        exit
        ;;

        h)
        help
        exit
        ;;

        *)
        if [ -z "${option}" ]; then
            help
            exit 1
        fi

        ${echo} "Good Heavens! Invalid input.";
        help
        exit
        ;;
    esac
done


exit;
#!/bin/bash
# License: GPL v3
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <https://www.gnu.org/licenses/>.

#Name: sc.sh
#Purpose:
#Version: beta 0.01
#Author: SGOTI (Some Guy On The Internet)
#Date: 2023-12-31

#variables:

bindir=/usr/bin/

cat=${bindir}cat
date=${bindir}date
echo=${bindir}echo
ls=${bindir}ls
screen=${bindir}screen

#start:

    ${echo} -e "nStep 0: $(${date} +%F), $(${date} +%T)";

function help() {
${cat} << EOH
Usage: $0 [-b] [-s] [-k] [-h] name-of-show

    -b [y|n] (Create or kill, base sockets.)
    -s       (Create new sockets.)
    -k       (Kill sockets.)
    -h       (help menu)

Examples:
        $0 -b y
        $0 -b n
        $0 -s name-of-socket
        $0 -k name-of-socket
        $0 -h

EOH
}

    ${echo} -e "nStep 1: $(${date} +%F), $(${date} +%T)";

while getopts ":b:s:k:h:" option; do
    case "${option}" in
        b)
        userinput0=$OPTARG
        if [ ${userinput0} == "y" ]; then
        ${screen} -dmS apps;
        ${screen} -dmS jobby;
        ${screen} -ls;
        elif [ ${userinput0} == "n" ]; then
        # You don't need the entire name to kill the socket.
        ${screen} -X -S "app" kill
        ${screen} -X -S "job" kill
        ${screen} -ls;
        else
        ${echo} "Good Heavens!"
        ${screen} -ls;
            help
            exit 1
        fi
        ;;

        s)
        userinput0=$OPTARG
        ${screen} -dmS "${userinput0}";
            clear
        ${screen} -ls;
            ${echo} -e "nNew sockets: $(${date} +%F), $(${date} +%T)";
        ;;

        k)
        userinput0=$OPTARG
        ${screen} -XS ${userinput0} kill
            clear
        ${screen} -ls;
            ${echo} -e "nKill sockets: $(${date} +%F), $(${date} +%T)";
        ;;

        h)
        help
            ${echo} -e "nHelp menu: $(${date} +%F), $(${date} +%T)";
        exit
        ;;

        *)
        if [ -z "${option}" ]; then
            help
            exit 1
        fi

        ${echo} "Good Heavens! Invalid input.";
        help
        exit
        ;;
    esac
done

    ${echo} -e "nStep 2: $(${date} +%F), $(${date} +%T)";

exit;

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

...



๐Ÿ“Œ HPR4088: Today I Learnt more Bash tips


๐Ÿ“ˆ 95.3 Punkte

๐Ÿ“Œ HPR4002: Today I learnt - 2023-11-24


๐Ÿ“ˆ 32.59 Punkte

๐Ÿ“Œ HPR4016: Today I learnt


๐Ÿ“ˆ 32.59 Punkte

๐Ÿ“Œ HPR4027: Today I learnt (2023-12-18)


๐Ÿ“ˆ 32.59 Punkte

๐Ÿ“Œ HPR4048: Today I learnt: Shipโ€™s Bells


๐Ÿ“ˆ 32.59 Punkte

๐Ÿ“Œ niieani/bash-oo-framework: Bash Infinity is a modern boilerplate / framework / standard library for bash


๐Ÿ“ˆ 32.43 Punkte

๐Ÿ“Œ Bash Scripting - BASH Scripts For Heavy Commandline Users [Bash Snippets]


๐Ÿ“ˆ 32.43 Punkte

๐Ÿ“Œ Bash Scripting - BASH Scripts For Heavy Commandline Users [Bash Snippets]


๐Ÿ“ˆ 32.43 Punkte

๐Ÿ“Œ Back to bash: Inception, running bash inside bash


๐Ÿ“ˆ 32.43 Punkte

๐Ÿ“Œ How I Learnt To Code FUNCTIONALLY


๐Ÿ“ˆ 24.19 Punkte

๐Ÿ“Œ A year after devastating NotPetya outbreak, what have we learnt? Er, not a lot, says BlackBerry bod


๐Ÿ“ˆ 24.19 Punkte

๐Ÿ“Œ 10 Lessons I Learnt Building React Native Apps


๐Ÿ“ˆ 24.19 Punkte

๐Ÿ“Œ HPR3141: Lessons learnt from Magic the Gathering game design


๐Ÿ“ˆ 24.19 Punkte

๐Ÿ“Œ What Iโ€™ve learnt writing cyber strategies with grand scopes


๐Ÿ“ˆ 24.19 Punkte

๐Ÿ“Œ Have we learnt nothing from SolarWinds supply chain attacks? Not yet it appears


๐Ÿ“ˆ 24.19 Punkte

๐Ÿ“Œ Ethonline 2023, my experience, challenge, and Lessons Learnt


๐Ÿ“ˆ 24.19 Punkte

๐Ÿ“Œ LinkedIn Certificate Outage โ€“ Lesson Learnt


๐Ÿ“ˆ 24.19 Punkte

๐Ÿ“Œ LinkedIn Certificate Outage โ€“ Lesson Learnt


๐Ÿ“ˆ 24.19 Punkte

๐Ÿ“Œ 5 Lessons Learnt from BJJ that Are Applicable to Cybersecurity


๐Ÿ“ˆ 24.19 Punkte

๐Ÿ“Œ What Weโ€™ve Learnt From Home Learning During Lockdown


๐Ÿ“ˆ 24.19 Punkte

๐Ÿ“Œ What We Have Learnt Building a Global Security Conscious Culture


๐Ÿ“ˆ 24.19 Punkte

๐Ÿ“Œ What I learnt in 10 years as an entrepreneur


๐Ÿ“ˆ 24.19 Punkte

๐Ÿ“Œ Mozilla Open Source Project: 10 Things I Learnt.


๐Ÿ“ˆ 24.19 Punkte

๐Ÿ“Œ ๐ŸงLHB Linux Digest #22.12: Lesser Known Bash Tips, Block Devices and More


๐Ÿ“ˆ 23.77 Punkte

๐Ÿ“Œ [WIP] The Pure Bash Bible - Documenting pure bash ways to do various tasks.


๐Ÿ“ˆ 21.62 Punkte

๐Ÿ“Œ Semi-Linux Noob. What do the pro's prefer zshell/ohmyzsh OR Bash/bash-it?


๐Ÿ“ˆ 21.62 Punkte

๐Ÿ“Œ Sensible Bash : Small & opinionated selection of basic Bash configurations for a better command-line user experience


๐Ÿ“ˆ 21.62 Punkte

๐Ÿ“Œ Simple Bash Prompt โ€“ a fast, pretty, extendable and pure bash prompt


๐Ÿ“ˆ 21.62 Punkte

๐Ÿ“Œ Bash-Oneliner: A collection of handy Bash One-Liners and terminal tricks


๐Ÿ“ˆ 21.62 Punkte

๐Ÿ“Œ HPR3713: Bash snippet - short-circuit evaluation in Bash Boolean expressions


๐Ÿ“ˆ 21.62 Punkte

๐Ÿ“Œ GitHub - awesome-lists/awesome-bash: A curated list of delightful Bash scripts and resources.


๐Ÿ“ˆ 21.62 Punkte











matomo