Programmatically reading the "Details" tab of an executable - file

I wish to read the values contained within the details tab of a .exe file. At a minimum the 'Title' value under 'Description'. Can anybody advise?
Thanks

If you want to access this information from a batch-file, consider using sigcheck from SysInternals, for example:
> sigcheck.exe accesschk.exe
Verified: Signed
Signing date: 21:15 18-1-2015
Publisher: Microsoft Corporation
Description: Reports effective permissions for securable objects
Product: Sysinternals AccessChk
Prod version: 5.21
File version: 5.21
MachineType: 32-bit
For more tips read this and this answer.

You probably need this: http://en.wikipedia.org/wiki/Portable_Executable.
Assuming that you wanna look at the windows files.
If you wanna look at linux files (which are not .exe) - you probably need this: http://en.wikipedia.org/wiki/Executable_and_Linkable_Format

Related

Unable to install devstack with designate

I am new to the OpenStack environment and started to get into it with a small DevStack setup. I worked the following instructions on a Ubuntu 18.04 machine through and everything worked fine. In order to play with some dns zones I started to research about designate. After adapting the following instructions to my setup I got some errors.
Executing stack.sh produces the following error:
++/opt/stack/designate/devstack/plugin.sh:source:5 set +o xtrace
2021-01-12 21:44:39.009 | Initializing Designate
DROP DATABASE
Could not load 'database': type object 'deprecated' has no attribute 'WALLABY'
Could not load 'pool': type object 'deprecated' has no attribute 'WALLABY'
Could not load 'tlds': type object 'deprecated' has no attribute 'WALLABY'
usage: designate [-h] [--config-dir DIR] [--config-file PATH] [--debug]
[--log-config-append PATH] [--log-date-format DATE_FORMAT]
[--log-dir LOG_DIR] [--log-file PATH] [--nodebug]
[--nouse-journal] [--nouse-json] [--nouse-syslog]
[--nowatch-log-file]
[--syslog-log-facility SYSLOG_LOG_FACILITY] [--use-journal]
[--use-json] [--use-syslog] [--watch-log-file]
{} ...
designate: error: argument category: invalid choice: 'database' (choose from )
Error on exit
World dumping... see /opt/stack/logs/worlddump-2021-01-12-214442.txt for details
nova-compute: no process found
neutron-dhcp-agent: no process found
neutron-l3-agent: no process found
neutron-metadata-agent: no process found
neutron-openvswitch-agent: no process found
I was not sure if my setup was legit. So I tried to use the example config from the designate tutorial. But the same problem occurred.
My actual local.conf:
[[local|localrc]]
USE_PYTHON3=True
ADMIN_PASSWORD=***
DATABASE_PASSWORD=$ADMIN_PASSWORD
RABBIT_PASSWORD=$ADMIN_PASSWORD
SERVICE_PASSWORD=$ADMIN_PASSWORD
SERVICE_TOKEN=$ADMIN_PASSWORD
DEST=/opt/stack
SERVICE_HOST=192.168.1.***
HOST_IP=$SERVICE_HOST
disable_service mysql
enable_service postgresql
enable_plugin designate https://opendev.org/openstack/designate
enable_service tempest
Checking the plugin.sh. It looks like the error occurred from this function:
function init_designate {
# (Re)create designate database
recreate_database designate utf8
# Init and migrate designate database
$DESIGNATE_BIN_DIR/designate-manage database sync
init_designate_backend
}
Hope somebody can give me a hint to run DevStack with designate.
Thanks in advance.
The issue you are having is a version mismatch with the cloud install and the designate plugin. Designate is expecting a newer verison of the oslo_log package.
Check that the "devstack" version you have checked out is on the master branch.
The line:
enable_plugin designate https://opendev.org/openstack/designate
Is pulling the master branch of designate for the devstack plugin.
If you are trying to install on a stable branch version OpenStack, you will need to specify a reference for the devstack plugin as well (example, stable/victoria):
enable_plugin designate https://opendev.org/openstack/designate stable/victoria
As mentioned above, you will also need to enable the designate services:
enable_service designate,designate-central,designate-api,designate-worker,designate-producer,designate-mdns

PowerCLI vSphere set-annotation

I am able to set notes in annotation with below PowerCLI vSphere.
Input: serverdetails.txt
name,notes
Server 1, This is an application server : .Net
Command:
Import-Csv "C:\temp\serverdetails.txt" | %{ Set-Vm -Name $.Name -Description $.Name -Confirm:$false }
Current Output in annotation i get is as below, complete content in one line.
This is an application server : .Net
However, i need below output in annotation (in two lines):
Line 1: This is an application server
Line 2: .Net
That's not really how the notes field operates, it's more designed around displaying information in the multi-VM view where multi-line output wouldn't work.
If you're looking for something that can display multiple lines, in an prescriptive manner, look at using Tags or even Annotations/Custom Attributes.

Display project version in ASP.NET Core 1.0.0 web application

None of what used to work in RC.x helps anymore.
I have tried these:
PlatformServices.Default.Application.ApplicationVersion;
typeof(Controller).GetTypeInfo().Assembly.GetCustomAttribute<AssemblyFileVersionAttribute>().Version;
Assembly.GetEntryAssembly().GetName().Version.ToString();
They all return 1.0.0.0 instead of 1.0.0-9 which should be after execution of the dotnet publish --version-suffix 9 having this in project.json: "version": "1.0.0-*"
Basically they give me "File version" from the attached picture instead of "Product version" which dotnet publish actually seems to change.
For version 1.x:
Assembly.GetEntryAssembly().GetCustomAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion;
For version 2.0.0 this attribute contains something ugly:
2.0.0 built by: dlab-DDVSOWINAGE041 so use this one:
typeof(RuntimeEnvironment).GetTypeInfo().Assembly.GetCustomAttribute<AssemblyFileVersionAttribute>().Version;
I would do it like this on ASP.NET Core 2.0+
var assemblyVersion = typeof(Startup).Assembly.GetName().Version.ToString();
In .Net Core 3.1 I show the version directly in my View using:
#GetType().Assembly.GetName().Version.ToString()
This shows the Assembly Version you have in your csproj file:
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<FileVersion>2.2.2.2</FileVersion>
<Version>4.0.0-NetCoreRC</Version>
</PropertyGroup>
If you want to display the "other" FileVersion or "Informational" Version properties in the View add using System.Reflection:
using System.Reflection;
.... bunch of html and stuff
<footer class="main-footer">
<div class="float-right hidden-xs">
<b>Assembly Version</b> #(Assembly.GetEntryAssembly().GetName().Version)
<b>File Version</b> #(Assembly.GetEntryAssembly().GetCustomAttribute<AssemblyFileVersionAttribute>().Version)
<b>Info Version</b> #(Assembly.GetEntryAssembly().GetCustomAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion)
</div>
</footer>
Note that after adding the System.Reflection the original #GetType().Assembly.GetName().Version.ToString() line returns 0.0.0.0 and you need to use the #Assembly.GetEntryAssembly().GetName().Version
There's a blog post here
Edit: Make sure to follow proper naming conventions for the Version strings. In general, they need to lead with a number. If you don't, your app will build but when you try to use NuGet to add or restore packages you'll get an error like 'anythingGoesVersion' is not a valid version string. Or a more cryptic error: Missing required property 'Name'. Input files: C:\Users....csproj.'
more here:
This work for me too:
#Microsoft.Extensions.PlatformAbstractions.PlatformServices.Default.Application.ApplicationVersion
It works with csproj file - either <Version>1.2.3.4, or <VersionPrefix>1.2.3</VersionPrefix>. However the <VersionSuffix> isn't recoganized as this doc says.
The answer by Michael G should have been the accepted one since it works as expected. Just citing the answer by Michael G above.
var version = GetType().Assembly.GetName().Version.ToString();
works fine. It gets the Package version set in the Package tab of project properties.
As an addition, if we need to get the Description we set in the same tab, this code would work. (core 3.1)
string desc = GetType().Assembly.GetCustomAttribute<AssemblyDescriptionAttribute>().Description;
Just in case someone needs this.
Happy coding !!!

Google App Engine and ttf font not working

I've got a small problem where google app engine is complaining about my ttf file. This is what it says:
Could not guess mimetype for css/fonts/Pacifico.ttf. Using application/octet-stream.
Now I've followed this link and changed my yaml file appropriately (or so I think):
- url: /css/fonts/(.*\.ttf)
static_files: css/fonts/\1
upload: css/fonts/(.*\.ttf)
mime_type: application/x-font-ttf
But when I do this i get the following:
appcfg.py: error: Error parsing C:\Users\Roberto\Desktop\bootstrap\app.yaml: mapping values are not allowed here
in "C:\Users\Roberto\Desktop\bootstrap\app.yaml", line 25, column 17.
2014-01-16 23:22:16 (Process exited with code 2)
Any help in this matter?
I have done a test with glyphicons-halflings-regular.ttf from the Bootstrap project with the same app.yaml handler that you use (save for the indentation change as per the comments) and can verify that it works as expected:
This leads me to believe that you may using an older version of the GAE SDK (I use 1.8.8) or something else is wrong with your installation.
You can try this: appcfg.py uses python's mimetypes module to guess the type from the file extension so in any case, you should be able to solve the issue by adding the application/x-font-ttf mime type to your OS.
You're on Windows so you need to edit your registry and add a application/x-font-ttf key to HKEY_CLASSES_ROOT\MIME\Database\Content Type and add a string value called Extension with the value .ttf under the new key.
Extended procedure for adding the mimetype to Windows
Open the registry editor: Hit Winkey + R and type regedit, hit Enter
Navigate through the registry to the desired location: open HKEY_CLASSES_ROOT, inside it open MIME, inside that open Database and inside that open Content Type. It's like a folder structure.
Right click on Content Type and select New > Key, give it the name application/x-font-ttf.
Right click on the key you just created and select New > String Value. give it the name Extension.
Double click on the value you just created and assign it the Value data .ttf, hit OK.
Exit regedit and you're done!
Final none: I don't think it can be anything to do with the file itself, because the mimetypes module uses only the file extension to work out the MIME type. Unless there is some crazy unprintable character in the filename. You could try using the glyphicons-halflings-regular font I linked to to eliminate this possibility.

FreeRadius dictionary loading

I'm trying to load a dictionary that comes in with Debian Squeeze. Unfortunately radius-client library fails on some included file with:
rc_read_dictionary: unknown Vendor-Id encrypt=1 on line 7 of dictionary /usr/share/freeradius/dictionary.compat
The line is
ATTRIBUTE Password 2 string encrypt=1
Freeradius is installed from the package, so I assume this should work just fine... What could be the problem here?
Late answer, but it still might help others, I got bit by a related issue.
You're getting that error because you're trying to use a dictionary file designed for the FreeRADIUS server. The client library "freeradius-client" is not 100% compatible with that format. Specifically, in your case, it cannot handle the encrypt=1 property of the attribute.
The reason for the complaint about an unknown Vendor-Id is another incompatibility between FreeRADIUS server and the freeradius-client library. FreeRADIUS server expects dictionary files with vendor specific attributes (VSAs) like the following:
VENDOR Cisco 9
BEGIN-VENDOR Cisco
ATTRIBUTE Cisco-AVPair 1 string
ATTRIBUTE Cisco-NAS-Port 2 string
...
END-VENDOR Cisco
The freeradius-client library however can only parse VSAs in the following form:
VENDOR Cisco 9
ATTRIBUTE Cisco-AVPair 1 string vendor=Cisco
ATTRIBUTE Cisco-NAS-Port 2 string vendor=Cisco
The above is true for FreeRADIUS server v2.1.x and freeradius-client v1.1.6.

Resources