What are all the standard CGI environment variables? - cgi

CGI scripts should have access to a list of environment variables set by the web server. What are their names?

See RFC 3875 for the CGI spec, which has all the info you need. :-)
From the RFC:
meta-variable-name = "AUTH_TYPE" | "CONTENT_LENGTH" |
"CONTENT_TYPE" | "GATEWAY_INTERFACE" |
"PATH_INFO" | "PATH_TRANSLATED" |
"QUERY_STRING" | "REMOTE_ADDR" |
"REMOTE_HOST" | "REMOTE_IDENT" |
"REMOTE_USER" | "REQUEST_METHOD" |
"SCRIPT_NAME" | "SERVER_NAME" |
"SERVER_PORT" | "SERVER_PROTOCOL" |
"SERVER_SOFTWARE" | scheme |
protocol-var-name | extension-var-name
protocol-var-name = ( protocol | scheme ) "_" var-name
scheme = alpha *( alpha | digit | "+" | "-" | "." )
var-name = token
extension-var-name = token

http://www.cgi101.com/book/ch3/text.html

The "hoohoo" machine at NCSA that has the CGI documentation is down, but here's what seems to be a mirror.

A quick Google search finds the what you need.

Related

Include libheif as an external dependency into project using cmake

I'm trying to include libheif into my project using cmake. Libheif is more complicated than what I've worked with before because it requires you externally build and include libde265.
Attempt #1:
I have used vcpkg to export pre-built binary packages, this creates a directory called libheif which includes everything here:
+---bin
| heif.dll
| libde265.dll
| libx265.dll
| libx265.pdb
|
+---debug
| +---bin
| | heif.dll
| | libde265.dll
| | libx265.dll
| | libx265.pdb
| |
| \---lib
| | heif.lib
| | libde265.lib
| | libx265.lib
| | x265-static.lib
| |
| \---pkgconfig
| libheif.pc
| x265.pc
|
+---include
| | x265.h
| | x265_config.h
| |
| +---libde265
| | de265.h
| |
| \---libheif
| heif.h
|
+---lib
| | heif.lib
| | libde265.lib
| | libx265.lib
| | x265-static.lib
| |
| \---pkgconfig
| libheif.pc
| x265.pc
|
+---share
| +---libde265
| | copyright
| | libde265Config-debug.cmake
| | libde265Config-release.cmake
| | libde265Config.cmake
| | libde265ConfigVersion.cmake
| | vcpkg_abi_info.txt
| |
| +---libheif
| | | copyright
| | | libheif-config-debug.cmake
| | | libheif-config-release.cmake
| | | libheif-config-version.cmake
| | | libheif-config.cmake
| | | vcpkg_abi_info.txt
| | |
| | \---.vs
| | ProjectSettings.json
| | slnx.sqlite
| |
| \---x265
| copyright
| vcpkg_abi_info.txt
|
\---tools
+---libde265
| dec265.exe
| enc265.exe
| libde265.dll
|
\---x265
x265.exe
(There were more headers, I removed them because one illustrates the point) I put folder libheif in my external folder in my project. Then in CMakeLists.txt I have tried using
target_link_libraries(my_project ${CMAKE_SOURCE_DIR}/external/libheif/lib/heif)
that then fails looking for heif.obj file that is not there. It does find the dlls though.
After that failed, I tried again, this time using the .cmake files in the share directory:
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/external/libheif/share/libheif)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/external/libheif/share/libde265)
include(libheif-config)
include(libde265Config)
This I get unresolved external symbol when trying to use anything in libheif.
Attempt #2:
I tried including libeheif by adding it as a submodule git submodule add https://github.com/strukturag/libheif.git external/libheif
and then in CMakeLists.txt I added:
include_directories(external/libheif/include)
include_directories(external/libheif/include/libheif)
include_directories(external/libheif/include/libde265)
add_subdirectory(external/libheif)
target_link_libraries(my_project libheif)
This results in unresolved external symbols whenever I try to use anything in the libheif library.
Other information
The only successful thing I have been able to do is include the headers directory so intellisence recognizes when I #include <heif.h>
I have looked all over on how to include dll and libraries, but all the results either need me to use the cmake GUI, which I am not sure I can because I'm working on this project with other people and I want to make sure it works on their computer without having to use the cmake GUI.
Same with just using vcpkg to include it, I dont want my teammates to have to use it as well, I need to just use CMakeLists.txt
This tutorial would be helpful but the generate stuff is above my head and I couldnt find what it meant by generate. It might be a rabbit hole I loose a day over.
I am working on Windows 10, I will eventually need to make it so it can build on OSX but I'm just trying to get it to work on windows for now.
I am trying to understand why each of these approaches failed. I would rather go down the path of attempt #2 because I feel like that is better for down the road when I need to make it compile for mac as well. Thank you.
Then in CMakeLists.txt I have tried usingļ¼š
target_link_libraries(my_project
${CMAKE_SOURCE_DIR}/external/libheif/lib/heif)
I think you should use:
target_link_directories( ${PROJECT_NAME}
PRIVATE ./external/libheif/lib/heif
)
target_link_libraries( ${PROJECT_NAME} PRIVATE
heif
xxx
)
target_link_directories : Add link directories to a target.

How to create Header over Header

Table:
id | BL | ML |BL | ML
---------------------------------------------------------
1 | Field01 |Name | Field34 | Field36
2 | Field02 |Age | Field35 | Field37
Required result:
Id | Open | Closed
---------------------------------------------------------
| BL | ML |BL | ML
---------------------------------------------------------
1 | Field01 |Name | Field34 | Field36
2 | Field02 |Age | Field35 | Field37
This is not possible in just SQL Server. You should be handling this type of display within your presentation tool.
It seems weird to do this kind of thing in SQL Server. I don't think you can even do this in SQL Server. If you have access to Python, you can use Python to do this kind of thing, which is called a MultiIndex. This may be going off on a tangent, but you can refer to the link below as to how to create a MultiIndex.
https://jakevdp.github.io/PythonDataScienceHandbook/03.05-hierarchical-indexing.html

Wso2 Scim extentinon datatype error

So i am extending Scim Api for Wso2. When i create an extension using a datatype string all the extensions work correctly. However in my Ldap i have a lot of other custom attributes and attributes that just use other datatype than string like operational or Telephone Number.
I tried to change the datatype value for one of the extended attributes but when requesting that attribute through Scim Api, it just leads me to a 500 error.
This is an example of the scim extension configuration
[{
"attributeURI":"urn:scim:schemas:extension:enterprise:1.0:enterprise.homePhone",
"attributeName":"homePhone",
"dataType":"Telephone Number",
"multiValued":"false",
"multiValuedAttributeChildName":"null",
"description":"The User's phone",
"schemaURI":"urn:scim:schemas:extension:enterprise:1.0",
"readOnly":"false",
"required":"false",
"caseExact":"false",
"subAttributes":"null"
},
{
"attributeURI":"urn:scim:schemas:extension:enterprise:1.0:enterprise.shareDirectory",
"attributeName":"shareDirectory",
"dataType":"string",
"multiValued":"false",
"multiValuedAttributeChildName":"null",
"description":"The User's share dir",
"schemaURI":"urn:scim:schemas:extension:enterprise:1.0",
"readOnly":"false",
"required":"false",
"caseExact":"false",
"subAttributes":"null"
},
{
"attributeURI":"urn:scim:schemas:extension:enterprise:1.0",
"attributeName":"enterprise",
"dataType":"null",
"multiValued":"false",
"multiValuedAttributeChildName":"null",
"description":"SCIM wso2 User Schema Extension",
"schemaURI":"urn:scim:schemas:extension:enterprise:1.0",
"readOnly":"false",
"required":"false",
"caseExact":"false",
"subAttributes":"homePhone shareDirectory"
}]
How can i use these attributes in my Scim Api? Do i need some special configuration?
There a set of data types which are supported by SCIM. So you have to map data types in your userstore for these.
+-----------+-------------+-----------------------------------------+
| SCIM Data | SCIM Schema | JSON Type |
| Type | "type" | |
+-----------+-------------+-----------------------------------------+
| String | "string" | String per Section 7 of [RFC7159] |
| | | |
| Boolean | "boolean" | Value per Section 3 of [RFC7159] |
| | | |
| Decimal | "decimal" | Number per Section 6 of [RFC7159] |
| | | |
| Integer | "integer" | Number per Section 6 of [RFC7159] |
| | | |
| DateTime | "dateTime" | String per Section 7 of [RFC7159] |
| | | |
| Binary | "binary" | Binary value base64 encoded per Section |
| | | 4 of [RFC4648], or with URL and |
| | | filename safe alphabet URL per Section |
| | | 5 of [RFC4648] that is passed as a JSON |
| | | string per Section 7 of [RFC7159] |
| | | |
| Reference | "reference" | String per Section 7 of [RFC7159] |
| | | |
| Complex | "complex" | Object per Section 4 of [RFC7159] |
+-----------+-------------+-----------------------------------------+
Reference: https://www.rfc-editor.org/rfc/rfc7643#section-2.3

Problems with using the bootstrap-datepicker in Fitnesse Tests

In my Fitnesse Tests I want to enter dates through datepicker elements. Sometimes it works. But most of the time a different date, unlike the date that was entered, appears. Here is an example:
| ensure | do | type | on | id=field_id | with | |
| ensure | do | type | on | id=field_id | with | 05.05.1997 |
| check | is | verifyValue | on | id=field_id | [28.05.1997] expected [05.05.1997] |
(To make sure that the field isn't already filled, I pass an empty String first.)
Mostly, the 'day'-statement is different from what was entered. Do you know the reason for this behavior? How can I solve this?
Thanks in advance!
This is related to how you wrote your fixture and not FitNesse, the problem is that it returns a different value and also implies that the previous line didn't work - | ensure | do | type | on | id=field_id | with | 05.05.1997 |

SQL - Combining 3 rows per group in a logging scenario

I have reworked our API's logging system to use Azure Table Storage from using SQL storage for cost and performance reasons. I am now migrating our legacy logs to the new system. I am building a SQL query per table that will map the old fields to the new ones, with the intention of exporting to CSV then importing into Azure.
So far, so good. However, one artifact of the previous system is that it logged 3 times per request - call begin, call response and call end - and the new one logs the call as just one log (again, for cost and performance reasons).
Some fields common are common to all three related logs, e.g. the Session which uniquely identifies the call.
Some fields I only want the first log's value, e.g. Date which may be a few seconds different in the second and third log.
Some fields are shared for the three different purposes, e.g. Parameters gives the Input Model for Call Begin, Output Model for Call Response, and HTTP response (e.g. OK) for Call End.
Some fields are unused for two of the purposes, e.g. ExecutionTime is -1 for Call Begin and Call Response, and a value in ms for Call End.
How can I "roll up" the sets of 3 rows into one row per set? I have tried using DISTINCT and GROUP BY, but the fact that some of the information collides is making it very difficult. I apologize that my SQL isn't really good enough to really explain what I'm asking for - so perhaps an example will make it clearer:
Example of what I have:
SQL:
SELECT * FROM [dbo].[Log]
Results:
+---------+---------------------+-------+------------+---------------+---------------+-----------------+--+
| Session | Date | Level | Context | Message | ExecutionTime | Parameters | |
+---------+---------------------+-------+------------+---------------+---------------+-----------------+--+
| 84248B7 | 2014-07-20 19:16:15 | INFO | GET v1/abc | Call Begin | -1 | {"Input":"xx"} | |
| 84248B7 | 2014-07-20 19:16:15 | INFO | GET v1/abc | Call Response | -1 | {"Output":"yy"} | |
| 84248B7 | 2014-07-20 19:16:15 | INFO | GET v1/abc | Call End | 123 | OK | |
| F76BCBB | 2014-07-20 19:16:17 | ERROR | GET v1/def | Call Begin | -1 | {"Input":"ww"} | |
| F76BCBB | 2014-07-20 19:16:18 | ERROR | GET v1/def | Call Response | -1 | {"Output":"vv"} | |
| F76BCBB | 2014-07-20 19:16:18 | ERROR | GET v1/def | Call End | 456 | BadRequest | |
+---------+---------------------+-------+------------+---------------+---------------+-----------------+--+
Example of what I want:
SQL:
[Need to write this query]
Results:
+---------------------+-------+------------+----------+---------------+----------------+-----------------+--------------+
| Date | Level | Context | Message | ExecutionTime | InputModel | OutputModel | HttpResponse |
+---------------------+-------+------------+----------+---------------+----------------+-----------------+--------------+
| 2014-07-20 19:16:15 | INFO | GET v1/abc | Api Call | 123 | {"Input":"xx"} | {"Output":"yy"} | OK |
| 2014-07-20 19:16:17 | ERROR | GET v1/def | Api Call | 456 | {"Input":"ww"} | {"Output":"vv"} | BadRequest |
+---------------------+-------+------------+----------+---------------+----------------+-----------------+--------------+
select L1.Session, L1.Date, L1.Level, L1.Context, 'Api Call' AS Message,
L3.ExecutionTime,
L1.Parameters as InputModel,
L2.Parameters as OutputModel,
L3.Parameters as HttpResponse
from Log L1
inner join Log L2 ON L1.Session = L2.Session
inner join Log L3 ON L1.Session = L3.Session
where L1.Message = 'Call Begin'
and L2.Message = 'Call Response'
and L3.Message = 'Call End'
This would work in your sample.