Grouping Tasks in Conemu - conemu

I am sure in the past I have seen a setup of tasks in ConEmu, which allowed me to group tasks together under sub-menus, such as Cmd, Powershell etc.
I can't remember how to set this up and my google-fu has deserted me.

Use double colon to name task groups. For example
Shell::cmd
Shell::PowerShell
Scripts::Jekyll build

Related

ANSIBLE - reading hosts and doing something with them

I am new to ansible, to be honest cannot work anything out so trying something this tricky is proving fruitless. Hopefully someone is able to assist?
I will try and explain the totally of what I am trying to achieve to have the full picture.
I have a .net application where the config differs for each environment that it is deployed - which is typical. What I need to do is edit the config file post deployment of an msi. I think I have an understanding of how to run something after the msi.
the config file will be a mix of hosts, and values for each host, but the value will depend on the host type
[hosttype1]
server1
server2
[hosttype2]
server1
server3
server5
[hosttype3]
....
In a different file I will have something like
[hosttype1]
values1
values2
[hosttype2]
values3
values4
The code will need to read the hosttype from each file and then merge the two values into a variable that I can then use to inject into the config file
the hosttypes is dynamic per environment
The output will be something like
"server1" value=values1
"server1" value=values2
"server2" value=values1
"server2" value=values2
"server1" value=values3
"server1" value=values4
"server3" value=values3
"server3" value=values4
"server5" value=values3
"server5" value=values4
Hope that makes sense
As it stands I have absolutely no idea how to loop over the first list, let alone loop over both and join the results together to generate something that can be used.
What I am trying to do is find a way to loop over both these files and effectively merge based of there types. The result of this would be used in the application config.
This may be completely the wrong approach so if there are other approaches then I'd happily to and work through these approaches, just need some thoughts, ideas, suggestions really as to how I should proceed.

In SSMS, what is the number that appears in brackets after the username?

Just out of curiosity, but I notice it changes seemingly at random, and I cannot find any documentation online for it at all. I have tried Googling it, and I fear I am poorly wording my search terms to find it.
I'm trying to workout what the numbers in brackets are after the username that is executing a query in SSMS are or for?
In the tab name or the window title, it'll appear like this:
SQLQuery19.sql - server_name.db_name (NETWORK\user (525))
The number seemingly changes when I open a new query at different times, and it doesn't seem to increase or decrease with any sort of pattern. Any links to documentation or brief explanation would be great.
That's the session_id - you can confirm by running SELECT ##SPID; in that window.
See https://learn.microsoft.com/en-us/sql/t-sql/functions/spid-transact-sql

How to loop a kaplan-meier command in spss syntax?

I'm working in SPSS with this kaplan-meier command:
KM data BY sample
/STATUS=status(0)
/PRINT TABLE MEAN
/PLOT SURVIVAL HAZARD
/TEST LOGRANK BRESLOW TARONE
/COMPARE OVERALL POOLED.
This is no problem but there's a lot of data i have to process and I'm trying to get this in a syntax file together. Can i do a loop of several kaplan-meier commands with data going through a set of variables such as {time0 time1 time2} and sample going through a set such as {sample0 sample1 sample2}.
I tried with DO REPEAT - END REPEAT. But I couldnt get it to work.
DO REPEAT applies to transformation commands. Procedures cannot be placed inside loops. However, if you install the Python Essentials from the SPSS Community site (www.ibm.com/developerworks/spssdevcentral), this is easy to do. If you can provide more details on what you want to loop over, we can explain how to do this.

SSIS suitability

I'm tring to create an SSIS package to import some dataset files, however given that I seem to be hitting a brick
wall everytime I achieve a small part of the task I need to take a step back and perform a sanity check on what I'm
trying to achieve, and if you good people can advise whether SSIS is the way to go about this then I would
appreciate it.
These are my questions from this morning :-
debugging SSIS packages - debug.writeline
Changing an SSIS dts variables
What I'm trying to do is have a For..Each container enumerate over the files in a share on the SQL Server. For each
file it finds a script task runs to check various attributes of the filename, such as looking for a three letter
code, a date in CCYYMM, the name of the data contained therein, and optionally some comments. For example:-
ABC_201007_SalesData_[optional comment goes here].csv
I'm looking to parse the name using a regular expression and put the values of 'ABC', '201007', and
'SalesData' in variables.
I then want to move the file to an error folder if it doesn't meet certain criteria :-
Three character code
Six character date
Dataset name (e.g. SalesData, in this example)
CSV extension
I then want to lookup the Character code, the date (or part thereof), and the Dataset name against a lookup table
to mark off a 'checklist' of received files from each client.
Then, based on the entry in the checklist, I want to kick off another SSIS package.
So, for example I may have a table called 'Checklist' with these columns :-
Client code Dataset SSIS_Package
ABC SalesData NorthSalesData.dtsx
DEF SalesData SouthSalesData.dtsx
If anyone has a better way of achieving this I am interested in hearing about it.
Thanks in advance
That's an interesting scenario, and should be relatively easy to handle.
First, your choice of the Foreach Loop is a good one. You'll be using the Foreach File Enumerator. You can restrict the files you iterate over to be just CSVs so that you don't have to "filter" for those later.
The Foreach File Enumerator puts the filename (full path or just file name) into a variable - let's call that "FileName". There's (at least) two ways you can parse that - expressions or a Script Task. Depends which one you're more comfortable with. Either way, you'll need to create three variables to hold the "parts" of the filename - I'll call them "FileCode", "FileDate", and "FileDataset".
To do this with expressions, you need to set the EvaluateAsExpression property on FileCode, FileDate, and FileDataset to true. Then in the expressions, you need to use FINDSTRING and SUBSTRING to carve up FileName as you see fit. Expressions don't have Regex capability.
To do this in a Script Task, pass the FileName variable in as a ReadOnly variable, and the other three as ReadWrite. You can use the Regex capabilities of .Net, or just manually use IndexOf and Substring to get what you need.
Unfortunately, you have just missed the SQLLunch livemeeting on the ForEach loop: http://www.bidn.com/blogs/BradSchacht/ssis/812/sql-lunch-tomorrow
They are recording the session, however.

Windows API way to search subfolders with wildcards and other criteria in C++?

I think I saw once that it was possible to use the functionality of windows' search feature(s) in code. That it was possible to search for files using a sql query (something like "select filename from filestore where directory = 'c:\somedir' and extention in ('.doc','.txt','.me') and datemodified >= '2009-01-01 00:00:00'"
Anyway, even if there isn't a way to do it with a query, is there any functionality in the Windows API OR any simple code for doing exactly this type of thing?
It seems such an obvious thing for there not to be an easy way to do it.
I have a function that finds all files in a dir (with subdirs) but it's basically dumb. It can't search with wildcards and it can't search with other criteria such as date newer than a given date.
If possible I don't want to download any 3rd party shareware libraries to do this. I'm using C++ builder in vista, and if there are any vista-only functionality for this then that's ok.
Actually, you can use FindFirstFileEx() to implement your search criteria. Unfortunately, most of the time you have to implement this yourself.. It isn't too hard..
Basically you can check the WIN32_FIND_DATA structure for criteria that you want to search for. For example, if you wanted to find only files with a creation date greater than a certain date, you would check if the WIN32_FIND_DATA structure member ftCreationTime or ftLastWriteTime, depending on your needs..
You can use FindFirstFileEx() to search with wildcards and attributes.
The C code has been posted thousands of times on Google Groups since 90's
( news://comp.os.ms-windows.programmer.win32 and others )

Resources