I'm looking how to get programmatically the KB of latest security update, currently in use on local computer . Any tips ? I've tried some thins like wuapi but i'm not getting any results . I wanna check if the MS17-010: Security update for Windows SMB is in use .
To check a specific update programmatically, you can for example query the registry. Under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages a key with the name that contains the KB identifier should be present (eg. "Package_for_KB111111_..."), and under that the CurrentState value is decimal 112 if it is fully installed.
MS17-010 is KB4012598.
Some more info with other possible statuses and more is here.
Related
Trying to use django-cachalot with django-tenants. I get the following error right at the start. Anyone got a resolution?
(cachalot.W003) Database engine 'django_tenants.postgresql_backend' is not supported by django-cachalot.
HINT: Switch to a supported database engine.
Found a solution — you have to patch django-cachalot to generate a unique cache key for each tenant. See this open Pull Request - https://github.com/noripyt/django-cachalot/pull/123
I'm trying to start an ec2 instance via the java sdk.I always want to get the 'latest' Windows Server 2019 ami. At the moment we hard code the image id. I can make a describe image request like below:
DescribeImagesRequest request = new DescribeImagesRequest().withFilters(new LinkedList<Filter>())
request.getFilters().add(new Filter().withName("name").withValues("Windows_Server-2019-English-Full-Base-2020.05.13"))
DescribeImagesResult describeImagesResult= getAmazonEc2Client().describeImages(request)
List<Image> images = describeImagesResult.getImages()
return images[0].getImageId()
Of course this returns one image id, because of the unique name. I effectively want to search for 'Windows_Server-2019-English-Full-Base' and then find the one that's latest. Searching in the UI returns 8 community images; 4 start with 'Windows_Server-2019-English-Full-Base' and provided by Amazon. How do I get all 8 back? (I can then wittle down to ones that start with 'Windows_Server-2019-English-Full-Base' and then sort by name to get latest one)
I tried searching for 'Windows_Server-2019-English-Full-Base' and 'Windows_Server-2019-English-Full-Base%' but both return 0 results via the api...
(Filter details are at https://docs.aws.amazon.com/sdk-for-ruby/v2/api/Aws/EC2/Types/DescribeImagesRequest.html)
To find the latest Windows Server AMI, you are better off using Parameter Store:
https://aws.amazon.com/blogs/mt/query-for-the-latest-windows-ami-using-systems-manager-parameter-store/
Note you can also get the latest Amazon Linux AMI via similar methods:
https://aws.amazon.com/blogs/compute/query-for-the-latest-amazon-linux-ami-ids-using-aws-systems-manager-parameter-store/
I'm accessing EC2 with the aws-sdk for Ruby. I have an array of instances from describe_instances().
This provides me with the state of the instances and even a state transition reason. But how can I get a time for the state transition?
Edit
So I have:
client=Aws::EC2::Client()
resp =client.describe_instances({ filters })
and I would need
resp.reservations[0].instances[0].state_transition_time #=> Time
similar to
resp.reservations[0].instances[0].state_transition_reason #=> String
This information is not available via the Amazon EC2 API at this time. The aws-sdk gem returns all of the information available from the DescribeInstances operation as documented here: http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeInstances.html
The State Transition Reason is not always populated with a date and time and may not even be populated at all per the documentation. I have not found any hints in the documentation that specify the conditions in which you DO get a date/time, but in my experience, the date/time are present in the State Transition Reason for between 30 and 90 days. After that, the reason seems to persist, but the date is dropped from the string.
All of the documentation that I can find is listed here:
Attribute Definition
EC2 API - Ruby
I am trying to collect statistics in wso2AM using wso2BAM. When the API request completes no errors are reporting and the pass through works.
However when I try to access the statistics I get the error Table "API_REQUEST_SUMMARY" not found; SQL Statement:
SELECT time, year,month,day FROM API_REQUEST_SUMMARY order by time ASC limit 1 [42102-140]
No errors in the BAM logs. The Hadoop job is running every few seconds with no errors
Suggestions on what to look at?
OS is Linux
AM is 1.4.0
BAM is 2.3.0
I followed the instructions here for combining the two:
http://docs.wso2.org/wiki/display/AM140/Monitoring+Using+WSO2+BAM
Thanks,
Chris
The exact same exception can be happen, if user forgot to Copy the file /statistics/API_Manager_Analytics.tbox to directory, /repository/deployment/server/bam-toolbox.
So in that case only APIMGTSTATS_DB.db will be created without any tables.
Thanks
Ajith.
How can I programmatically dump/query Launch Services database in MacOS (i.e. analog of command lsregister -dump)?
EDIT: I want to get set of associations UTI -> Bundle_IDs. Using LSCopyAllRoleHandlersForContentType - does not always work, here a similar trouble, therefore concluded that the best working method - parsing the output of "lsregister -dump", but the location of lsregister changes from version to version.