Setting up mercurial web interface on nearlyfreespeech - web

I have recently been struggling with setting up my webhost to be used for mercurial repos and also for hgweb. I use nearlyfreespeech.net (NFSN) for hosting.
By default, NFSN has a CGI realm of freebsd72 and restricts you to just CGI, no WGSI or the likes. Originally, NFSN had mercurial 1.6 installed but by following these instructions loosely I was able to get mercurial 2.6 setup. Python 2.6.6 is also installed by default on the host and I have left that as is.
My problem now is that I am not able to load the hgweb.cgi file in my browser. When I run it via SSH on my host it runs fine and output HTML, but in my browser I get a 500 internal server error. The file is executable and CGI is enabled. I am not sure what else there is to check... Does anybody have any advice or experience using hg and hgweb on NFSN?
As suggested in a comment, I have checked the error logs created and found that when I visit the site I get...
[Sun Jun 16 08:22:31 2013] [error] [client 172.17.0.141] CGI ERROR: A system problem prevented your request from being completed.
[Sun Jun 16 08:22:31 2013] [error] [client 172.17.0.141] Premature end of script headers: hgweb.cgi
A bit of searching on that error turns up that it means the script may not be generating the correct headers when run. If I save the output of the script to a file I get the following...
Status: 200 Script output follows
Content-Type: text/html; charset=US-ASCII
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
<head>
<link rel="icon" href="/static/hgicon.png" type="image/png" />
<meta name="robots" content="index, nofollow" />
<link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
<title>Mercurial repositories index</title>
</head>
<body>
<div class="container">
<div class="menu">
<a href="http://mercurial.selenic.com/">
<img src="/static/hglogo.png" width=75 height=90 border=0 alt="mercurial" /></a>
</div>
<div class="main">
<h2>Mercurial Repositories</h2>
<table class="bigtable">
<tr>
<th>Name</th>
<th>Description</th>
<th>Contact</th>
<th>Last modified</th>
<th> </th>
</tr>
</table>
</div>
</div>
</body>
</html>

I was able to find that the hgweb.cgi script actually required to be set to 755 permissions, setting it to be executable was not enough.

Related

'chromium-browser' is not recognized as an internal or external command, operable program or batch file

I have used this code in AIML file
<category>
<pattern>OPEN GOOGLE</pattern>
<template>
<random>
<li>Sure thing! </li>
<li>Right away, sir! </li>
<li>On it! </li>
</random>
<system> chromium-browser "http://www.google.com"</system>
</template>
</category>
but i am getting the error that chromium-browser is not an external command.
P.S- I am running it with Python 3.7
if you are on mac download chrome and try this
<system> open -a "Google Chrome" http://google.com</system>
Assuming your interpreter supports AIML 2, you can do this using the <link> tag.
<category>
<pattern>OPEN GOOGLE</pattern>
<template>
<link>
<text>
<random>
<li>Sure thing!</li>
<li>Right away, sir!</li>
<li>On it!</li>
</random>
</text>
<url>http://www.google.com</url>
</link>
</template>
</category>

xmllint fails to validate XHTML 1.0 Transitional file

Steps to reproduce on Debian Jessie GNU/Linux.
Check xmllint version:
$ xmllint --version
xmllint: using libxml version 20901
compiled with: Threads Tree Output Push Reader Patterns Writer SAXv1 FTP HTTP DTDValid HTML Legacy C14N Catalog XPath XPointer XInclude Iconv ISO8859X Unicode Regexps Automata Expr Schemas Schematron Modules Debug Zlib Lzma
Make an XHTML 1.0 Transitional file by saving this as example.xhtml:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>A title</title>
</head>
<body>
Some content
</body>
</html>
N.B. Pasting the contents of example.xhtml into the W3C Validator yields "This document was successfully checked as XHTML 1.0 Transitional!", so it should also validate when using xmllint.
xmllint online validation
This fails, despite the fact that the computer has internet access:
$ xmllint --noout --valid example.xhtml
example.xhtml:1: warning: failed to load external entity "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
^
example.xhtml:2: validity error : Validation failed: no DTD found !
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
^
xmllint offline validation
Install XHTML 1.0 DTDs and entity files:
$ wget -qO- https://www.w3.org/TR/xhtml1/xhtml1.tgz | tar xvz
xhtml1-20020801/
xhtml1-20020801/W3C-REC.css
xhtml1-20020801/xhtml.css
xhtml1-20020801/logo-REC.png
xhtml1-20020801/w3c_home.png
xhtml1-20020801/wcag1AAA.png
xhtml1-20020801/acks.html
xhtml1-20020801/Cover.html
xhtml1-20020801/definitions.html
xhtml1-20020801/diffs.html
xhtml1-20020801/dtds.html
xhtml1-20020801/guidelines.html
xhtml1-20020801/introduction.html
xhtml1-20020801/issues.html
xhtml1-20020801/normative.html
xhtml1-20020801/Overview.html
xhtml1-20020801/prohibitions.html
xhtml1-20020801/references.html
xhtml1-20020801/xhtml1-diff.html
xhtml1-20020801/DTD/
xhtml1-20020801/DTD/xhtml-lat1.ent
xhtml1-20020801/DTD/xhtml-special.ent
xhtml1-20020801/DTD/xhtml-symbol.ent
xhtml1-20020801/DTD/xhtml.soc
xhtml1-20020801/DTD/xhtml1-frameset.dtd
xhtml1-20020801/DTD/xhtml1-strict.dtd
xhtml1-20020801/DTD/xhtml1-transitional.dtd
xhtml1-20020801/DTD/xhtml1.dcl
xhtml1-20020801/xhtml1.ps
xhtml1-20020801/xhtml1.pdf
Still fails:
$ xmllint --noout --dtdvalid xhtml1-20020801/DTD/xhtml1-transitional.dtd example.xhtml
example.xhtml:1: warning: failed to load external entity "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
^
Likewise if using the --nonet option:
$ xmllint --noout --nonet --dtdvalid xhtml1-20020801/DTD/xhtml1-transitional.dtd example.xhtml
I/O error : Attempt to load network entity http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
example.xhtml:1: warning: failed to load external entity "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
^
Questions
I have two questions:
Why did none of these validation attempts succeed?
The second one seems to fail because despite using the --dtdvalid option, xmllint still tries to visit http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd because it is referenced in example.xhtml. Is there some way to tell xmllint to ignore that reference and to instead use a local DTD (e.g. the one already stored at xhtml1-20020801/DTD/xhtml1-transitional.dtd?
It seems the simplest workaround is:
$ sudo apt-get install w3c-dtd-xhtml
This installs the relevant DTDs locally. Thereafter, validation succeeds:
$ xmllint --noout --valid example.xhtml
$
However, although this allows me to validate the XHTML file, it does not really answer the questions. Therefore, I will not mark this question as "answered", in the hope that someone will provide an answer that does indeed answer them.

how to include same file in different directory?

Directory structure :
Main directory structure
home.php
thankyou.php
Php directory structure
root directory/php/date.php
Include directory structure
root directory/include/header.php
root directory/include/footer.php
Images directory structure
root directory/images/logo.png
root directory/images/abc.jpg
For date.php, i want to use header and footer.php files. but images are not shown.
i written below code
<?php require_once '../include/header.php';?>
But when i used for home and thankyou.php, It is working fine.
In header file, code for images
<img src="images/logo.png" alt="Logo" class="image">
i dont want to change directory for date.php. And not interested to absolute path for images.
What to do so that images will be see in both directory()
i Used base html tag as doubleui told me in head section
<head>
<base href="root directory/images/" target="_blank">
</head>

How can I check for Visual Studio updates via the command line?

In an attempt to streamline my Virtual Environment setup, I'm using Chocolatey to automate my VM.
Since I can run the cinst command to install Visual Studio
c:\> cinst VisualStudio2012Professional
I'm wondering if after it's installed, is there a command line switch to check for (and subsequently "install") updates within Visual Studio?
Something along the lines of...
"C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe" /InstallUpdates
This should also extend to any extensions that are installed along side VS.
There is a way to check but it is not at all straight forward. Visual Studio Updates are published via an ATOM feed that is currently hosted here:
http://go.microsoft.com/fwlink/?LinkID=251032
This URL can be located in:
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\CommonExtensions\Platform\Shell\Microsoft.VisualStudio.ExtensionManager.Implementation.pkgdef
Under the [$RootKey$\ExtensionManager\Repositories{52943709-1abb-4abe-b413-41e8bb6d0462}] key.
The above URL should not change for any version of Visual studio BUT that is not a guarantee. If you examine the response of http://go.microsoft.com/fwlink/?LinkID=290886, you will currently get this response:
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title type="text"></title>
<id>uuid:99B94631-1B1A-45A0-9C34-54F75988DD54;id=1</id>
<updated>2013-02-12T20:00:00-07:00</updated>
<entry>
<id>8EAF6C8E-1283-4EEE-AB6E-F0F087BFCBFF</id>
<title type="text">Visual Studio 2012 Update 3</title>
<summary type="text">Includes security updates, other critical updates, hotfixes, and feature packs that have been issued since the product was released.</summary>
<published>2012-12-01T21:00:00-07:00</published>
<updated>2012-12-01T21:00:00-07:00</updated>
<author>
<name>Microsoft Corp.</name>
</author>
<link rel="alternate" type="text/html" href="http://go.microsoft.com/fwlink/?LinkID=257044&clcid=0x409"/>
<link rel="releasenotes" type="text/html" href="http://go.microsoft.com/fwlink/?LinkID=257045&clcid=0x409"/>
<link rel="update" type="text" href="http://go.microsoft.com/fwlink/?LinkID=302339"/>
<!-- icon should be 32 x 32 pixels -->
<link rel="icon" type="text" href="http://visualstudiogallery.msdn.microsoft.com/Content/VisualStudio/VSDownload_32x.png"/>
<!-- preview image should be 200 x 200 pixels -->
<link rel="previewimage" type="text" href="http://visualstudiogallery.msdn.microsoft.com/Content/VisualStudio/VSDownload_200x.png"/>
<Vsix xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/developer/vsx-syndication-schema/2010">
<Id>8EAF6C8E-1283-4EEE-AB6E-F0F087BFCBFD</Id>
<Version>11.0.60610.01</Version>
<References />
</Vsix>
</entry>
<entry>
<id>28743233-1A36-4e67-8747-F072F8C76D1F</id>
<title type="text">Visual Studio Extensions for Windows Library for JavaScript</title>
<summary type="text">This release updates the development resources for the controls, CSS styles, and helper functions that are included in the Windows Library for JavaScript.</summary>
<published>2013-08-08T20:00:00-07:00</published>
<updated>2013-08-08T20:00:00-07:00</updated>
<author>
<name>Microsoft Corp.</name>
</author>
<link rel="alternate" type="text/html" href="http://go.microsoft.com/fwlink/?LinkId=260891&clcid=0x409"/>
<link rel="releasenotes" type="text/html" href="http://go.microsoft.com/fwlink/?LinkID=260892&clcid=0x409"/>
<link rel="update" type="text" href="http://go.microsoft.com/fwlink/?LinkID=260893"/>
<link rel="icon" type="text" href="http://visualstudiogallery.msdn.microsoft.com/Content/VisualStudio/VSDownload_32x.png"/>
<link rel="previewimage" type="text" href="http://visualstudiogallery.msdn.microsoft.com/Content/VisualStudio/VSDownload_200x.png"/>
<Vsix xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/developer/vsx-syndication-schema/2010">
<Id>Microsoft.WinJS</Id>
<Version>1.0.9200.20789</Version>
<References />
</Vsix>
</entry>
</feed>
Note that there are two entries in this feed and the one you are interested in is the one with a title beginning with "Visual Studio 2012 Update."
If the Version specified in this file (11.0.60610.01 here) is greater than the version you have on disk:
(Get-Item "${env:ProgramFiles(x86)}\Microsoft Visual Studio 11.0\common7\ide\devenv.exe").VersionInfo.ProductVersion
Then you would want to download and install the url in the Link/#Update node:
<link rel="update" type="text" href="http://go.microsoft.com/fwlink/?LinkID=302339"/>
That Url should redirect to an MSI that has the update.
Based on the information located in the Devenv Command Line Switches MSDN documentation. There is currently no way to call a command line swtich in order to check for / install updates to Visual Studio.
however Matt Wrock shows a nice workaround in his answer.
The answer from #Matt is outdated. For VS2019 follow this way:
Download file at https://aka.ms/vs/16/release/channel (it will be plain JSON file 'VisualStudio.16.Release.chman')
Check node: info->productDisplayVersion (or buildVersion) - they give enough info.

IIS6 to IIS7 - The root element must match the name of the section referencing the file, 'appSettings'

I am moving all my localhost applications from a WinXP/IIS6 machine to a Win7/IIS7.5 one. I copied a few folders from the wwwroot directory of WinXP to wwwroot of Win7. Then created a virtual directory and converted to an application. When I browse this application, I get the error:
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: The root element must match the name of the section referencing the file, 'appSettings'
Source Error:
Line 1: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
Line 2: <html xmlns="http://www.w3.org/1999/xhtml">
Line 3: <head>
Line 4: <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
Source File: C:\inetpub\wwwroot\iisstart.htm Line: 2
What am I missing?
The default app pool for this application was .Net 4.0. Changed it to another apppool of v2.0 and the error went away.

Resources