Re: New website - back to the old unicorn!

2020-10-26 Thread Neil Cherry

Wow, just learned a few new things about org-mode by a quick look at the new 
pages.
Now I have to learn more things. (I really hate you guys! ;-) )

--
Linux Home Automation Neil Cherry   nche...@linuxha.com
http://www.linuxha.com/ Main site
http://linuxha.blogspot.com/My HA Blog
Author of:  Linux Smart Homes For Dummies



Re: ob-sql posgresql windows problems

2020-10-26 Thread Neil Cherry

On 10/24/20 7:41 AM, Bastien wrote:

Hi Neil,

Neil Cherry  writes:


I'm on a Windows 10 System, I'm using ob-sql.el and when I C-c C-c
on the src block I get:


What version of Org are you using?  M-x org-version RET

Thanks,



Org mode version 9.1.9 (release_9.1.9-65-g5e4542 @ 
c:/Users/NC1951/Documents/emacs-26.1/share/emacs/26.1/lisp/org/)

I did fix the issue by adding an if clause for Windows NT. It was caused by the
PGPASSORD being used before the command when it shouldn't have been there. I 
have
Postgres password file setup for the machine I want to access. Since the change 
it's
been working very well.

I think you're going to suggest that I upgrade my Windows machine to the latest.
I'll need to find that command after I backup my machine.

--
Linux Home Automation Neil Cherry   nche...@linuxha.com
http://www.linuxha.com/ Main site
http://linuxha.blogspot.com/My HA Blog
Author of:  Linux Smart Homes For Dummies



ob-sql posgresql windows problems

2020-10-14 Thread Neil Cherry

I'm on a Windows 10 System, I'm using ob-sql.el and when I C-c C-c on the src 
block I
get:

'PGPASSWORD' os mpt recognized as an internal or external command.

Example block:

#+name: My queries (Not working - 'PGPASSWORD' is not recognized as an internal 
or external)
#+header: :engine postgresql
#+header: :dbhost pgdb.example.com
#+header: :dbuser user
#+header: :dbpassword password
#+header: :database db
#+begin_src sql
select count(*) from db.pserver
#+end_src

I've tried to use an elisp block to set the SHELL to the correct bash path but 
it
still calls cmd.

Any suggestions to help with debugging.

--
Linux Home Automation Neil Cherry   nche...@linuxha.com
http://www.linuxha.com/ Main site
http://linuxha.blogspot.com/My HA Blog
Author of:  Linux Smart Homes For Dummies



Re: FWD: Org-Babel Support for Powershell

2020-06-09 Thread Neil Cherry
On 6/6/20 10:01 AM, stardiviner wrote:

> I remember already there are some ob-powershell relative projects. You might
> want to work and improve features on those work. And integrate it into Org 
> Mode.
> 
> - https://gist.github.com/cbilson/ae0d90d163be4d769f8a15ddb58292bc

Using this in Windows 10.

I found that I've had to change:

"-NoLogo -NonInteractive"))

to

"-NoLogo -NonInteractive -ExecutionPolicy Bypass  ")) ;;; need to avoid MS no 
scripts policy

I needed to user powershell to get around some of the stdout issues with cygwin
and mgwin.

I've not used powershell before so I'm still learning it. Definitely not in
Unix anymore. Thirty five  years of Unix and DOS makes this a very strange
beast.

> - https://github.com/togakangaroo/ob-pwsh

I hadn't seen this one, I'll take a look at it later.

-- 
Linux Home Automation Neil Cherry   nche...@linuxha.com
http://www.linuxha.com/ Main site
http://linuxha.blogspot.com/My HA Blog
Author of:  Linux Smart Homes For Dummies



signature.asc
Description: OpenPGP digital signature


Re: org-mode setting the browser with options

2020-04-30 Thread Neil Cherry
On 4/29/20 6:49 PM, Neil Cherry wrote:
> On 4/29/20 6:30 PM, Tim Cross wrote:
>>
>> Jude DaShiell  writes:
>>
>>> Two different scripts one yproxy and the other nproxy.
>>> Put the necessary running code in each.
>>>
>>> On Wed, 29 Apr 2020, Neil Cherry wrote:
>>>
>>>> Date: Wed, 29 Apr 2020 13:36:50
>>>> From: Neil Cherry 
>>>> To: Org Mode 
>>>> Subject: org-mode setting the browser with options
>>>>
>>>> I need to use 2 different Windows browser (proxy and no-proxy is the 
>>>> reason).
>>>>
>>>> What I want to do is that if it's example.com use firefox (no options). If 
>>>> it's
>>>> example.org use chrome --no-proxy-server. I'm not exacly sure how to 
>>>> approach this.
>>>>
>>>> Thanks
>>>>
>>>>
>>
>> I would look at browse-url built-in package. With browse-url you can set
>> a function that will determine which browser to use based on the url and
>> you can set the options for each supported browser. 
>>
> 
> Thanks, that got me thinking and search-fu found:
> 
> (setq
>  browse-url-browser-function
>  '(
>   ("example\\.com" . browse-url-chrome)
>   ("example\\.org" . browse-url-chrome)
>   ("." . browse-url-default-browser)
>   ))
> 
> Which works perfect!

Slight amendment, I think this code also helped:

(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.

 '(browse-url-browser-function (quote browse-url-default-browser))
 '(browse-url-chrome-arguments (quote ("--no-proxy-server")))
 '(browse-url-chrome-program "chrome")

)

Note that the extra lines I'm referring to are the 3 browse-url-... lines in the
custom-set-variables

Thanks
-- 
Linux Home Automation Neil Cherry   nche...@linuxha.com
http://www.linuxha.com/ Main site
http://linuxha.blogspot.com/My HA Blog
Author of:  Linux Smart Homes For Dummies



Re: org-mode setting the browser with options

2020-04-29 Thread Neil Cherry
On 4/29/20 6:30 PM, Tim Cross wrote:
> 
> Jude DaShiell  writes:
> 
>> Two different scripts one yproxy and the other nproxy.
>> Put the necessary running code in each.
>>
>> On Wed, 29 Apr 2020, Neil Cherry wrote:
>>
>>> Date: Wed, 29 Apr 2020 13:36:50
>>> From: Neil Cherry 
>>> To: Org Mode 
>>> Subject: org-mode setting the browser with options
>>>
>>> I need to use 2 different Windows browser (proxy and no-proxy is the 
>>> reason).
>>>
>>> What I want to do is that if it's example.com use firefox (no options). If 
>>> it's
>>> example.org use chrome --no-proxy-server. I'm not exacly sure how to 
>>> approach this.
>>>
>>> Thanks
>>>
>>>
> 
> I would look at browse-url built-in package. With browse-url you can set
> a function that will determine which browser to use based on the url and
> you can set the options for each supported browser. 
> 

Thanks, that got me thinking and search-fu found:

(setq
 browse-url-browser-function
 '(
  ("example\\.com" . browse-url-chrome)
  ("example\\.org" . browse-url-chrome)
  ("." . browse-url-default-browser)
  ))

Which works perfect!

Thanks
-- 
Linux Home Automation Neil Cherry   nche...@linuxha.com
http://www.linuxha.com/ Main site
http://linuxha.blogspot.com/My HA Blog
Author of:  Linux Smart Homes For Dummies



org-mode setting the browser with options

2020-04-29 Thread Neil Cherry
I need to use 2 different Windows browser (proxy and no-proxy is the reason).

What I want to do is that if it's example.com use firefox (no options). If it's
example.org use chrome --no-proxy-server. I'm not exacly sure how to approach 
this.

Thanks

-- 
Linux Home Automation Neil Cherry   nche...@linuxha.com
http://www.linuxha.com/ Main site
http://linuxha.blogspot.com/My HA Blog
Author of:  Linux Smart Homes For Dummies



Re: #+BEGIN_SRC sh C-c C-c in Windows

2020-04-26 Thread Neil Cherry
On 4/23/20 9:46 AM, Neil Cherry wrote:
> On 4/23/20 2:15 AM, Robert Klein wrote:
>> Hi,
>>
>> On Wed, 22 Apr 2020 08:09:39 -0400
>> Neil Cherry  wrote:
>>
>>> I've searched for a resolution for this but haven't found one. I want
>>> to be able to call a different command shell in Windows. What I keep
>>> seeing is that it can't find /bin/sh
>>>
>>> #+BEGIN_SRC sh :results output
>>> set
>>> #+END_SRC
>>>

Thanks to everyone who helped (Robert. Steven, Julius). Basically the Windows 
path
was munged and for some reason adding to the path (exec-path) didn't help. 
Anyway,
cleaned up the path and it is now working on both Windows (Home and Work PC).

#+BEGIN_SRC bash :shebang "#!/usr/bin/bash" :results output :wrap
echo -e "#\n# Date: '$(date +%Y-%m-%d)'\n#"
#+END_SRC

#+RESULTS:
#+BEGIN_RESULTS
#
# Date: '2020-04-26'
#
#+END_RESULTS

-- 
Linux Home Automation Neil Cherry   nche...@linuxha.com
http://www.linuxha.com/ Main site
http://linuxha.blogspot.com/My HA Blog
Author of:  Linux Smart Homes For Dummies



Re: #+BEGIN_SRC sh C-c C-c in Windows

2020-04-23 Thread Neil Cherry
On 4/23/20 2:15 AM, Robert Klein wrote:
> Hi,
> 
> On Wed, 22 Apr 2020 08:09:39 -0400
> Neil Cherry  wrote:
> 
>> I've searched for a resolution for this but haven't found one. I want
>> to be able to call a different command shell in Windows. What I keep
>> seeing is that it can't find /bin/sh
>>
>> #+BEGIN_SRC sh :results output
>> set
>> #+END_SRC
>>
>> I would prefer that I can change it to the bash shell in PortableGit.
>> Also I have no ability to add packages to the machine (other than
>> emacs). I don't have admin on this machine.
>>
>> Thanks
> 
> use
> 
> #begin_src bash ...

#+BEGIN_SRC sh bash :results value raw
  set
#+END_SRC

Hit C-c C-C in the block results in:

emacs returns /usr/bin/sh: sh: command not found

-- 
Linux Home Automation Neil Cherry   nche...@linuxha.com
http://www.linuxha.com/ Main site
http://linuxha.blogspot.com/My HA Blog
Author of:  Linux Smart Homes For Dummies



#+BEGIN_SRC sh C-c C-c in Windows

2020-04-22 Thread Neil Cherry
I've searched for a resolution for this but haven't found one. I want to be able
to call a different command shell in Windows. What I keep seeing is that it 
can't
find /bin/sh

#+BEGIN_SRC sh :results output
set
#+END_SRC

I would prefer that I can change it to the bash shell in PortableGit.
Also I have no ability to add packages to the machine (other than emacs).
I don't have admin on this machine.

Thanks
-- 
Linux Home Automation Neil Cherry   nche...@linuxha.com
http://www.linuxha.com/ Main site
http://linuxha.blogspot.com/My HA Blog
Author of:  Linux Smart Homes For Dummies