WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Can you implement a sort of Script Wiki access for tinycore?  (Read 2702 times)

Offline mofosyne

  • Newbie
  • *
  • Posts: 29
Can you implement a sort of Script Wiki access for tinycore?
« on: April 09, 2012, 04:28:51 AM »
TL;DR: I would like a "script browser" (as opposed to appBrowser), where you can browse for automated scripts for tinycore. This would allow for one click install of multiple apps, like say a 'familiar web desktop' script for newbies, where it will automagically download and run xfce, firefox, and flash.

---------------
I think it would be nice if we can have a program next to application browser, where you can browse, view, and execute various automated Bourne shell scripts.  (And bash scripts if extension is installed already perhaps)

The reason this would be nice, is that tinycore is very hard for newcomers to understand, and it would be nice to have a wiki where we can collaborate and create various Bourne shell script to make tinycore easier to use for various task.

e.g. you can create a custom installation script for tinycore that is better suited for super low ram install (e.g. on a thinclient), bypassing the tedious steps needed to manually install tinycore without a install GUI.


Example of this concept in use in other programs:
WxSand - fsg-4_4.exe - Added "Download physics from wiki". - http://www.piettes.com/fallingsandgame/download.html

In WxSand, you can download different physic, like http://www.fallingsandgame.com/wiki/index.php/Zombie_mod . Basically, it would download that page, and only read the text between "<!-- start content -->" and "<!-- end content -->" (excluding html codes)

In tinycore, we already have a main tinycore wiki. Hope it is not too much of a stretch to add a database of example bash scripts for users to use.
« Last Edit: April 10, 2012, 06:56:43 AM by mofosyne »

Offline mofosyne

  • Newbie
  • *
  • Posts: 29
Re: Can you implement a sort of Script Wiki access for tinycore?
« Reply #1 on: April 09, 2012, 04:47:58 AM »
Oh and one last thing. This would fit with tinycore's philosophy I'm sure, as nothing is ever installed (though I'm sure you can backup and copy scripts).

I would also recommend that you make this service 'console' based so that you can access it within 'microcore'. You can then perhaps make a GUI wrapper over it, so it can be easily used in tinycore as well.

If this console program is called "ScriptBrowser" (like AppBrowser) in microcore/tinycore terminal, then this could be it's command.

>>ScriptBrowser
Shows a browse able index of Bourne shell scripts

>>ScriptBrowser [Search term]
Shows top ten scripts for that search term (perhaps type 'next' to go to next page, if there is more than 10 results)

>>ScriptBrowser /run (ScriptName in wiki)
Runs the script as named

>>ScriptBrowser /src (ScriptName in wiki)
Show the script source as named

>>ScriptBrowser /about (ScriptName in wiki)
Shows the other text in that wiki page that is not the source text

------ For pastebin users (optional but may be useful to consider) -----

>>ScriptBrowser /pastebinrun [PasteBinID]
Would grab a script from pastebin and run it
« Last Edit: April 09, 2012, 05:13:03 AM by mofosyne »

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Can you implement a sort of Script Wiki access for tinycore?
« Reply #2 on: April 09, 2012, 04:53:46 AM »
Why bash scripts when core does not contain any such and bash.tcz would be an optional extension?
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline mofosyne

  • Newbie
  • *
  • Posts: 29
Re: Can you implement a sort of Script Wiki access for tinycore?
« Reply #3 on: April 09, 2012, 05:06:56 AM »
Oh? I had an impression that bash is part of all linuxes. Whats the standard scripting automation language does TinyCore support by default, if there is any?

=====

Evidence for my assumption of default bash support for tinycore: http://distro.ibiblio.org/tinycorelinux/faq.html#startup_scripts

Quote
The actual startup script could be anything that is executeable.
Using the same example, my /usr/local/tce.installed/915resolution is a simple as this:

#/bin/sh
/usr/local/sbin/915resolution 50 1024 600

#/bin/sh
I believe the above indicate it's a bash script
« Last Edit: April 09, 2012, 05:10:00 AM by mofosyne »

Offline mofosyne

  • Newbie
  • *
  • Posts: 29
Re: Can you implement a sort of Script Wiki access for tinycore?
« Reply #4 on: April 09, 2012, 05:12:22 AM »
Okay... I did further research. I see now that the default script language is called Bourne shell, not bash.

http://en.wikipedia.org/wiki/Bourne_shell

I shall now amend my previous post to refer to 'Bourne shell'. Pardon me for my confusion

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Can you implement a sort of Script Wiki access for tinycore?
« Reply #5 on: April 09, 2012, 05:14:23 AM »
The header for bash scripts would be #!/bin/bash

Core's default shell is ash as a busybox applet.
« Last Edit: April 09, 2012, 05:16:32 AM by tinypoodle »
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline mofosyne

  • Newbie
  • *
  • Posts: 29
Re: Can you implement a sort of Script Wiki access for tinycore?
« Reply #6 on: April 10, 2012, 06:24:42 AM »
hmmmmm...

Do you think a good alternative would be to insert metadata, specifying type of 'script'?

Perhaps, depending on if ash, bash, python, etc... is present or not, it will show that particular script.

e.g.

script_type: python
info: this is a hello world script in python
Targeted_OS: tinycore, all_linuxes
<!--start content -->
print "hello world"
<!--end content -->


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

Additional reason for this feature in tinycore!

With a single click (or maybe even a bootcode), you can automatically install a number of applications. E.g. you can tell a newcomer who wants a simple familiar desktop with flash browser to run an ash script. It will then download and execute a command instructing appbrowser or scm manager to download xfce, firefox, and flash automagically.

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

Second potential idea to making this more powerful.
Allow for 'constants to be defined' before running a script. The script may show a number of predefined variables that needs to be defined in GUI/Console (But will always give the user full control to enter any text in that field). The program will then do a simple search and replace command to fill in the blanks.

e.g.
script_type: python
info: this is a hello world script in python
Targeted_OS: tinycore, all_linuxes
<!--start parameters-->
MSG_STRING: "Hello world"
CHOICES: "option1" | "option2" | "option3" | "option4"
<!--end parameters-->
<!--start content -->
print "Message"
print MSG_STRING
print "You picked"
print CHOICES
<!--end content -->

Offline vinnie

  • Hero Member
  • *****
  • Posts: 1104
  • HandMace informatic works
Re: Can you implement a sort of Script Wiki access for tinycore?
« Reply #7 on: April 10, 2012, 07:29:33 AM »
Scripting is one of the powers of gnu/linux as compared to other platforms.
There is a script section in the forum that actually is a shame not to see valorized.
However structure an automated script management is not trivial, but Core has a long life in its future  :)

Offline mofosyne

  • Newbie
  • *
  • Posts: 29
Re: Can you implement a sort of Script Wiki access for tinycore?
« Reply #8 on: April 10, 2012, 09:29:16 AM »
Well I think it is plausible. If appbrowser can be created to look up and download from a tinycore repo site (which looks htmlish), why not from a wiki? What is appbrowser's language anyway, and who made it? maybe that guy might be up to the job.

I imagine that this scriptbrowser is a console based app, that simply downloads scripts to /tmp/script dir, and runs it from there.

And yes the power of scripting in linux is a great thing that is yet untapped, and imagine if all the people coding scripts in forums, does it in a wiki instead.

Offline solorin

  • Full Member
  • ***
  • Posts: 184
Re: Can you implement a sort of Script Wiki access for tinycore?
« Reply #9 on: April 10, 2012, 10:00:08 PM »
Appbrowser is written in C using the ftlk toolkit. You can find sources here. http://distro.ibiblio.org/tinycorelinux/4.x/x86/release/src/fltk_projects/
And as far as I know it and most other fltk apps that ship default with Tinycore, were coded by the roberts/core team.

Busybox ash is fairly capable. It's a good idea to make your scripts portable anyway. http://www.amazon.com/dp/1430210435/.

It doesn't seem that hard to implement what you would like in ash. You'd just need to set up an ftp/http repository somewhere, and write a script with a few wget's and chmod's in it. If you want to implement it with something faster, lua is fairly compact and in the repository.

For whatever scripts you are thinking of, I'd just as soon do that by hand.
I'd want to see what my system downloads and runs. And if you just want a place to store scripts, just make a wiki page and start sharing scripts you think are useful.

I can't speak for the core team, but I think they're already pretty busy releasing Core itself. So if you've got the hosting & the chops you should implement it yourself and share it on the Unofficial Programming & Scripting Forum if you would like. Don't ask for permission, but don't ask for somebody else to do the work for you (well you can ask but nobody's obligated to answer). AFAICT, the core team is fairly conservative as to suggestions for things in the official 'core' (that's what keeps the iso sizes down), but extensions seem to be welcomed liberally as long as they don't interfere with 'core' functions. Again just my 2 cents, they may say something different.

good luck.

cheerio,
solorin
« Last Edit: April 10, 2012, 10:38:06 PM by solorin »
. . . if you don't know, now you know. . .
        ----- R.I.P. Biggie Smalls -----

Offline mofosyne

  • Newbie
  • *
  • Posts: 29
Re: Can you implement a sort of Script Wiki access for tinycore?
« Reply #10 on: April 11, 2012, 12:46:51 AM »
So you mean that this 'remote script browser' can be entirely coded in 'ash' scripting?

Offline solorin

  • Full Member
  • ***
  • Posts: 184
Re: Can you implement a sort of Script Wiki access for tinycore?
« Reply #11 on: April 11, 2012, 05:51:10 AM »
less /usr/bin/ab

cheerio,
solorin
. . . if you don't know, now you know. . .
        ----- R.I.P. Biggie Smalls -----

Offline roberts

  • Administrator
  • Hero Member
  • *****
  • Posts: 7344
  • Founder Emeritus
Re: Can you implement a sort of Script Wiki access for tinycore?
« Reply #12 on: April 11, 2012, 06:59:20 AM »
The stated goal of this can already be achieved via meta-extensions.
10+ Years Contributing to Linux Open Source Projects.

Offline mofosyne

  • Newbie
  • *
  • Posts: 29
Re: Can you implement a sort of Script Wiki access for tinycore?
« Reply #13 on: April 11, 2012, 07:55:58 AM »
meta-extentions? what is that

Offline Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4248
Re: Can you implement a sort of Script Wiki access for tinycore?
« Reply #14 on: April 11, 2012, 10:23:10 AM »
Hi mofosyne
Meta extensions are basically extensions that get their content elsewhere. Here are a couple of examples:
compiletc: This extension contains only a readme file. Its dependency file contains a list of extensions required
                    for compiling programs. When you install compiletc, the readme file is installed along with all of the
                    extensions listed in its dependency file.
getFlash11: This extension basically contains a script that retrieves Flashplayer version 11 from Adobe. It packages
                       it into an extension that you can then put in your /tce directory with your other extensions. Once you
                       have run it, you typically would not run it again.
« Last Edit: April 11, 2012, 10:32:07 AM by Rich »