diff --git a/G1BILLETS.sh b/G1BILLETS.sh index 8f1b03b..12aac7a 100755 --- a/G1BILLETS.sh +++ b/G1BILLETS.sh @@ -43,12 +43,18 @@ if [[ $MONTANT != "daemon" ]]; then echo "CREATION $NBbillets x G1BILLET - $STYLE - " - # CHECK IF $STYLE IMAGES EXIST - [[ ! -f ${MY_PATH}/images/g1${STYLE}.png ]] && echo "AJOUTER : ./images/g1${STYLE}.jpg" && exit 1 - [[ ! -f ${MY_PATH}/images/fond${STYLE}.jpg ]] && echo "STYLE INCONNU ? ./images/fond${STYLE}.jpg" && exit 1 - [[ ! -f ${MY_PATH}/images/logo${STYLE}.png ]] && echo "AJOUTER : ./images/logo${STYLE}.jpg" && exit 1 + ## DEFAULT STYLE FOLDER IS ${MY_PATH}/images/_ + [[ ${STYLE} == "" ]] && STYLE="_" - UNIQID=$(echo "${RANDOM}${RANDOM}${RANDOM}${RANDOM}" | tail -c-7) + # CHECK IF $STYLE IMAGES EXIST + [[ ! -f ${MY_PATH}/images/${STYLE}/g1.png ]] && ERROR="STYLE INCONNU ./images/${STYLE}/g1.png" && echo $ERROR && exit 1 + [[ ! -f ${MY_PATH}/images/${STYLE}/fond.jpg ]] && ERROR="STYLE INCONNU ./images/${STYLE}/fond.jpg" && echo $ERROR && exit 1 + [[ ! -f ${MY_PATH}/images/${STYLE}/logo.png ]] && ERROR="STYLE INCONNU ./images/${STYLE}/logo.png" && echo $ERROR && exit 1 + + ## THIS IS THE PASS for G1PASS + UNIQID=$(echo "${RANDOM}${RANDOM}${RANDOM}${RANDOM}" | tail -c-5) + [ $DICE -gt 4 ] && UNIQID=$(${MY_PATH}/diceware.sh 1 | xargs)$(echo "${RANDOM}${RANDOM}" | tail -c-5) + [ $DICE -gt 6 ] && UNIQID=$(${MY_PATH}/diceware.sh 1 | xargs)$(echo "${RANDOM}${RANDOM}" | tail -c-7) # CREATION DE $NBbillets BILLETS DE $MONTANT DU boucle=0; @@ -145,6 +151,24 @@ else fi RNAME="$HNAME:33102" + ## AVAILABLE STYLES + sytle=($(find ${MY_PATH}/images/* -type d | sort | rev | cut -d '/' -f 1 | rev)) + sytlenb=${#sytle[@]} + OPT="" + for stname in ${sytle[@]}; do + + pre=${stname:0:1} + + if [[ $pre == "_" ]]; then + OPT="${OPT}" + elif [[ $pre == "x" ]]; then + OPT="${OPT}" + else + OPT="${OPT}" + fi + + done + HTTPWELLCOME='HTTP/1.1 200 OK Access-Control-Allow-Origin: * Access-Control-Allow-Credentials: true @@ -196,8 +220,7 @@ function countdown() { @@ -258,23 +281,39 @@ function countdown() { MONTANT=$(urldecode ${arr[1]} | xargs); STYLE=$(urldecode ${arr[3]} | xargs); XPARM=$(urldecode ${arr[5]} | xargs); echo "DECODED : $ONE=$MONTANT & $TWO=$STYLE & $X=$XPARM" - [[ $STYLE == "dice" ]] && STYLE="" && XPARM=$X ## /?montant=0&type=&dice=1 + [[ $STYLE == "dice" ]] && STYLE="_" && XPARM=$X ## /?montant=0&type=&dice=1 ##################################################################### echo ${MY_PATH}/${ME} '"'$MONTANT'"' '"'$STYLE'"' '"'$XPARM'"' ##################################################################### # EXECUTE COMMAND LOG=$(${MY_PATH}/${ME} "$MONTANT" "$STYLE" "$XPARM") -echo "$LOG" + echo "$LOG" # echo $LOG # EXTRACT VALUES FROM SELF LOG IPNS=$(echo "$LOG" | grep '/ipns/') [[ $IPNS ]] && echo "TW IPNS : $IPNS" CURL=$(echo "$LOG" | grep -w curl) [[ $IPNS ]] && echo "LIEN ACTIVATION : $CURL" - + echo "=========" ## LAST LINE INFORMATION ZFILE=$(echo "$LOG" | tail -n 1) ### LAST LINE : INFORM DAEMON echo $ZFILE + echo "=========" + ### AUCUN RESULTAT + if [[ ! -s $ZFILE ]]; then + ( + echo "HTTP/1.1 200 OK +Access-Control-Allow-Origin: ${myASTROPORT} +Access-Control-Allow-Credentials: true +Access-Control-Allow-Methods: GET +Server: Astroport.ONE +Content-Type: text/html; charset=UTF-8 + +

ERROR $ZFILE

" | nc -l -p 33102 -q 1 > /dev/null 2>&1 \ + && rm -f "${MY_PATH}/tmp/http.${MOATS}" + ) & + + else ## FILE IS FOUND # PREPARE FILE SENDING FILE_NAME="$(basename "${ZFILE}")" @@ -297,24 +336,26 @@ Content-Length:'${BSIZE}' Content-Disposition: attachment; filename='${FILE_NAME}' ' > ${MY_PATH}/tmp/http.${MOATS} - cat ${ZFILE} >> ${MY_PATH}/tmp/http.${MOATS} + cat ${ZFILE} >> ${MY_PATH}/tmp/http.${MOATS} - # NETCAT PUBLISH port=33102 - echo "PUBLISHING ${MOATS} : $RNAME" + # NETCAT PUBLISH port=33102 + echo "PUBLISHING ${MOATS} : $RNAME" + + if [[ $XDG_SESSION_TYPE != 'x11' ]]; then + ( + cat ${MY_PATH}/tmp/http.${MOATS} | nc -l -p 33102 -q 1 > /dev/null 2>&1 \ + && rm -f "${MY_PATH}/tmp/http.${MOATS}" \ + && rm -f "${ZFILE}" \ + && rm -Rf "${ZFILE%.*}" \ + && echo "G1BILLETS FILE CONSUMED" + ) & + else + rm -f "${MY_PATH}/tmp/http.${MOATS}" \ + && rm -f "${ZFILE}" \ + && rm -Rf "${ZFILE%.*}" \ + && echo "G1BILLETS FILE CONSUMED" + fi - if [[ $XDG_SESSION_TYPE != 'x11' ]]; then - ( - cat ${MY_PATH}/tmp/http.${MOATS} | nc -l -p 33102 -q 1 > /dev/null 2>&1 \ - && rm -f "${MY_PATH}/tmp/http.${MOATS}" \ - && rm -f "${ZFILE}" \ - && rm -Rf "${ZFILE%.*}" \ - && echo "G1BILLETS FILE CONSUMED" - ) & - else - rm -f "${MY_PATH}/tmp/http.${MOATS}" \ - && rm -f "${ZFILE}" \ - && rm -Rf "${ZFILE%.*}" \ - && echo "G1BILLETS FILE CONSUMED" fi done diff --git a/MAKE_G1BILLET.sh b/MAKE_G1BILLET.sh index 2c7b09d..1b50e17 100755 --- a/MAKE_G1BILLET.sh +++ b/MAKE_G1BILLET.sh @@ -35,47 +35,47 @@ BILLETNAME=$(echo $SALT | sed 's/ /_/g') # Prepare June logo color case "$MONTANT" in 1) - convert "${MY_PATH}/images/g1${STYLE}.png" -fuzz 20% -fill grey -opaque '#e5912b' "${MY_PATH}/tmp/g1billet/${UNIQID}/g1.png" + convert "${MY_PATH}/images/${STYLE}/g1.png" -fuzz 20% -fill grey -opaque '#e5912b' "${MY_PATH}/tmp/g1billet/${UNIQID}/g1.png" ;; 2) - convert "${MY_PATH}/images/g1${STYLE}.png" -fuzz 20% -fill green -opaque '#e5912b' "${MY_PATH}/tmp/g1billet/${UNIQID}/g1.png" + convert "${MY_PATH}/images/${STYLE}/g1.png" -fuzz 20% -fill green -opaque '#e5912b' "${MY_PATH}/tmp/g1billet/${UNIQID}/g1.png" ;; 5) - convert "${MY_PATH}/images/g1${STYLE}.png" -fuzz 20% -fill orange -opaque '#e5912b' "${MY_PATH}/tmp/g1billet/${UNIQID}/g1.png" + convert "${MY_PATH}/images/${STYLE}/g1.png" -fuzz 20% -fill orange -opaque '#e5912b' "${MY_PATH}/tmp/g1billet/${UNIQID}/g1.png" ;; 10) - convert "${MY_PATH}/images/g1${STYLE}.png" -fuzz 20% -fill blue -opaque '#e5912b' "${MY_PATH}/tmp/g1billet/${UNIQID}/g1.png" + convert "${MY_PATH}/images/${STYLE}/g1.png" -fuzz 20% -fill blue -opaque '#e5912b' "${MY_PATH}/tmp/g1billet/${UNIQID}/g1.png" ;; 20) - convert "${MY_PATH}/images/g1${STYLE}.png" -fuzz 20% -fill purple -opaque '#e5912b' "${MY_PATH}/tmp/g1billet/${UNIQID}/g1.png" + convert "${MY_PATH}/images/${STYLE}/g1.png" -fuzz 20% -fill purple -opaque '#e5912b' "${MY_PATH}/tmp/g1billet/${UNIQID}/g1.png" ;; 50) - convert "${MY_PATH}/images/g1${STYLE}.png" -fuzz 20% -fill red -opaque '#e5912b' "${MY_PATH}/tmp/g1billet/${UNIQID}/g1.png" + convert "${MY_PATH}/images/${STYLE}/g1.png" -fuzz 20% -fill red -opaque '#e5912b' "${MY_PATH}/tmp/g1billet/${UNIQID}/g1.png" ;; 100) - convert "${MY_PATH}/images/g1${STYLE}.png" -fuzz 20% -fill black -opaque '#e5912b' "${MY_PATH}/tmp/g1billet/${UNIQID}/g1.png" + convert "${MY_PATH}/images/${STYLE}/g1.png" -fuzz 20% -fill black -opaque '#e5912b' "${MY_PATH}/tmp/g1billet/${UNIQID}/g1.png" ;; *) - cp "${MY_PATH}/images/g1${STYLE}.png" "${MY_PATH}/tmp/g1billet/${UNIQID}/g1.png" + cp "${MY_PATH}/images/${STYLE}/g1.png" "${MY_PATH}/tmp/g1billet/${UNIQID}/g1.png" ;; esac # Add ${MY_PATH}/images/logo.png (250px) composite -compose Over -gravity SouthWest -geometry +150+50 -dissolve 70% \ -"${MY_PATH}/images/logo${STYLE}.png" \ -"${MY_PATH}/images/fond${STYLE}.jpg" \ +"${MY_PATH}/images/${STYLE}/logo.png" \ +"${MY_PATH}/images/${STYLE}/fond.jpg" \ "${MY_PATH}/tmp/${BILLETNAME}.jpg" -# xbian style (ASTROPORT/KODI) + JEU -if [[ "${STYLE}" == "xbian" || "${STYLE}" == "jeu" || "${STYLE}" == "astro" ]] +# "G1PASS" (GPG+TW) STYLE : xbian, xjeu, xastro +if [[ "${STYLE:0:1}" == "x" ]] then if [[ $ASTRONAUTENS ]]; then ## IT IS AN ASTRONAUTENS IPNS LINK USALT=$(echo "$SALT" | jq -Rr @uri) UPEPPER=$(echo "$SECRET" | jq -Rr @uri) - echo "Making gpg of /?salt=${USALT}&pepper=${UPEPPER} with pass=$UNIQID" + echo "(≖‿‿≖) Making gpg of /?salt=${USALT}&pepper=${UPEPPER} with pass=$UNIQID" ## SECURED RANDOM salt : pepper GPG SEQUENCE s=$(${MY_PATH}/diceware.sh 1 | xargs) @@ -83,6 +83,8 @@ then echo "/?${s}=${USALT}&${p}=${UPEPPER}" > ~/.zen/tmp/topgp cat ~/.zen/tmp/topgp | gpg --symmetric --armor --batch --passphrase "$UNIQID" -o ${MY_PATH}/tmp/gpg.${BILLETNAME}.asc + rm ~/.zen/tmp/topgp ## CLEANING CACHE + DISCO="$(cat ${MY_PATH}/tmp/gpg.${BILLETNAME}.asc | tr '-' '~' | tr '\n' '-' | tr '+' '_' | jq -Rr @uri )" echo "$DISCO" ## Add logo to QRCode diff --git a/images/fond.jpg b/images/_/fond.jpg similarity index 100% rename from images/fond.jpg rename to images/_/fond.jpg diff --git a/images/g1.png b/images/_/g1.png similarity index 100% rename from images/g1.png rename to images/_/g1.png diff --git a/images/logo.png b/images/_/logo.png similarity index 100% rename from images/logo.png rename to images/_/logo.png diff --git a/images/g1magicien.png b/images/g1magicien.png new file mode 100644 index 0000000..ff1cb70 Binary files /dev/null and b/images/g1magicien.png differ diff --git a/images/g1ticket.png b/images/g1ticket.png deleted file mode 100644 index e0105b8..0000000 Binary files a/images/g1ticket.png and /dev/null differ diff --git a/images/fondsaubole.jpg b/images/saubole/fond.jpg similarity index 100% rename from images/fondsaubole.jpg rename to images/saubole/fond.jpg diff --git a/images/g1astro.png b/images/saubole/g1.png similarity index 100% rename from images/g1astro.png rename to images/saubole/g1.png diff --git a/images/logojeu.png b/images/saubole/logo.png similarity index 100% rename from images/logojeu.png rename to images/saubole/logo.png diff --git a/images/fondsolian.jpg b/images/solian/fond.jpg similarity index 100% rename from images/fondsolian.jpg rename to images/solian/fond.jpg diff --git a/images/g1solian.png b/images/solian/g1.png similarity index 100% rename from images/g1solian.png rename to images/solian/g1.png diff --git a/images/logosolian.png b/images/solian/logo.png similarity index 100% rename from images/logosolian.png rename to images/solian/logo.png diff --git a/images/fondticket.jpg b/images/ticket/fond.jpg similarity index 100% rename from images/fondticket.jpg rename to images/ticket/fond.jpg diff --git a/images/ticket/g1.png b/images/ticket/g1.png new file mode 100644 index 0000000..2dfd996 Binary files /dev/null and b/images/ticket/g1.png differ diff --git a/images/logoticket.png b/images/ticket/logo.png similarity index 100% rename from images/logoticket.png rename to images/ticket/logo.png diff --git a/images/aaafondastro.jpg b/images/xastro/aaafondastro.jpg similarity index 100% rename from images/aaafondastro.jpg rename to images/xastro/aaafondastro.jpg diff --git a/images/fondastro.jpg b/images/xastro/fond.jpg similarity index 100% rename from images/fondastro.jpg rename to images/xastro/fond.jpg diff --git a/images/xastro/g1.png b/images/xastro/g1.png new file mode 100644 index 0000000..f1cd5ac Binary files /dev/null and b/images/xastro/g1.png differ diff --git a/images/logoastro.png b/images/xastro/logo.png similarity index 100% rename from images/logoastro.png rename to images/xastro/logo.png diff --git a/images/fondxbian.jpg b/images/xbian/fond.jpg similarity index 100% rename from images/fondxbian.jpg rename to images/xbian/fond.jpg diff --git a/images/g1xbian.png b/images/xbian/g1.png similarity index 100% rename from images/g1xbian.png rename to images/xbian/g1.png diff --git a/images/logoxbian.png b/images/xbian/logo.png similarity index 100% rename from images/logoxbian.png rename to images/xbian/logo.png diff --git a/images/fondjeu.jpg b/images/xjeu/fond.jpg similarity index 100% rename from images/fondjeu.jpg rename to images/xjeu/fond.jpg diff --git a/images/fondjeu (autre copie).jpg b/images/xjeu/fondjeu (autre copie).jpg similarity index 100% rename from images/fondjeu (autre copie).jpg rename to images/xjeu/fondjeu (autre copie).jpg diff --git a/images/fondjeu (copie).jpg b/images/xjeu/fondjeu (copie).jpg similarity index 100% rename from images/fondjeu (copie).jpg rename to images/xjeu/fondjeu (copie).jpg diff --git a/images/g1jeu.png b/images/xjeu/g1.png similarity index 100% rename from images/g1jeu.png rename to images/xjeu/g1.png diff --git a/images/g1jeu (copie).png b/images/xjeu/g1jeu (copie).png similarity index 100% rename from images/g1jeu (copie).png rename to images/xjeu/g1jeu (copie).png diff --git a/images/xjeu/logo.png b/images/xjeu/logo.png new file mode 100644 index 0000000..51a7ef1 Binary files /dev/null and b/images/xjeu/logo.png differ diff --git a/search b/search new file mode 100755 index 0000000..d430b4a --- /dev/null +++ b/search @@ -0,0 +1,16 @@ +#!/bin/bash +clear +echo "------------------------------------------------------------------------------" +if [ "$1" == "" ]; then + echo " Nothing to search for!" +else + echo " Searching for "$1" recursively. Please Wait..." + echo "------------------------------------------------------------------------------" + grep -h -r --exclude=B00 -H --colour=always "$1" ./ +fi +echo "------------------------------------------------------------------------------" +if [ "$2" != "" ]; then + echo " To replace \"$1\" whith \"$2\", please run" + echo " grep -rl '$1' ./ | xargs sed -i 's~$1~$2~g'" +fi +## THIS IS A GREAT RETRO ENGINEERING AND CODING TOOLS