Indicate end of a group - apiblueprint

In the groups example https://raw.githubusercontent.com/apiaryio/api-blueprint/master/examples/04.%20Grouping%20Resources.md it says that the end of a groups is indicated by the start of another group. Is there a way to indicate the end of a group without having to start another group? E.g. instead of
# Group Messages
## My Message [/message]
### Update a Message [PUT]
### Delete a Message [DELETE]
# Group Users
...
I'd like to do
# Group Messages
## My Message [/message]
### Update a Message [PUT]
### Delete a Message [DELETE]
# Users
...
Where Users doesn't have to be a group. However, right now it seems in the second e.g., Users would still be under the previous group.

At this point, that is not supported. You have to start a new group as in your example.

Related

amavisd-new rule to call external script

We are using amavisd-new (amavisd-new/oldstable,now 1:2.10.1-4) to filter both incomming and outgoing e-mails.
The thing is we receive a log of spam with fake sender from our domain. Since we have less than 100 accounts in our system, is there a plugin that can take the sender address then check it against a valid list of senders?
Thank you a lot.
our system configuration is:
debian stretch
amavisd-new/oldstable,now 1:2.10.1-4
spamassassin/oldstable,oldstable,now 3.4.2-1
If spamassassin checks outgoing email then perhaps a local rule that checks for allowed senders such as:
header LOCAL_WHITELIST From =~ /(me)|(you)|(etc)#mydomain.org/
meta LOCAL_WHITELIST_MATCH ((LOCAL_WHITELIST) =1)
score LOCAL_WHITELIST_MATCH -1.0
meta LOCAL_WHITELIST_MISS ((LOCAL_WHITELIST) =0)
score LOCAL_WHITELIST_MISS 1.0
Unfortunately, I have no idea how to do this just for outgoing email.
It should be straightforward to write a shell script that automatically generates the white list for you and creates the above as a whitelist.cf for spamassassin. That would be cool. Especially if you could get it to run automatically after the creation or deletion of an email account and then amavisd-new reload && service amavisd-new restart.

how to sent-RdsUserSessionMessage to users who is using the sessionhost?

I want to send message to the users. I found the Send-RdsUserSessionMessage.
I want to send message to all users who is using the special
SessionHostName.
Is it possible to send message to assigned session host of one host pool?
And the samples are as below:
Example 1: Send a message to a user session by providing all required information
PS C:\> Send-RdsUserSessionMessage -TenantName "contoso" -HostPoolName "contosoHostPool" -SessionHostName "sh1.contoso.com" -SessionId 1 -MessageTitle "Test announcement" -MessageBody "Test message."
Example 2: Send a message to a user by searching for their user session
PS C:\> Get-RdsUserSession -TenantName "contoso" -HostPoolName "contosoHostPool" | where { $_.UserPrincipalName -eq "contoso\user1" } | Send-RdsUserSessionMessage -MessageTitle "Test announcement" -MessageBody "Test message." -NoUserPrompt
Regarding #1, based on description section in this document I believe you can lists all user sessions running on the session hosts in the specified host pool using Get-RdsUserSession cmdlet and then pipeline with Send-RdsUserSessionMessage cmdlet to send message to all those user sessions
Regarding #2, based on example 1 in this document and description section in this document I believe it is possible to assign different session host names of one host pool
Hope this information helps!

how to use separate csv file for each thread

My scenario is like,
1. Login by multiple users (100 users)
2. Select 50 items by id's specific to user
I have placed id's for each user in separate csv file say user1.csv, user2.csv, user3.csv and so on.
My result should be like Thread 1 should take user1.csv and process all 50 id's in loop controller.
Thread 2 should take user2.csv and so on.
I tried with below example, but still couldn't find the solution.
Eg. I used file path as C:\abc\user${_threadNum}.csv
Or
C:\abc\user${_threadNum}.csv
Variable name in csv file is user_id
Requeat will look like /home/abc/${user_id}
I want thread 1 to use the user1.csv file and substitiue the value of user_id in the request and thread 2 should use user2.csv and so on.
If I execute my above plan, I am getting error as /home/abc/EOF
How is this possible in JMeter? Or any other approach?
Please provide solution with an example, since I am new to JMeter.
Create your files like comman_name_1,comman_name_2,comman_name_3
etc. & select current thread option from dropdown list present in csv data config set.This will allow threads to use different files per thread or put values in a single file and select current thread option.
It's easy, just add CSV Data Set Config to each thread (user1.csv for thread1 and so forth). Configure CSV Data Set config, and select one of this values in Sharing mode field:
Current thread group - each file is opened once for each thread group
in which the element appears
Current thread - each file is opened separately for each thread
UPD: I have done it right now, it works
Script looks like this:
I selected 'Current thread' in each CSV Data Set Config
I was making the mistake of using single underscore in fetching the count of thread.
We need to use double - underscore like this : ${__threadNum}
Note :

Ruby IMAP "changes" since last check

I'm working on an IMAP client using Ruby and Rails. I can successfully import messages, mailboxes, and more... However, after the initial import, how can I detect any changes that have occurred since my last sync?
Currently I am storing the UIDs and UID validity values in the database, comparing them, and searching appropriately. This works, but it doesn't detect deleted messages or changes to message flags, etc.
Do I have to pull all messages every time to detect these changes? How do other IMAP clients do it so quickly (i.e. Apple Mail and Postbox). My script is already taking 10+ seconds per account with very few email addresses:
# select ourself as the current mailbox
#imap_connection.examine(self.location)
# grab all new messages and update them in the database
# if the uid's are still valid, we will just fetch the newest UIDs
# otherwise, we need to search when we last synced, which is slower :(
if self.uid_validity.nil? || uid_validity == self.uid_validity
# for some IMAP servers, if a mailbox is empty, a uid_fetch will fail, so then
begin
messages = #imap_connection.uid_fetch(uid_range, ['UID', 'RFC822', 'FLAGS'])
rescue
# gmail cries if the folder is empty
uids = #imap_connection.uid_search(['ALL'])
messages = #imap_connection.uid_fetch(uids, ['UID', 'RFC822', 'FLAGS']) unless uids.empty?
end
messages.each do |imap_message|
Message.create_from_imap!(imap_message, self.id)
end unless messages.nil?
else
query = self.last_synced.nil? ? ['All'] : ['SINCE', Net::IMAP.format_datetime(self.last_synced)]
#imap_connection.search(query).each do |message_id|
imap_message = #imap_connection.fetch(message_id, ['RFC822', 'FLAGS', 'UID'])[0]
# don't mark the messages as read
##imap_connection.store(message_id, '-FLAGS', [:Seen])
Message.create_from_imap!(imap_message, self.id)
end
end
# now assume all UIDs are valid
self.uid_validity = uid_validity
# now remember that we just fetched all those messages
self.last_synced = Time.now
self.save!
There is an IMAP extension for Quick Flag Changes Resynchronization (RFC-4551). With this extension it is possible to search for all messages that have been changed since the last synchronization (based on some kind of timestamp). However, as far as I know this extension is not widely supported.
There is an informational RFC that describes how IMAP clients should do synchronization (RFC-4549, section 4.3). The text recommends issuing the following two commands:
tag1 UID FETCH <lastseenuid+1>:* <descriptors>
tag2 UID FETCH 1:<lastseenuid> FLAGS
The first command is used to fetch the required information for all unknown mails (without knowing how many mails there are). The second command is used to synchronize the flags for the already seen mails.
AFAIK this method is widely used. Therefore, many IMAP servers contain optimizations in order to provide this information quickly. Typically, the network bandwidth is the limiting factor.
The IMAP protocol is brain dead this way, unfortunately. IDLE really should be able to return this kind of stuff while connected, for example. The FETCH FLAGS suggestion above is the only way to do it.
One thing to be careful of, however, is that UIDs are only valid for a given session per the spec. You should not store them, even if some servers persist them.

Difference between sharing modes "All threads" and "Current thread group" in Jmeter

What is the actual difference between Sharing mode "All threads" and "Current thread group" in Jmeter?
Can anyone explain in detail?
I have one liner definition but i am not able to understand it properly.
Thanks,
Rishil
Well, as per reference:
• All threads - (the default) the file is shared between all the threads.
• Current thread group - each file is opened once for each thread group in which the element appears
So in case of "All threads" if you have in your script more than 1 CSV Data Set Config elements that refer the same file the next CSV Data Set Config element will CONTINUE READING from previously opened file (i.e. in prevoius CSV Data Set Config element), and in case of "Current thread group" each subsequent CSV Data Set Config element will REOPEN your file.
Please look onto example below:
In this case each CSV Data Set Config element:
• uses the same csv-file;
• reads file once and till the EOF;
• reads file from beginning: file is re-opened each time because of Sharing Mode = Current thread group.
If in this case change Sharing Mode to "All threads" WITHOUT any other changes the 2nd (TG-04) and the 3rd (TG-05) CSV Data Set Config elements will read nothing because the csv-file will remain open after TG-03 and file cursor will point to end of file.
Implementation details find in CSVDataSet class description:
The class uses the FileServer alias mechanism to provide the different
share modes. For all threads, the file alias is set to the file name.
Otherwise, a suffix is appended to the filename to make it unique
within the required context. For current thread group, the thread
group identityHashcode is used; for individual threads, the thread
hashcode is used as the suffix.
UPDATE 2012-02-09:
Presume you have configuration as in comment below:
N threads
1 CSV Data Set Config
1 csv data file
N entries in csv data file
So you will get:
1. N appearances - in case of Sharing mode = "All threads" or "Current thread group": each thread will read 1 entry from csv: the 1st thread - the 1st entry, ..., the Nth thread - the Nth entry.
2. N*N appearances - in case of Sharing mode = "Current thread": each thread will read ALL the entries from csv.
Both the statements are for the case when CSV Data Set Config set with the following settings:
Recycle on EOF? = false
Stop thread on EOF? = false
(screenshot above).

Resources