<jan6>
it is USUALLY available, so no real worries
<Regenaxer>
yeah, direct terminfo would be best
<Regenaxer>
Let's see :)
<Regenaxer>
tput seems a good compromize
<Regenaxer>
It least it is on Unix and in Termux
<jan6>
don't think it is on unix
<jan6>
but is on modern linux ;P
<Regenaxer>
I believe it is on all modern Unixes since System 5 and BSD
freemint has quit [Ping timeout: 250 seconds]
cobax has quit [Ping timeout: 276 seconds]
freemint has joined #picolisp
<Regenaxer>
Maybe even tput is not needed, just escape sequences
<Regenaxer>
... and a *lot* faster (no 'call' overhead)
andyjpb has quit [Ping timeout: 248 seconds]
<jan6>
I've had systems without tput, before
<jan6>
of course, but question is if the sequences are available
<jan6>
maybe someone is using a serial terminal or something
<jan6>
but standard ansi escape codes should work for all regular terminals, definitely
<Regenaxer>
ok
<Regenaxer>
I'll try over the weekend or so
andyjpb has joined #picolisp
<Regenaxer>
For a real old slow serial terminal (9600 baud) of course Curses is absolutely needed
<Regenaxer>
it optimizes updates
<Regenaxer>
but for graphical terminals it is just overhead
andyjpb has quit [Ping timeout: 272 seconds]
xkapastel has joined #picolisp
andyjpb has joined #picolisp
orivej has joined #picolisp
andyjpb has quit [Ping timeout: 258 seconds]
<jan6>
yeh
andyjpb has joined #picolisp
razzy has quit [Remote host closed the connection]
andyjpb has quit [Ping timeout: 248 seconds]
beneroth has joined #picolisp
<beneroth>
hi all
<Regenaxer>
Hi beneroth
<beneroth>
Hi Regenaxer ! :)
<beneroth>
I'm playing around with dump. doing dump, than restoring (new) database from that dump. dumping again. repeating a few times.
<jan6>
you don't need to dump your dumps into a new dump, do you?
<Regenaxer>
Never did
<beneroth>
I don't need do, but I do.
<Regenaxer>
DB1 -> DB2 -> DB3 ?
<beneroth>
beneroth, the intention was to check my dump queries, if I really get the whole database. My theory was, that the dumps should match.
<Regenaxer>
ah, yes
<Regenaxer>
but the order might change
<Regenaxer>
eg. for same +Ref keys
<beneroth>
no. DB1 made from data migration. dump. delete db1. remake db1 from dump1. dump db again, producting dump2. deleting db1, redoing from dump2, etc
<beneroth>
YES
<beneroth>
well, and even the object statements are not reproducible by default, as (getl) is used to iterate the properties during import, which is raw memory/cell access, so order might be different according to order in which the properties were last edited
<Regenaxer>
right
<beneroth>
I corrected this by doing (redef getl @
<beneroth>
(by '((P) (if (atom P) P (cons (cdr P) (car P)))) sort (copy (pass getl))) ) before dumping
<Regenaxer>
ok
<beneroth>
now my dumps do match for all entities with a +Key, but the ones without +Key get an identifier instead which is deduced from the external symbols name, so basically location of the starting block.
<Regenaxer>
why not just (sort (copy (getl))) ?
<beneroth>
and this id is different
<beneroth>
Regenaxer, because then its sorted by prop value, I wanted to sort by prop name in the dumps
<Regenaxer>
ok
<beneroth>
no difference for match, agreed
<Regenaxer>
copy is not needed I think
<beneroth>
but I don't get why the db file block locations are changing
andyjpb has joined #picolisp
<beneroth>
yeah I didn't have it at first, then I thought sort is destructive, maybe this is affecting the memory layout, nvm
<Regenaxer>
Blocks are allocated from free list if there is any
<Regenaxer>
sort is destructive, but getl returns a fresh list
<beneroth>
but shouldn't it be similar when I do re-make the whole database from same dump (not everything is in dump, rest is made by an init script, but it's the same init script)
<beneroth>
Regenaxer, ah ok, I wasn't sure about getl, I guess I mixed it up with maps.
<Regenaxer>
yeah, maps just iterates
<Regenaxer>
hmm
<Regenaxer>
free blocks are only after dbgc
<Regenaxer>
or zap in general
<beneroth>
after about 5 dumps or so, newly generated dumps match completely, but not the initial few dumps
<beneroth>
no dbgc running
<beneroth>
I havent tested if the match is keeping on when doing more dump-restore-dump cycles than 4 (+ the first initial db build)
<Regenaxer>
you always erased all files before start?
<beneroth>
yes, complete database folder.
<Regenaxer>
ok
<beneroth>
so I don't get why the database block allocation is different. the first two dumps might differ, as the very first dump is from the migrated database, not restored from a dump, but all others are created the same way.
<beneroth>
even when some values in the (always same) init script would change, this would only affect block layout if therefore the size requirements (numbers of block) would change
<beneroth>
i think.
<beneroth>
filesystem cannot have any influence, as for the application the db files are a single big file block, no?
<beneroth>
(running on ext4, not raw device)
<beneroth>
(luks lvm, normal ubuntu)
<beneroth>
I had the idea to patch the dumpKey> in a way, that for objects without a primary key instead of the external symbols name a (hash) from the properties would be used. but I have +Link in such objects, so the (hash) would only be consistent (over multiple dumps) when hashing the linked object recursively, so no symbol names are involved.
<beneroth>
I guess I should do that, for fully reproducible dumps.
<beneroth>
still wondering about the changing block layout, and even more than it seems to eventually aligns.
andyjpb has quit [Ping timeout: 245 seconds]
<Regenaxer>
Sorry, was on phone
<beneroth>
np
* beneroth
makes some more dump cycles, to see if the alignment of matching dumps is stable
<Regenaxer>
What if you instead write a comparison program?
<Regenaxer>
comparing dump files
<Regenaxer>
sort on the fly
<beneroth>
yeah, that would satisfy my test need
<beneroth>
but now I'm excited about this weird block layout change :D
<Regenaxer>
Still interesting why it changes
<Regenaxer>
T
<Regenaxer>
If the file is new, block are always allocated in sequence
<Regenaxer>
A bit tricky is if objects are larger than one block
<Regenaxer>
Then it is not clear when (-> where) the following blocks are allocated
<Regenaxer>
ie if the object grows
<beneroth>
well, this is the case, as most of the objects are still placed in file 1, not yet assigned to a file.
<beneroth>
and {1} is many blocks, naturally
<Regenaxer>
OK. When the object overflows the next block is chained
<Regenaxer>
but still in sequence
<beneroth>
but as the creation/resizing is happening in the same order, then the block allocations should be same, no?
<beneroth>
aye
<beneroth>
now I did the dump cycle 12 times, none of the dump files matches.
<Regenaxer>
I think so. And the first block's location never changes
<beneroth>
so the eventual match I saw before was more likely by chance
<Regenaxer>
perhaps
<Regenaxer>
Maybe some things are not dumped yet?
<beneroth>
possible, but than this should only be a difference in the first dump from the migrated database, not in the dumps created from the dumps
<beneroth>
oh
<beneroth>
I compare dumps with meld, very useful application (GUI diff)
<beneroth>
it seems dump order varies, so output order of the pilog queries...
<beneroth>
but that must be a separate cause of mismatch than the block id thing
<beneroth>
hmmm
<Regenaxer>
As the +Ref keys are the same, their order might change each time
<beneroth>
T, it's only on objects queried by +Ref
<Regenaxer>
Also +Links and +Joints followed?
<beneroth>
T
<beneroth>
but then fetched in order indirectly, via the main objects
<Regenaxer>
So this also creates objects before they appear in the dump
<beneroth>
ah, T
<Regenaxer>
aka circularity
<beneroth>
objects in same sequence, but the index blocks might be differently allocated?
<Regenaxer>
The index blocks are not dumped, right?
<Regenaxer>
recreated on load
<beneroth>
T
<beneroth>
I have no indexed +Joint relations
<beneroth>
(seldom makes sense anyway...)
<Regenaxer>
yes, never I think
<Regenaxer>
+Ref +Link is same as +Joint
<Regenaxer>
equivalent kind of
<beneroth>
equivalent, but not the same :)
<Regenaxer>
T
<beneroth>
I have +Ref +Link relations too
andyjpb has joined #picolisp
<Regenaxer>
ok
<Regenaxer>
So predicting the order of both dump and creation is difficult
<beneroth>
so when diffing my dumps, I only see differences on the generated dumpKey> values on the objects without a +Key.
<beneroth>
so I think I can trust my dump and restore, insofar as I hopefully have everything covered in the initial dump (separate topic)
<beneroth>
I have to change trains now
<beneroth>
brb
<Regenaxer>
You could check the object counts
<Regenaxer>
in dbck
<Regenaxer>
ok
<beneroth>
good idea, will do
<beneroth>
thanks!
beneroth has quit [Quit: Leaving]
andyjpb has quit [Ping timeout: 248 seconds]
beneroth has joined #picolisp
andyjpb has joined #picolisp
beneroth has quit [Quit: Leaving]
andyjpb has quit [Ping timeout: 245 seconds]
andyjpb has joined #picolisp
xkapastel has quit [Quit: Connection closed for inactivity]
andyjpb has quit [Ping timeout: 245 seconds]
freemint has quit [Ping timeout: 250 seconds]
andyjpb has joined #picolisp
freemint has joined #picolisp
andyjpb has quit [Ping timeout: 248 seconds]
andyjpb has joined #picolisp
andyjpb has quit [Ping timeout: 245 seconds]
andyjpb has joined #picolisp
freemint has quit [Remote host closed the connection]
freemint has joined #picolisp
freemint has quit [Ping timeout: 250 seconds]
freemint has joined #picolisp
freemint has quit [Quit: Leaving]
ubLIX has joined #picolisp
cobax has joined #picolisp
<cobax>
I can't install picolisp on debian :(
<CORDIC>
cobax: Welcome.
<CORDIC>
Whrough APT or sources?
<Regenaxer>
Hi cobax
<cobax>
Hi! I used sudo apt-get install picolisp
<cobax>
is there a better way? or is it easier on ubuntu?
<Regenaxer>
apt install is fine, but may be a bit outdated
<cobax>
can it be sudo apt install picolisp or will that be different?
<cobax>
I did that before but it didn't run any scripts
<cobax>
I can try again
<Regenaxer>
yes, sudo apt is needed
<Regenaxer>
Or synaptic etc. in Ubuntu
<cobax>
I'm sorry, I still don't get it. I'm not a sysadmin. I downloaded the .s files. I'm reading the install file. I don't understand what to do with these .s files
<Regenaxer>
ok:
<Regenaxer>
tar vfz picoLisp.tgz
<Regenaxer>
cd picoLisp
<Regenaxer>
tar xfz x86-64.linux.tgz
<Regenaxer>
(cd src64; make)
<Regenaxer>
./pil +
<Regenaxer>
above use xfz instead of vfz
<Regenaxer>
the 'tar' calls need the proper path of course
<Regenaxer>
if you downloaded to /mp
<Regenaxer>
tar xfz /tmp/picoLisp.tgz
<Regenaxer>
tar xfz /tmp/x86-64.linux.tgz
<Regenaxer>
something like that :)
<cobax>
I can't run that tar command on debian "You must specify one of the '-Acdtrux', '--delete' or '--test-label' options Try 'tar --help' or 'tar --usage' for more information."
<Regenaxer>
uh, I *always* use tar xfz <file> on Debian
<cobax>
I think I'm going to pay someone on upwork to do this for me and perhaps make a binary of it, something that someone can just download and use. would you be interested in hosting that solution on your picolisp website after I pay for it and publish it for free?
<Regenaxer>
GNU tar
<Regenaxer>
It is standard on Debian
<cobax>
I don't know what to tell you, I get the error I showed you.
<Regenaxer>
Is it Debian?
<cobax>
ls
<cobax>
sorry
<Regenaxer>
Forget to build a local install
<cobax>
Yes it is Debian but it can be whatever you want, whatever is easier and most pain-free, I am on linode.
<Regenaxer>
Just do: sudo apt install picolisp
<Regenaxer>
I don't know linode
<cobax>
Ok I did sudo apt install picolisp. I got it now. Now I have in a file called try1.l, your "Serve web pages" example. I am at that folder with that file in it. what exactly do I type?
<cobax>
I have tried everything and never managed to run it, that is why I was trying to find another way to install it
<CORDIC>
Even a Docker Container with Tiny Core Linux has been created.
<cobax>
for instance I tried: pil @lib/http.l @lib/xhtml.l --server 8080 try1.l +
<Regenaxer>
looks good
<Regenaxer>
(I dont know try1.l though)
<cobax>
Ok here is why I uninstalled it
<CORDIC>
I guess I should apologize for even mentioning Docker.
<cobax>
if I try to bind to 80 I get: "IP bind error: Permission denied", if I bind to 8080 it goes fine, but then when I visit mywebsite.com:8080 it gives the same error "IP bind error: Permission denied"
<cobax>
I don't get it
<cobax>
I did my whole ufw stuff
<cobax>
it's all open
<Regenaxer>
Port 80 needs root permission
<cobax>
sudo ufw status says ALLOW on 80, 8080, tcp for both, v4 and v6
<Regenaxer>
I always use 8080
<cobax>
what does that mean? what is the command?
<Regenaxer>
Well, you did: --server 8080 try1.l
<Regenaxer>
8080 is ok as normal user
<cobax>
so do I need "sudo" before the command? what is the solution?
<Regenaxer>
No sudo needed if you use 8080
<cobax>
ok but I want 80, I want a normal website
<cobax>
why can't I have it?
<Regenaxer>
Hmm, no idea with docker or linode
<Regenaxer>
I'm talking about real Debian
<cobax>
so you think there's something "above my ufw" on linode's end that is keeping the port closed ?
<cobax>
you'd think they'd optimize their servers for making websites...
<Regenaxer>
I never cared about Docker, sorry
<cobax>
I'm not on docker, just linode, but maybe you mean that linode runs docker, and I just don't know that
<jan6>
cobax: can you run a normal web server under 8080 for example?
<jan6>
for test, I like to use busybox's httpd
<Regenaxer>
Can you try:
<Regenaxer>
pil +
<Regenaxer>
: (listen (port 8080))
<Regenaxer>
then ^C ^D
<Regenaxer>
if no error, you are allowed to listen on 8080
<cobax>
jan6: yes, when I do it with sudo and 8080, it runs, then I go there with my browser, :8080, and it just sits loading, and the picolisp terminal says nothing
<jan6>
(something like "apt install busybox;busybox httpd -p 8080" ,then if it's open you should get a bland white 404 page on the browser when visiting the site)
<jan6>
no sudo needed for 8080
<jan6>
that would help narrow down if it's a firewall or somehow broken installation
<Regenaxer>
Ah, so the server listens, but the browser does not find it
<cobax>
Regenaxer: I wouldn't say that
<cobax>
because if I run without sudo, and visit through the browser, I immediately get the ip bind error
<Regenaxer>
I think it has to do with epiphemeral ports. When the browser connects, pil allocates *another* port for a session
<cobax>
jan6: yep I got the 404, now I how do I turn that command off, since it didn't put me on its own terminal?
<jan6>
killall busybox
<cobax>
ok so now we know that
<cobax>
now what?
<jan6>
this shows that it SHOULD work, and might be something with your install, or something else, don't think it's firewall only...unless picolisp has some weird setup, idk, not a lisp-er myself
<jan6>
maybe try one of the web server samples from wiki or something?
<cobax>
jan6: that is what I thought and why I uninstalled te apt picolisp and started to look for another
<cobax>
but I don't know anything
<cobax>
I am
<jan6>
docker one is practically guaranteed to work, I'd think, but...it's docker...
<cobax>
there is a docker one? please point me to it
<cobax>
picolisp.com does not mention it
<Regenaxer>
There were some mentions in the mailing list iirc
<cobax>
Regenaxer: so are you interested in hosting a one-click solution on your website if I end up paying for it and publishing it for free BSD or MIT license?
<cobax>
Regenaxer: since you won't answer, once I have a one-click version, I'll host it on easypicolisp.com or some such and then if you want it at that point I'll just give it to you
<Regenaxer>
Great, thanks!
<cobax>
Thank you for trying to help me, it's just that I'm more interested in helping automate whatever is needed to install this so that programmers like me who want to try it but are not sysadmins can try it too