Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Wed 12 Dec 2018, 08:37
All times are UTC - 4
 Forum index » Taking the Puppy out for a walk » Misc
Base64 Download Files Attempt
Moderators: Flash, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [1 Post]  
Author Message
Isma

Joined: 19 Jul 2018
Posts: 2

PostPosted: Wed 19 Sep 2018, 14:39    Post subject:  Base64 Download Files Attempt  

Few years ago i was watching a LibreOffice conference where they explore the topic of "cloud computing" stating that would be easier to deliver all programs over the Internet, because the bandwidth has increased dramatically over the last years, so it wouldn't be hard for most people to have a computing based completely on the network. One example of that is an average web page this days has the size of the original DOOM game.

That is what i like of small programs, not bloated software, optimized software and basically what all of the original spirit of distros like Puppy, TinyCore, DSL, have. Small is beautiful and efficient.

Anyway this first "file" will be a staticBuild attempt of G'MIC. A scientific-grade framework for image processing. I use the source code of version 2.0.0, compiled using a Slackware build file from Slackbuilds.org and loading the devx sfs in slacko. You could download those files and edit the Makefile of gmic and edit the Slackbuild file too. in the Makefile of G'MIC you simply can edit the flags in each field described in the file: gimp_qt, gimp_gtk, cli cli_static, etc. I only try with "static".

What i do is this:

Code:

-Compile the binary.
-Compress it with gzip.
-Use: split -b 300K X11gmic.gz
-Then: base64 aa > aa.txt (the same with the other files)


So i will be able to "upload" (copy and paste) the base64 encode into a web pages like a forum or like pastebin. And then:

Code:

-Copy and paste the content into separate txt files.
-And do: base64 -d aa.txt > aa (again, the same with the other files)
- cat a* > X11gmic.gz
- gzip -d X11gmic.gz


So in this way i ended up with the original binary. Without depending on hosting sites or attachments in the forums that will be lost in the next migration/maintenance, because they are only text.

OK, doing some test prior to post this i realized that the web page gets really slow, because it's almost ~5Mb of pure text. So i uploaded in pastebin. You could download the web page using wget, and still you will have the base64 encoded data, you can extract it using a script. Or download the .txt file using the pastebin web interface.

If you try this, you will get with an almost-static binary file of G'MIC, and you can do a lot of great stuff with it, i recommend you to read the handbook gmic_reference.pdf. With this build you can read/write PNM, PGN, JPG, TIFF. You can read GIF (and all the formats ImageMagick reads/writes) if you have GraphicsMagick installed or the static binary in the same folder, with this build even if you have the GraphicsMagick almost-static binary i will upload, installed or in the same folder you can't write to GIF format because i don't know how to compile GraphicsMagick statically. And the static binary of GM i will upload it has everything disabled, you can't use it as you will expect, because G'MIC uses it internally.

If this somehow breaks the rules please delete it. Thank you.

These are 11 .txt files. Of almost ~500K of size. If you are using a web browser use the links with the /dl/ in the link, but if you use wget replace the /dl/ in the link, with /raw/.

One line to download the 11 files using wget. CAUTION! Order matters, when you decode from base64 the order doesn't matter, but when you use cat you should put from first to last the files. If you don't do that the file will be corrupted

Code:

cat file1 file2 file3 file4 ... > filename.gz


Code:

wget https://pastebin.com/raw/EpcauPeN https://pastebin.com/raw/MFYXL9Q0 https://pastebin.com/raw/UkbeUKzW https://pastebin.com/raw/cidcm3QJ https://pastebin.com/raw/GfD5iVrs https://pastebin.com/raw/mrAZ6Tid https://pastebin.com/raw/57XdqGEd https://pastebin.com/raw/SGazHNz2 https://pastebin.com/raw/LQd0AMiC https://pastebin.com/raw/zWTcQWWT https://pastebin.com/raw/HKvGVByn






To decode this files use this line:

Code:

for file in *.txt; do base64 -d "$file" > ./"${file}".s; done


To join them together:

Code:

cat *.s > X11gmic.gz
gzip -d X11gmic.gz
chmod a+x X11gmic



If you made it so far:

Code:

./X11gmic -demo


To see a demo of the power of G'MIC.

###############################################

GraphicsMagick


Now this is the much smaller almost-static binary of GraphicsMagick, software similar to ImageMagick but smaller and efficient. This is almost the same method of compilation. I load the devx file in Slacko, downloaded the source code from the ftp of ImageMagick and use the flags to disable almost everything in the ./configure file. This file is needed from G'MIC, because it can't read natively the GIF format.

If you do this:

Code:

./gmic -i image.gif


Without the "gm" file in the same folder, then G'MIC will complain about the format, but if you copy the "gm" binary in the same folder, gmic would show you the image in a X window (it will only show info. in the console if the binary was compiled without support for X11).

Anyway, this binary i think it's almost useless. I have tried to convert images with it but it show an error, something like "missing delegates.mgk". But without this binary G'MIC can't read GIF files.

G'MIC will only read GIF files, it can't write GIF images. But it can convert GIF images to the supported formats by G'MIC.

Code:

./gmic -i image.gif -o jpg:image_convert.jpg


The previous line will convert the GIF image into a JPG.

One line to download the files using wget. CAUTION! Order matters, when you decode from base64 the order doesn't matter, but when you use cat you should put from first to last the files. If you don't do that the file will be corrupted

Code:

cat file1 file2 file3 file4 ... > filename.gz


Code:

wget https://pastebin.com/raw/99DmgZhb https://pastebin.com/raw/Dyv3rky2 https://pastebin.com/raw/1SY2iTa3





----------------------------------------------------------------------------------------------------------


This is a screenshot of an image mapped to a 3d plane inside G'MIC. It's in my T42 disk less laptop from 2005 with 512Mb of RAM running TinyCore Linux! How cool it's that?

https://pastebin.com/dl/DnaeHa2d

Code:

base64 -d plane3dkittycatgmic.png.txt > screenshot.png



By the way, using base64 increase the file size by around 1/3 of the file size. Each split file is ~300Kb, after using base64 it's about ~400Kb.



If i can't explain, and you don't want to do all of these, you can use this horrible "script". It's ugly, but it "works".

Code:

#!/bin/sh
mkdir gmic64
cd gmic64
wget https://pastebin.com/raw/EpcauPeN https://pastebin.com/raw/MFYXL9Q0 https://pastebin.com/raw/UkbeUKzW https://pastebin.com/raw/cidcm3QJ https://pastebin.com/raw/GfD5iVrs https://pastebin.com/raw/mrAZ6Tid https://pastebin.com/raw/57XdqGEd https://pastebin.com/raw/SGazHNz2 https://pastebin.com/raw/LQd0AMiC https://pastebin.com/raw/zWTcQWWT https://pastebin.com/raw/HKvGVByn
mkdir downloads ; mv EpcauPeN MFYXL9Q0 UkbeUKzW cidcm3QJ GfD5iVrs mrAZ6Tid 57XdqGEd SGazHNz2 LQd0AMiC zWTcQWWT HKvGVByn ./downloads/
cd ./downloads
mkdir decode
for file in ./*; do base64 -d "$file" > ./decode/"${file}"; done
cat ./decode/EpcauPeN ./decode/MFYXL9Q0 ./decode/UkbeUKzW ./decode/cidcm3QJ ./decode/GfD5iVrs ./decode/mrAZ6Tid ./decode/57XdqGEd ./decode/SGazHNz2 ./decode/LQd0AMiC ./decode/zWTcQWWT ./decode/HKvGVByn > ./X11gmic.gz
gzip -d ./X11gmic.gz
chmod a+x ./X11gmic
cd ../
mv ./downloads/X11gmic .
# ./X11gmic -demo




mkdir gm64
cd gm64
wget https://pastebin.com/raw/99DmgZhb https://pastebin.com/raw/Dyv3rky2 https://pastebin.com/raw/1SY2iTa3
mkdir downloadG ; mv 99DmgZhb Dyv3rky2 1SY2iTa3 ./downloadG/
cd ./downloadG/
mkdir ./decodeG/
for file in ./*; do base64 -d "$file" > ./decodeG/"${file}"; done
cat ./decodeG/99DmgZhb ./decodeG/Dyv3rky2 ./decodeG/1SY2iTa3 > ./gm.gz
gzip -d ./gm.gz
chmod a+x ./gm
cd ../
mv ./downloadG/gm .
./gm -help


../X11gmic -demo



Just remember to put "X11gmic" and "gm" in the same folder. And you can delete all the junk the script made.

Screenshot with a Susane render it's in Puppy Linux Slacko, in a HP computer with 4GB of ram. And the screenshot of the cat it's with Tiny Core Linux without any graphic extension loaded in a T42 IBM laptop.


###################################################################
Another screenshot.

Using the images provided by NASA.

http://earthobservatory.nasa.gov/Features/BlueMarble/BlueMarble_2002.php

And the following command line:

./gmic -i bluemarble.png -imagesphere3d

To see in real time the 3d view port, you should press twice the combo keys:

Ctrl. + F3
Ctrl. + F3

Here is the base64 content for the screenshot:

https://pastebin.com/dl/e06xQiDE
Screenshot.png
Description  G'MIC on Puppy Slacko.
png

 Download 
Filename  Screenshot.png 
Filesize  151.62 KB 
Downloaded  45 Time(s) 
screenshot_0918202752.png
Description  G'MIC on TinyCore.
png

 Download 
Filename  screenshot_0918202752.png 
Filesize  161.7 KB 
Downloaded  151 Time(s) 
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [1 Post]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Taking the Puppy out for a walk » Misc
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0574s ][ Queries: 13 (0.0178s) ][ GZIP on ]