Re: [Pharo-users] Windows headless and service

2016-02-01 Thread Robert Kuszinger
Hello!

No luck by far. Information on forums is not enopugh for me (this is
definitely my fault, my limited background in the squek/pharo VM world).

I've checked different setups. Even putting CogVM into operation with Pharo
is not evident for me.

My trivial test was the *-headless* option which is listed with windows
Pharo but it won't start at all. No process is created. The XULRunner
example mentioned is "out of my reach" (and the demo was on Linux, also
subsequent comments on the forums stated that Mac/Win versions are not
headless.).

Who could check if it works at all? Actually I've invested a week in this
small Seaside app, performs beautifully but now it seems that It simply
cannot be installed on Windows? *How do people use Seaside/Pharo on Windows*.
Is there someone using it at all? :)
No problem if I'm the first one, anyway.
My goal is to start it automatically in the background (service is not
necessary, again, it is enought to be started).
Is it possible that Pharo starts with a widnow (splash) but noone sees it?

Summarizing:
- I'm looking for a solution to start a headless Seaside app on Windows
possibly with Pharo image.

thanks for any recommendations.




Robert Kuszinger  ezt írta (időpont: 2016. jan. 31.,
V, 8:27):

> Torsten, thanks.
>
> Ok, I'll test it. Idon't mind I need SRVANY or other solution on win to
> start it. It is not necessary to provide a well formed service.
> I'm stopped at the headless running at all. I'Ll check the headless CogVM.
> Once it runs headless I'll be able to launch it at machine start.
>
> I'll share my results here.
>
> best regards
> Robert
>
>
> Torsten Bergmann  ezt írta (időpont: 2016. jan. 31., V,
> 1:31):
>
>> Running as Windows Service was possible back in Squeak VM days where
>> Andreas Raab implemented registration into SCM (Service Control Manager).
>> Code should be in Pharo VM too.
>>
>> See also http://forum.world.st/headless-CogVM-on-Windows-td4648336.html
>>
>> Possibly the "-service" may be broken/may not be recognized in Pharo Win
>> VM
>> anymore, havent checked.
>>
>> Bye
>> T.
>>
>>


Re: [Pharo-users] Windows headless and service

2016-02-01 Thread Robert Kuszinger
Esteban,


thanks, I'll try and keep informed...

regards
Robert



2016-02-01 11:14 GMT+01:00 Esteban Lorenzano :

> Hi  Robert,
>
> First, the option to execute pharo headless is “—headless” (two “-“, not
> just one). Maybe the help is bad :)
> But that will not solve your problem at all, since headless mode is fake
> and in case of windows it will open anyway a window (in the systray if you
> are lucky…).
>
> However, I managed (some years ago, so do not ask for details ;) to run a
> pharo app as a service using this program: http://rozanski.org.uk/services
> here is an article that explains how to use it:
> http://www.howtogeek.com/50786/using-srvstart-to-run-any-application-as-a-windows-service/
> (I do not remember how I did it and it would be nice if you can share your
> experience, so we can have documentation somewhere :P)
>
> Also I googled a bit and according to this:
> http://stackoverflow.com/questions/3582108/create-windows-service-from-executable,
> looks like the “microsoft” way of doing it is using a command “sc”. I
> suppose that command will not work if your program is not prepared for
> being a service, but you can give it a try (first approach *will* work,
> anyway :P)
>
> Hope this works… please keep us informed.
> Esteban
>
>
>


Re: [Pharo-users] Windows headless and service

2016-02-01 Thread Ben Coman
On Mon, Feb 1, 2016 at 4:04 PM, Robert Kuszinger  wrote:
> Who could check if it works at all? Actually I've invested a week in this
> small Seaside app, performs beautifully but now it seems that It simply
> cannot be installed on Windows? How do people use Seaside/Pharo on Windows.
> Is there someone using it at all? :)
> No problem if I'm the first one, anyway.
> My goal is to start it automatically in the background (service is not
> necessary, again, it is enought to be started).
> Is it possible that Pharo starts with a widnow (splash) but noone sees it?
>
> Summarizing:
> - I'm looking for a solution to start a headless Seaside app on Windows
> possibly with Pharo image.
>
> thanks for any recommendations.

Hi Robert,

I haven't had anything to do with headless Pharo, so I'm no use to you
there.  Hopefully someone else can help, but I have personal saying
"If you can't solve the problem, change the problem" -- so just a wild
suggestion for a kludge workaround until you get a better answer - run
virtualbox headless [1] or as a service [2] with Linux inside to run
headless Pharo.  Disclaimer, I've not tried these myself either - just
found them through a search.

[1] 
https://mkrmr.wordpress.com/2011/05/06/running-a-headless-virtualbox-in-windows/
[2] https://code.google.com/archive/p/virtualboxservice/

HTH, cheers -ben



Re: [Pharo-users] Windows headless and service

2016-02-01 Thread Robert Kuszinger
Wow!

Nice workaround but cannot help this case.
If I'd have the power for such a thing I'd change the Win server to Linux.
There are too many dependencies in the background which are all Windows
related. I cannot add - or better, not allowed to add -  virtualbox nor
qemu or other layer to the system. And this small app also uses ODBC to
connect SQL server on the same Win machine. But the key issue is that I
cannot add any other component but maybe Smalltalk app. Smalltalk is my
choice and preference. And actually, the app is done.

Anyway, thanks for the idea :)

Best regards
Robert




Ben Coman  ezt írta (időpont: 2016. febr. 1., H,
10:29):

> On Mon, Feb 1, 2016 at 4:04 PM, Robert Kuszinger 
> wrote:
> > Who could check if it works at all? Actually I've invested a week in this
> > small Seaside app, performs beautifully but now it seems that It simply
> > cannot be installed on Windows? How do people use Seaside/Pharo on
> Windows.
> > Is there someone using it at all? :)
> > No problem if I'm the first one, anyway.
> > My goal is to start it automatically in the background (service is not
> > necessary, again, it is enought to be started).
> > Is it possible that Pharo starts with a widnow (splash) but noone sees
> it?
> >
> > Summarizing:
> > - I'm looking for a solution to start a headless Seaside app on Windows
> > possibly with Pharo image.
> >
> > thanks for any recommendations.
>
> Hi Robert,
>
> I haven't had anything to do with headless Pharo, so I'm no use to you
> there.  Hopefully someone else can help, but I have personal saying
> "If you can't solve the problem, change the problem" -- so just a wild
> suggestion for a kludge workaround until you get a better answer - run
> virtualbox headless [1] or as a service [2] with Linux inside to run
> headless Pharo.  Disclaimer, I've not tried these myself either - just
> found them through a search.
>
> [1]
> https://mkrmr.wordpress.com/2011/05/06/running-a-headless-virtualbox-in-windows/
> [2] https://code.google.com/archive/p/virtualboxservice/
>
> HTH, cheers -ben
>
>


Re: [Pharo-users] Problem to open Pharo 50 on Windows

2016-02-01 Thread Esteban Lorenzano

> On 31 Jan 2016, at 22:05, Franck Warlouzet  
> wrote:
> 
> For my case, windows 10, latest I assume. Installed on the desktop (in 
> several directories, I'm organized).
> 
> Do you think it could be an admin rights issue if it is installed in 
> protected directories in Justine's case ? 

it has to be… otherwise I cannot imagine what it can be :(

Esteban 

> 
> Franck
> 
> > To: pharo-users@lists.pharo.org 
> > From: step...@stack.nl 
> > Date: Sun, 31 Jan 2016 20:27:37 +0100
> > Subject: Re: [Pharo-users] Problem to open Pharo 50 on Windows
> > 
> > On 31-01-16 18:55, Franck Warlouzet wrote:
> > > I tried to help Justine a bit, but I have the same OS, the same VM, the
> > > same image, the same sources and it works for me but not for her,
> > 
> > Which OS & update version, in what directories is it installed?
> > 
> > Stephan
> > 
> > 



Re: [Pharo-users] Windows headless and service

2016-02-01 Thread Esteban Lorenzano
Hi  Robert, 

First, the option to execute pharo headless is “—headless” (two “-“, not just 
one). Maybe the help is bad :)
But that will not solve your problem at all, since headless mode is fake and in 
case of windows it will open anyway a window (in the systray if you are 
lucky…). 

However, I managed (some years ago, so do not ask for details ;) to run a pharo 
app as a service using this program: http://rozanski.org.uk/services 

here is an article that explains how to use it: 
http://www.howtogeek.com/50786/using-srvstart-to-run-any-application-as-a-windows-service/
 

(I do not remember how I did it and it would be nice if you can share your 
experience, so we can have documentation somewhere :P)

Also I googled a bit and according to this: 
http://stackoverflow.com/questions/3582108/create-windows-service-from-executable
 
,
 looks like the “microsoft” way of doing it is using a command “sc”. I suppose 
that command will not work if your program is not prepared for being a service, 
but you can give it a try (first approach *will* work, anyway :P)

Hope this works… please keep us informed. 
Esteban


> On 01 Feb 2016, at 09:04, Robert Kuszinger  wrote:
> 
> Hello!
> 
> No luck by far. Information on forums is not enopugh for me (this is 
> definitely my fault, my limited background in the squek/pharo VM world).
> 
> I've checked different setups. Even putting CogVM into operation with Pharo 
> is not evident for me.
> 
> My trivial test was the -headless option which is listed with windows Pharo 
> but it won't start at all. No process is created. The XULRunner example 
> mentioned is "out of my reach" (and the demo was on Linux, also subsequent 
> comments on the forums stated that Mac/Win versions are not headless.).
> 
> Who could check if it works at all? Actually I've invested a week in this 
> small Seaside app, performs beautifully but now it seems that It simply 
> cannot be installed on Windows? How do people use Seaside/Pharo on Windows. 
> Is there someone using it at all? :)
> No problem if I'm the first one, anyway.
> My goal is to start it automatically in the background (service is not 
> necessary, again, it is enought to be started).
> Is it possible that Pharo starts with a widnow (splash) but noone sees it? 
> 
> Summarizing:
> - I'm looking for a solution to start a headless Seaside app on Windows 
> possibly with Pharo image.
> 
> thanks for any recommendations.
> 
> 
> 
> 
> Robert Kuszinger mailto:kuszin...@giscom.hu>> ezt írta 
> (időpont: 2016. jan. 31., V, 8:27):
> Torsten, thanks.
> 
> Ok, I'll test it. Idon't mind I need SRVANY or other solution on win to start 
> it. It is not necessary to provide a well formed service.
> I'm stopped at the headless running at all. I'Ll check the headless CogVM. 
> Once it runs headless I'll be able to launch it at machine start.
> 
> I'll share my results here.
> 
> best regards
> Robert
> 
> 
> Torsten Bergmann mailto:asta...@gmx.de>> ezt írta (időpont: 
> 2016. jan. 31., V, 1:31):
> Running as Windows Service was possible back in Squeak VM days where
> Andreas Raab implemented registration into SCM (Service Control Manager).
> Code should be in Pharo VM too.
> 
> See also http://forum.world.st/headless-CogVM-on-Windows-td4648336.html 
> 
> 
> Possibly the "-service" may be broken/may not be recognized in Pharo Win VM
> anymore, havent checked.
> 
> Bye
> T.
> 



Re: [Pharo-users] Windows headless and service

2016-02-01 Thread jan.struz
Hi,
try NSSM - https://nssm.cc/usage

I personally haven't found anything better.




-
Save The World!
--
View this message in context: 
http://forum.world.st/Windows-headless-and-service-tp4874988p4875168.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.



[Pharo-users] Parsing User-Agent strings with a web service

2016-02-01 Thread Sven Van Caekenberghe
I want to share a snippet of code.

In HTTP, a client identifies itself using the User-Agent header. That string is 
long and cryptic. To make sense of it you have to parse it. There are web 
services that can do this. Here is how you can invoke one of them.

ZnClient new
  http;
  host: 'useragentstring.com';
  queryAt: 'uas' put: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) 
AppleWebKit/601.4.4 (KHTML, like Gecko) Version/9.0.3 Safari/601.4.4';
  queryAt: 'getJSON' put: 'all';
  contentReader: [ :entity | NeoJSONReader fromString: entity contents ];
  get.

Since STON parsing is backward compatible with JSON, you can use that as well.

ZnClient new
  http;
  host: 'useragentstring.com';
  queryAt: 'uas' put: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) 
AppleWebKit/601.4.4 (KHTML, like Gecko) Version/9.0.3 Safari/601.4.4';
  queryAt: 'getJSON' put: 'all';
  contentReader: [ :entity | STON fromString: entity contents ];
  get. 

You will get back a nice dictionary with much more sensible key/value pairs.

Note that this is a public service. I think it would be polite and more 
efficient if you put a cache in front of it, like LRUCache.

Sven




Re: [Pharo-users] Windows headless and service

2016-02-01 Thread Esteban Lorenzano

> On 01 Feb 2016, at 13:19, jan.struz  wrote:
> 
> Hi,
> try NSSM - https://nssm.cc/usage
> 
> I personally haven't found anything better.

looks nice! :)

> 
> 
> 
> 
> -
> Save The World!
> --
> View this message in context: 
> http://forum.world.st/Windows-headless-and-service-tp4874988p4875168.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
> 




Re: [Pharo-users] Problem to open Pharo 50 on Windows

2016-02-01 Thread Ben Coman
>> To: pharo-users@lists.pharo.org
>> From: step...@stack.nl
>> Date: Sun, 31 Jan 2016 20:27:37 +0100
>> Subject: Re: [Pharo-users] Problem to open Pharo 50 on Windows
>>
>> On 31-01-16 18:55, Franck Warlouzet wrote:
>> > I tried to help Justine a bit, but I have the same OS, the same VM, the
>> > same image, the same sources and it works for me but not for her,
>>
>> Which OS & update version, in what directories is it installed?
>>
>> Stephan


> On 31 Jan 2016, at 22:05, Franck Warlouzet 
> wrote:
>
> For my case, windows 10, latest I assume. Installed on the desktop (in
> several directories, I'm organized).
>
> Do you think it could be an admin rights issue if it is installed in
> protected directories in Justine's case ?

On Mon, Feb 1, 2016 at 5:44 PM, Esteban Lorenzano  wrote:
>
> it has to be… otherwise I cannot imagine what it can be :(

One thing to consider...  if the Image was installed into a protected
folder by an administrator, and then opened and then saved by a
standard-user, Windows presents *very* strange and *misleading*
behaviour,
which I describe here...
http://forum.world.st/FEEDBACK-Install-Pharo-on-Windows-td4733900.html#a4740803

Basically, the files installed into Window's protected folders *must*
be read only, or all hell breaks loose :).  When the standard-user
tries to write to Pharo.image in the protected folder, Windows (ever
s helpful) doesn't complain but *silently* takes a shadow copy of
the protected folder into the standard-user's folder which can be
written to. It then *transparently* makes it seem like the file in the
original location was updated, for that user.  The same happens for
other users so that for a single file location (e.g.
"C:\..\protected\Pharo.image") each user sees different data.

Should the original file be *really* updated by an administrator
installing an upgrade, the standard-users don't see the change.  They
still see only their own custom unique shadow version of Pharo.image.
This is really *evil* behaviour, so its good to share from this info
from time to time, even if its not the cause in this case.

btw, you can easily confirm this yourself just using notepad to edit a
protected txt file while switching a few times between Admin and
Standard-User accounts.  Some things have to be seen to be believed.

cheers -ben



Re: [Pharo-users] Problem to open Pharo 50 on Windows

2016-02-01 Thread Justine STIENNE
Thank you everybody. Now it's working :-)

Justine

2016-02-01 17:55 GMT+01:00 Ben Coman :

> >> To: pharo-users@lists.pharo.org
> >> From: step...@stack.nl
> >> Date: Sun, 31 Jan 2016 20:27:37 +0100
> >> Subject: Re: [Pharo-users] Problem to open Pharo 50 on Windows
> >>
> >> On 31-01-16 18:55, Franck Warlouzet wrote:
> >> > I tried to help Justine a bit, but I have the same OS, the same VM,
> the
> >> > same image, the same sources and it works for me but not for her,
> >>
> >> Which OS & update version, in what directories is it installed?
> >>
> >> Stephan
>
>
> > On 31 Jan 2016, at 22:05, Franck Warlouzet 
> > wrote:
> >
> > For my case, windows 10, latest I assume. Installed on the desktop (in
> > several directories, I'm organized).
> >
> > Do you think it could be an admin rights issue if it is installed in
> > protected directories in Justine's case ?
>
> On Mon, Feb 1, 2016 at 5:44 PM, Esteban Lorenzano 
> wrote:
> >
> > it has to be… otherwise I cannot imagine what it can be :(
>
> One thing to consider...  if the Image was installed into a protected
> folder by an administrator, and then opened and then saved by a
> standard-user, Windows presents *very* strange and *misleading*
> behaviour,
> which I describe here...
>
> http://forum.world.st/FEEDBACK-Install-Pharo-on-Windows-td4733900.html#a4740803
>
> Basically, the files installed into Window's protected folders *must*
> be read only, or all hell breaks loose :).  When the standard-user
> tries to write to Pharo.image in the protected folder, Windows (ever
> s helpful) doesn't complain but *silently* takes a shadow copy of
> the protected folder into the standard-user's folder which can be
> written to. It then *transparently* makes it seem like the file in the
> original location was updated, for that user.  The same happens for
> other users so that for a single file location (e.g.
> "C:\..\protected\Pharo.image") each user sees different data.
>
> Should the original file be *really* updated by an administrator
> installing an upgrade, the standard-users don't see the change.  They
> still see only their own custom unique shadow version of Pharo.image.
> This is really *evil* behaviour, so its good to share from this info
> from time to time, even if its not the cause in this case.
>
> btw, you can easily confirm this yourself just using notepad to edit a
> protected txt file while switching a few times between Admin and
> Standard-User accounts.  Some things have to be seen to be believed.
>
> cheers -ben
>
>


Re: [Pharo-users] Problem to open Pharo 50 on Windows

2016-02-01 Thread Ben Coman
On Tue, Feb 2, 2016 at 3:05 AM, Justine STIENNE
 wrote:
> Thank you everybody. Now it's working :-)

Cool.  Can you report the solution to help the next person that might
be stuck by the same thing?
cheers -ben

>
> Justine
>
> 2016-02-01 17:55 GMT+01:00 Ben Coman :
>>
>> >> To: pharo-users@lists.pharo.org
>> >> From: step...@stack.nl
>> >> Date: Sun, 31 Jan 2016 20:27:37 +0100
>> >> Subject: Re: [Pharo-users] Problem to open Pharo 50 on Windows
>> >>
>> >> On 31-01-16 18:55, Franck Warlouzet wrote:
>> >> > I tried to help Justine a bit, but I have the same OS, the same VM,
>> >> > the
>> >> > same image, the same sources and it works for me but not for her,
>> >>
>> >> Which OS & update version, in what directories is it installed?
>> >>
>> >> Stephan
>>
>>
>> > On 31 Jan 2016, at 22:05, Franck Warlouzet 
>> > wrote:
>> >
>> > For my case, windows 10, latest I assume. Installed on the desktop (in
>> > several directories, I'm organized).
>> >
>> > Do you think it could be an admin rights issue if it is installed in
>> > protected directories in Justine's case ?
>>
>> On Mon, Feb 1, 2016 at 5:44 PM, Esteban Lorenzano 
>> wrote:
>> >
>> > it has to be… otherwise I cannot imagine what it can be :(
>>
>> One thing to consider...  if the Image was installed into a protected
>> folder by an administrator, and then opened and then saved by a
>> standard-user, Windows presents *very* strange and *misleading*
>> behaviour,
>> which I describe here...
>>
>> http://forum.world.st/FEEDBACK-Install-Pharo-on-Windows-td4733900.html#a4740803
>>
>> Basically, the files installed into Window's protected folders *must*
>> be read only, or all hell breaks loose :).  When the standard-user
>> tries to write to Pharo.image in the protected folder, Windows (ever
>> s helpful) doesn't complain but *silently* takes a shadow copy of
>> the protected folder into the standard-user's folder which can be
>> written to. It then *transparently* makes it seem like the file in the
>> original location was updated, for that user.  The same happens for
>> other users so that for a single file location (e.g.
>> "C:\..\protected\Pharo.image") each user sees different data.
>>
>> Should the original file be *really* updated by an administrator
>> installing an upgrade, the standard-users don't see the change.  They
>> still see only their own custom unique shadow version of Pharo.image.
>> This is really *evil* behaviour, so its good to share from this info
>> from time to time, even if its not the cause in this case.
>>
>> btw, you can easily confirm this yourself just using notepad to edit a
>> protected txt file while switching a few times between Admin and
>> Standard-User accounts.  Some things have to be seen to be believed.
>>
>> cheers -ben
>>
>