G1BILLET v1.0
31
G1BILLETS.sh
|
@ -12,7 +12,7 @@ ME="${0##*/}"
|
|||
[[ -d ${MY_PATH}/_images/_/ ]] \
|
||||
&& IMAGES="_images" \
|
||||
|| IMAGES="images"
|
||||
echo "USING ${IMAGES} STYLES"
|
||||
|
||||
|
||||
################################################################################
|
||||
# Create different king of G1BILLET(s) with $MONTANT DU or TW IPNS + G1PASS
|
||||
|
@ -33,19 +33,21 @@ if [[ $MONTANT != "daemon" ]]; then
|
|||
[[ $DICE != ?(-)+([0-9]) ]] && DICE=$(cat $MY_PATH/DICE 2>/dev/null) ## HOW MANY WORDS SECRETS
|
||||
[[ $DICE != ?(-)+([0-9]) ]] && DICE=4
|
||||
|
||||
echo "SECRETS : $DICE WORDS"
|
||||
echo "G1BILLET FACTORY MONTANT=$MONTANT DICE=$DICE"
|
||||
echo "$STYLE : $MY_PATH/${IMAGES}/$STYLE"
|
||||
|
||||
## CHECK IF STYLE IS EMAIL => astro IPFS G1BILLET
|
||||
if [[ "${STYLE}" =~ ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$ ]]; then
|
||||
echo "ASTROPORT $STYLE DEDICACE G1PASS"
|
||||
# echo "PLAYER : $STYLE"
|
||||
EMAIL=${STYLE}
|
||||
STYLE="xbian"
|
||||
STYLE="$(ls -d ${MY_PATH}/${IMAGES}/xbian* | tail -n 1 | rev | cut -d '/' -f 1 | rev)"
|
||||
fi
|
||||
|
||||
## STYLE SELECTED: PDF DE 6 BILLETS OR SINGLE
|
||||
NBbillets=6
|
||||
[[ "${STYLE}" != "" ]] && NBbillets=1
|
||||
[[ "${STYLE:0:1}" != "_" ]] && NBbillets=1 && MONTANT="___"
|
||||
[[ ${STYLE} == "" ]] && NBbillets=6
|
||||
|
||||
echo "CREATION $NBbillets x G1BILLET - $STYLE - "
|
||||
|
||||
|
@ -53,13 +55,13 @@ if [[ $MONTANT != "daemon" ]]; then
|
|||
[[ ${STYLE} == "" ]] && STYLE="_"
|
||||
|
||||
# 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
|
||||
[[ ! -f ${MY_PATH}/${IMAGES}/${STYLE}/g1.png ]] && ERROR="MISSING ./${IMAGES}/${STYLE}/g1.png - EXIT" && echo $ERROR && exit 1
|
||||
[[ ! -f ${MY_PATH}/${IMAGES}/${STYLE}/fond.jpg ]] && ERROR="MISSING ./${IMAGES}/${STYLE}/fond.jpg- EXIT" && echo $ERROR && exit 1
|
||||
[[ ! -f ${MY_PATH}/${IMAGES}/${STYLE}/logo.png ]] && ERROR="MISSING ./${IMAGES}/${STYLE}/logo.png- EXIT" && 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 4 ] && UNIQID=$(echo "${RANDOM}${RANDOM}${RANDOM}${RANDOM}" | tail -c-7)
|
||||
[ $DICE -gt 6 ] && UNIQID=$(${MY_PATH}/diceware.sh 1 | xargs)$(echo "${RANDOM}${RANDOM}" | tail -c-7)
|
||||
|
||||
# CREATION DE $NBbillets BILLETS DE $MONTANT DU
|
||||
|
@ -108,7 +110,7 @@ if [[ $MONTANT != "daemon" ]]; then
|
|||
# MONTAGE DES IMAGES DES BILLETS VERS ${MY_PATH}/tmp/g1billet/${UNIQID}.pdf
|
||||
montage ${MY_PATH}/tmp/g1billet/${UNIQID}/*.jpg -tile 2x3 -geometry 964x459 ${MY_PATH}/tmp/g1billet/${UNIQID}.pdf
|
||||
# NB!! if "not autorized" then edit /etc/ImageMagick-6/policy.xml and comment
|
||||
[[ ! -s ${MY_PATH}/tmp/g1billet/${UNIQID}.pdf ]] && echo "Please Correct PDF policy /etc/ImageMagick-6/policy.xml " && exit 1
|
||||
[[ ! -s ${MY_PATH}/tmp/g1billet/${UNIQID}.pdf ]] && echo "ERROR PDF NOT FOUND - contact - support@qo-op.com" && exit 1
|
||||
# <!-- <policy domain="coder" rights="none" pattern="PDF" /> -->
|
||||
# CLEANING TEMP FILES
|
||||
rm -Rf ${MY_PATH}/tmp/g1billet/${UNIQID}
|
||||
|
@ -166,11 +168,11 @@ else
|
|||
pre=${stname:0:1}
|
||||
|
||||
if [[ $pre == "_" ]]; then
|
||||
OPT="${OPT}<option value=''>Planche 6 G1BILLETS</option>"
|
||||
OPT="${OPT}<option value='_'>:: G1BILLET :: _ 6 pack :: </option>"
|
||||
elif [[ $pre == "x" ]]; then
|
||||
OPT="${OPT}<option value='${stname}'>${stname} (G1PASS)</option>"
|
||||
OPT="${OPT}<option value='${stname}'>:: G1TW :: ${stname} :: </option>"
|
||||
else
|
||||
OPT="${OPT}<option value='${stname}'>${stname} (G1Ticket)</option>"
|
||||
OPT="${OPT}<option value='${stname}'>:: G1PASS :: ${stname} :: </option>"
|
||||
fi
|
||||
|
||||
done
|
||||
|
@ -209,12 +211,13 @@ function countdown() {
|
|||
}
|
||||
}
|
||||
</script>
|
||||
<center>
|
||||
<form method="get">
|
||||
<br>
|
||||
|
||||
<label for="montant">Montant :</label>
|
||||
<select name="montant">
|
||||
<option value="0">?</option>
|
||||
<option value="0">_</option>
|
||||
<option value="1">1</option>
|
||||
<option value="2">2</option>
|
||||
<option value="5">5</option>
|
||||
|
@ -226,6 +229,7 @@ function countdown() {
|
|||
|
||||
<label for="type">Type :</label>
|
||||
<select name="type">
|
||||
<option value=''></option>
|
||||
'${OPT}'
|
||||
</select>
|
||||
|
||||
|
@ -242,6 +246,7 @@ function countdown() {
|
|||
<br> <br>
|
||||
<button type="submit">Lancer Fabrication</button>
|
||||
</form>
|
||||
</center>
|
||||
</body></html>'
|
||||
|
||||
function urldecode() { : "${*//+/ }"; echo -e "${_//%/\\x}"; }
|
||||
|
|
|
@ -13,6 +13,9 @@ ME="${0##*/}"
|
|||
# ${MY_PATH}/G1BILLET_MAKE.sh "nu me ro test" "se cr et" 100 7sn9dKeCNEsHmqm1gMWNREke4YAWtNw8KG1YBSN8CmSh 97968583
|
||||
############################################################################
|
||||
|
||||
## SEND LOG TO ~/.zen/tmp/_12345.log
|
||||
exec 2>&1 >> ~/.zen/G1BILLET/tmp/G1BILLETS.log
|
||||
|
||||
## LOAD PERSONAL OR DEFAULT STYLES
|
||||
[[ -d ${MY_PATH}/_images/_/ ]] \
|
||||
&& IMAGES="_images" \
|
||||
|
@ -42,43 +45,50 @@ BILLETNAME=$(echo $SALT | sed 's/ /_/g')
|
|||
# Prepare June logo color
|
||||
case "$MONTANT" in
|
||||
1)
|
||||
convert "${MY_PATH}/${IMAGES}/${STYLE}/g1.png" -fuzz 20% -fill grey -opaque '#e5912b' "${MY_PATH}/tmp/g1billet/${UNIQID}/g1.png"
|
||||
convert "${MY_PATH}/${IMAGES}/${STYLE}/fond.jpg" -fuzz 20% -fill grey -opaque '#e5912b' "${MY_PATH}/tmp/g1billet/${UNIQID}/fond.jpg"
|
||||
;;
|
||||
2)
|
||||
convert "${MY_PATH}/${IMAGES}/${STYLE}/g1.png" -fuzz 20% -fill green -opaque '#e5912b' "${MY_PATH}/tmp/g1billet/${UNIQID}/g1.png"
|
||||
convert "${MY_PATH}/${IMAGES}/${STYLE}/fond.jpg" -fuzz 20% -fill green -opaque '#e5912b' "${MY_PATH}/tmp/g1billet/${UNIQID}/fond.jpg"
|
||||
;;
|
||||
5)
|
||||
convert "${MY_PATH}/${IMAGES}/${STYLE}/g1.png" -fuzz 20% -fill orange -opaque '#e5912b' "${MY_PATH}/tmp/g1billet/${UNIQID}/g1.png"
|
||||
convert "${MY_PATH}/${IMAGES}/${STYLE}/fond.jpg" -fuzz 20% -fill orange -opaque '#e5912b' "${MY_PATH}/tmp/g1billet/${UNIQID}/fond.jpg"
|
||||
;;
|
||||
10)
|
||||
convert "${MY_PATH}/${IMAGES}/${STYLE}/g1.png" -fuzz 20% -fill blue -opaque '#e5912b' "${MY_PATH}/tmp/g1billet/${UNIQID}/g1.png"
|
||||
convert "${MY_PATH}/${IMAGES}/${STYLE}/fond.jpg" -fuzz 20% -fill blue -opaque '#e5912b' "${MY_PATH}/tmp/g1billet/${UNIQID}/fond.jpg"
|
||||
;;
|
||||
20)
|
||||
convert "${MY_PATH}/${IMAGES}/${STYLE}/g1.png" -fuzz 20% -fill purple -opaque '#e5912b' "${MY_PATH}/tmp/g1billet/${UNIQID}/g1.png"
|
||||
convert "${MY_PATH}/${IMAGES}/${STYLE}/fond.jpg" -fuzz 20% -fill purple -opaque '#e5912b' "${MY_PATH}/tmp/g1billet/${UNIQID}/fond.jpg"
|
||||
;;
|
||||
50)
|
||||
convert "${MY_PATH}/${IMAGES}/${STYLE}/g1.png" -fuzz 20% -fill red -opaque '#e5912b' "${MY_PATH}/tmp/g1billet/${UNIQID}/g1.png"
|
||||
convert "${MY_PATH}/${IMAGES}/${STYLE}/fond.jpg" -fuzz 20% -fill red -opaque '#e5912b' "${MY_PATH}/tmp/g1billet/${UNIQID}/fond.jpg"
|
||||
;;
|
||||
100)
|
||||
convert "${MY_PATH}/${IMAGES}/${STYLE}/g1.png" -fuzz 20% -fill black -opaque '#e5912b' "${MY_PATH}/tmp/g1billet/${UNIQID}/g1.png"
|
||||
convert "${MY_PATH}/${IMAGES}/${STYLE}/fond.jpg" -fuzz 20% -fill black -opaque '#e5912b' "${MY_PATH}/tmp/g1billet/${UNIQID}/fond.jpg"
|
||||
;;
|
||||
*)
|
||||
cp "${MY_PATH}/${IMAGES}/${STYLE}/g1.png" "${MY_PATH}/tmp/g1billet/${UNIQID}/g1.png"
|
||||
cp "${MY_PATH}/${IMAGES}/${STYLE}/fond.jpg" "${MY_PATH}/tmp/g1billet/${UNIQID}/fond.jpg"
|
||||
;;
|
||||
esac
|
||||
|
||||
# Add LOGO over FOND
|
||||
composite -compose Over -gravity SouthWest -geometry +150+50 -dissolve 70% \
|
||||
## PREPARE LOGO
|
||||
cp "${MY_PATH}/${IMAGES}/${STYLE}/g1.png" "${MY_PATH}/tmp/g1billet/${UNIQID}/g1.png"
|
||||
|
||||
# Add logo.png over FOND
|
||||
composite -compose Over -dissolve 60% \
|
||||
"${MY_PATH}/${IMAGES}/${STYLE}/logo.png" \
|
||||
"${MY_PATH}/${IMAGES}/${STYLE}/fond.jpg" \
|
||||
"${MY_PATH}/tmp/g1billet/${UNIQID}/fond.jpg" \
|
||||
"${MY_PATH}/tmp/${BILLETNAME}.jpg"
|
||||
|
||||
# "G1PASS" (GPG+TW) STYLE : xbian, xjeu, xastro
|
||||
if [[ "${STYLE:0:1}" == "x" ]]
|
||||
then
|
||||
## NOT TO BE IN FINAL PDF (getting all jpg)
|
||||
rm "${MY_PATH}/tmp/g1billet/${UNIQID}/fond.jpg"
|
||||
|
||||
if [[ "${STYLE:0:1}" != "_" ]]
|
||||
then
|
||||
if [[ ${ASTRONAUTENS} ]]; then
|
||||
## ♥Box :: G1PASS
|
||||
BOTTOM="$(date) :: ♥Box :: G1PASS :: $(hostname) ::"
|
||||
XZUID="__________@__________"
|
||||
|
||||
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"
|
||||
|
@ -103,7 +113,7 @@ then
|
|||
"$DISCO"
|
||||
|
||||
## ADD PLAYER EMAIL
|
||||
convert -gravity southeast -pointsize 28 -fill black -draw "text 5,3 \"$EMAIL\"" ${MY_PATH}/tmp/fond_qrcode.png ${MY_PATH}/tmp/g1billet/${UNIQID}/${BILLETNAME}.G1PASS.png
|
||||
convert -gravity southeast -pointsize 28 -fill black -draw "text 5,3 \"${EMAIL}\"" ${MY_PATH}/tmp/fond_qrcode.png ${MY_PATH}/tmp/g1billet/${UNIQID}/${BILLETNAME}.G1PASS.png
|
||||
convert ${MY_PATH}/tmp/g1billet/${UNIQID}/${BILLETNAME}.G1PASS.png -resize 300 ${MY_PATH}/tmp/g1billet/${UNIQID}/${BILLETNAME}.TW.png
|
||||
|
||||
composite -compose Over -gravity SouthWest -geometry +50+50 \
|
||||
|
@ -113,26 +123,28 @@ then
|
|||
|
||||
rm ${MY_PATH}/tmp/gpg.${BILLETNAME}.asc
|
||||
|
||||
if [[ ${STYLE} == "xbian" ]]; then
|
||||
amzqr "https://ipfs.copylaradio.com/ipns/$ASTRONAUTENS" -l H -p "$MY_PATH/${IMAGES}/moa_net.png" -c -n QRTWavatar.png -d ${MY_PATH}/tmp/g1billet/${UNIQID}/
|
||||
if [[ "${STYLE:0:1}" == "x" ]]; then
|
||||
|
||||
[[ "${EMAIL}" != "" ]] && XZUID="${EMAIL}"
|
||||
## ♥Box :: G1TW (central IPFS QRCODE)
|
||||
BOTTOM="$(date) :: ♥Box :: G1TW :: $(hostname) ::"
|
||||
|
||||
amzqr "https://ipfs.copylaradio.com/ipns/${ASTRONAUTENS}" -l H -p "$MY_PATH/${IMAGES}/moa_net.png" -c -n QRTWavatar.png -d ${MY_PATH}/tmp/g1billet/${UNIQID}/
|
||||
convert ${MY_PATH}/tmp/g1billet/${UNIQID}/QRTWavatar.png -resize 260 ${MY_PATH}/tmp/g1billet/${UNIQID}/300.png
|
||||
composite -compose Over -gravity Center -geometry +40+40 \
|
||||
composite -compose Over -gravity Center -geometry +30+40 \
|
||||
"${MY_PATH}/tmp/g1billet/${UNIQID}/300.png" \
|
||||
"${MY_PATH}/tmp/${BILLETNAME}.jpg" \
|
||||
"${MY_PATH}/tmp/${BILLETNAME}.jpg"
|
||||
|
||||
fi
|
||||
|
||||
|
||||
fi
|
||||
|
||||
# ENTETE ET BAS DE BILLET
|
||||
XZUID="__________@__________"
|
||||
BOTTOM="$(date) :: $(hostname) :: ♥Box ::"
|
||||
|
||||
else
|
||||
|
||||
XZUID="G1BILLET"
|
||||
BOTTOM="$(date) :: https://gchange.fr :: https://cesium.app :: $(hostname)"
|
||||
BOTTOM="$(date) :: ♥Box :: G1BILLET :: $(hostname) ::"
|
||||
|
||||
fi
|
||||
|
||||
|
@ -145,8 +157,8 @@ fi
|
|||
"${MY_PATH}/tmp/${BILLETNAME}.jpg" \
|
||||
"${MY_PATH}/tmp/${BILLETNAME}.jpg"
|
||||
|
||||
# Add g1 LOGO to Billet
|
||||
composite -compose Over -gravity NorthEast -geometry +50+25 -dissolve 90% \
|
||||
# Add g1.png SIGLE
|
||||
composite -compose Over -dissolve 90% \
|
||||
"${MY_PATH}/tmp/g1billet/${UNIQID}/g1.png" \
|
||||
"${MY_PATH}/tmp/${BILLETNAME}.jpg" \
|
||||
"${MY_PATH}/tmp/${BILLETNAME}.jpg"
|
||||
|
@ -155,10 +167,10 @@ fi
|
|||
if [[ "$MONTANT" != "___" ]]; then
|
||||
convert -font 'Liberation-Sans' \
|
||||
-pointsize 40 -fill black -draw 'text 70,50 "'"$XZUID"'"' \
|
||||
-pointsize 120 -fill black -draw 'text 450,250 "'"$MONTANT"'"' \
|
||||
-pointsize 20 -fill black -draw 'text 380,20 "'"${NOTERIB}"'"' \
|
||||
-pointsize 30 -draw 'text 50,100 "'"Identifiant: $SALT"'"' \
|
||||
-pointsize 22 -fill black -draw 'text 50,130 "'"Code Secret: $SECRET"'"' \
|
||||
-pointsize 150 -fill black -draw 'text 120,380 "'"$MONTANT"'"' \
|
||||
-pointsize 20 -fill black -draw 'text 340,22 "'"${NOTERIB}"'"' \
|
||||
-pointsize 22 -draw 'text 50,100 "'"Secret 1: $SALT"'"' \
|
||||
-pointsize 22 -fill black -draw 'text 50,130 "'"Secret 2: $SECRET"'"' \
|
||||
-pointsize 25 -fill black -draw 'text 50,440 "'"$BOTTOM"'"' \
|
||||
"${MY_PATH}/tmp/${BILLETNAME}.jpg" "${MY_PATH}/tmp/g1billet/${UNIQID}/${BILLETNAME}.BILLET.jpg"
|
||||
else
|
||||
|
|
BIN
images/_/g1.png
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 83 KiB |
After Width: | Height: | Size: 65 KiB |
After Width: | Height: | Size: 27 KiB |
After Width: | Height: | Size: 104 KiB |
Before Width: | Height: | Size: 156 KiB After Width: | Height: | Size: 161 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 180 KiB |
Before Width: | Height: | Size: 76 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 118 KiB |
Before Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 152 KiB After Width: | Height: | Size: 147 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 97 KiB |
Before Width: | Height: | Size: 152 KiB |
Before Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 66 KiB |
Before Width: | Height: | Size: 68 KiB |
Before Width: | Height: | Size: 67 KiB |
Before Width: | Height: | Size: 54 KiB |
Before Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 49 KiB |
After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 7.8 KiB |
After Width: | Height: | Size: 65 KiB |
After Width: | Height: | Size: 161 KiB |
Before Width: | Height: | Size: 104 KiB After Width: | Height: | Size: 104 KiB |
After Width: | Height: | Size: 147 KiB |
After Width: | Height: | Size: 29 KiB |
After Width: | Height: | Size: 18 KiB |
After Width: | Height: | Size: 39 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 25 KiB |
After Width: | Height: | Size: 30 KiB |
After Width: | Height: | Size: 97 KiB |
After Width: | Height: | Size: 175 KiB |