I have a project that I'm doing for my OS class and there's a part of it that has me a bit stumped:
Have at least 3 different ordinary users on your system, and at least three different protection groups, with each protection group consisting of two of the users and no two groups the same (e.g., users A, B, and C, with protection groups X={A,B}, Y={B,C}, and Z={C,A}).
Here's what I tried (groups X, Y, and Z have already been created):
# user add -m -g X A
# user add -m -g X B
# user add -m -g Y B
The last command gives me the following:
user: Can't add user 'B': 'B' is already a user
EDIT: I was able to figure it out on my own. For those interested, I used the "usermod -G" command.
I was able to figure it out on my own. For those interested, I used the usermod -G command.
Related
Is there a way to use independently the outputs of a checkbox list in the Active Choices plugin on Jenkins ? (as in my example, I need to access to the selected check boxes one at a time
Here are a few screens to explain my problem :
Active Choices configuration in the job
The script
Checkboxes selected
Output
I would like to be able to access first to only the Debian_6, then only the Debian 6 32bits :)
Thanks !
As the result is comma-separated, maybe you could split the output:
# This is a way to split in bash
osArr=(${OS//,/ })
# And then access a result as
os1=${osArr[0]}
Or maybe iterate them in a for block
for os in ${OS//,/ } ; do
echo "${os}"
done
You can store the comma separated values into an array and iterate them
#!/bin/bash
OS_selected=($(echo $OS | tr "," "\n"))
for values in ${OS_selected[#]}
do
echo $values
done
I have a LOAD_CSV cypher script that creates and sets properties for nodes and edges.
I want to add a parameter at run time (i.e. when I do cat mycypher.cql | cypher-shell -u xxxx -p xxx) so that a key property gets set on nodes -- like so:
LOAD CSV WITH HEADERS FROM $MY_CSV AS row
MERGE (a:abcLabel {abcId: toInteger(row.abc_id), extraProp: $EXTRA_PROPERTY})
ON CREATE SET
abc.name = row.abc_name
MERGE (b:bcdLabel {bcdId: toInteger(row.bcd_id), extraProp: $EXTRA_PROPERTY})
ON CREATE SET
etc ....
Now, know that I can't use shell-like params, but is there a way to set $EXTRA_PROPERTY and $MY_FILE so that I can rerun the cql against a separate data set and ensure that a subsequent MATCH (:abcProperty {extraLabel: "xyz"}) will return nodes that were given the "xyz" property?
In principle this would be completely automated and templated so I will never do a manual load.
TIA
Upcoming version 1.2 of cypher-shell will support the command line option --param, which would allow you to specify Cypher parameters.
Here is the merged pull request.
I am building a NetLogo model that tries to explain how agents find information they need to make a decision by bumping into other agents as they move about a space. There are three types of agents, each type has their own behavior rules and interact with their environment in different ways. The three types of agents, however, are all part of the same organization [Organization A].
The code below shows the breed names and the kinds of variables I'm using.
breed [Implementers Implementer];; Member of Organization A
breed [IMDeployeds IMDeployed];; Member of Organization A
breed [IMremotes IMremote];; Member of Organization A
... [other breeds]
Turtles-own [exchangeinfo holdinfo inforelevant infoarray
taskcomplexity done];; is an info exchange going to happen, does the
turtle have info, is info relevant, and then an array
extensions [array]
globals [complete routinemeeting]
I want to do three things:
1&2 Create a mechanism that joins the IMRemotes to the IMDeployeds and the IMDeployeds to the Implementers.
(I've already tried creating links - I'm not sure that the mechanism does what I want the third thing to do:)
3: Periodically check in with the agents that are linked together to cross-check variable values so that "information" can be "exchanged". Code I have for when agents are in the same space and can use "turtles-here" is below:
ask Implementers [
ifelse any? other Implementers [have-info-same-team] [change-location]
ifelse any? IMDeployeds-here [have-info-same-team] [change-location]
end
to have-info-same-team
ifelse any? turtles-here with [holdinfo > 0] [checkarray9] [change-
location]
end
to checkarray9
ifelse any? other turtles-here with [array:item infoarray 9 > 0]
[array:set infoarray 9 1 set holdinfo 1 checkarray8][checkarray8]
end
[etc, checking each position from 9 down to 0 in the array until you've gotten all the new information from that agent that you need]
When I try to ask my-links to do any of these things [so that the agents in the same organization, but different "functions, if you will, can have purposeful meetings rather than relying on being in the same space with each other to communicate], I'm told that the procedure is a "turtle only" procedure or that infoarray is a turtle-only variable.
Any help or suggestions greatly appreciated!
Rather than asking the links to do these things, you want to ask the turtles at the other end of the links. I don't know if you have created directed or undirected links, but something like
ask turtle-set [other-end] of my-out-links [do something]
or
ask my-out-links [ask other-end [do something]]
will make the ask of the turtles at the other end of the links to this turtle. (Note that [other-end] of my-out-links yields a list of turtles rather than a turtleset, thus the use of turtle-set to turn the list into a turtleset. my-out-links seems to work with both directed and undirected links. See http://ccl.northwestern.edu/netlogo/docs/dictionary.html#my-out-links.)
Hope this helps,
Charles
I'm going to preface this that I am a total database pleb. I have 0 experience with any form of databases so I know that I'm in way over my head.
Background: I do Active Directory consulting for my company so I routinely look at client's group membership of their active directory accounts. Currently, I have a PowerShell script that will run my analytics, however, I'm finding that it takes way too long in larger organizations. I'm thinking "There has to be a better way" so I have jumped into looking at databases. NEO4J seems to be a good possible solution as I should be able to to link a user account or group as a member of another group. However, after browsing documentation and forums, I have no idea how to create those links.
I have two CSVs that I have successfully imported with the following information:
Users = DistinguishedName, SAMACCOUNTNAME, MemberOf
Groups = DistinguishedName, SAMACCOUNTNAME, MemberOf, Members
What I want to do is match a string from all users and groups (DistinguishedName) to a string in the group node's property of members. Members is a concatenated string of all DistinguishedName's (whether user or group). So if a node with a DistinguishedName matches part of a string in a group's "members" property, I want to build a one way relationship like so:
user -[memberof] - > group
The best I could rack my brain on this is the following code but I have no idea if I'm even close:
Match(n)
Match(u:user) WHERE n.Members CONTAINS u.DN
Create (u)-[MS:Memberof]->((match)})
In PowerShell, I know how I would accomplish this (loosely translated to relate to the NEO4J world):
$groups = (all-groups)
$AllUsersAndGroups = (all-objs)
foreach ($line in $groups) {
$line.relationship = $line | where {$_.members -contains $AllUsersAndGrups.DistinguishedName}
}
So at last, I'm stuck right now. I will continue to look into it but I figure I would ask the community as you guys have the experience and stuff.
Here is an example of how you should have imported your data (notice that the redundant Members column is not actually needed):
Import (in batches of 5000, to avoid resource issues) each user, and create a unique relationship to its group:
USING PERIODIC COMMIT 5000
LOAD CSV WITH HEADERS FROM "file:///users.csv" AS u
MERGE (u:User {DistinguishedName: u.DistinguishedName, SAMACCOUNTNAME: u.SAMACCOUNTNAME})
MERGE (g:Group {DistinguishedName: u.MemberOf})
MERGE (u)-[:Memberof]->(g);
Import each group, and create a unique relationship to its parent group, if any:
USING PERIODIC COMMIT 5000
LOAD CSV WITH HEADERS FROM "file:///groups.csv" AS g1
MERGE (:Group {DistinguishedName: g1.DistinguishedName, SAMACCOUNTNAME: g1.SAMACCOUNTNAME})
MERGE (g2:Group {DistinguishedName: g1.MemberOf})
MERGE (g1)-[:Memberof]->(g2);
I have an application where the user selects a set of options, but the options available at each step depend on the previous options selected. The pathways of selections can be modeled as a tree, however, the options available after selecting option A would be different than options available after selecting option B. It might look something like this:
Option 1
/ | \
/ | \
/ | \
A,B,C D,E F,G,H
/ | \ / \ / |
I J,K L M N,O P Q
I apologize for the crudity of this model; I didn't have time to build it to scale.
Basically, A user will be presented with an initial set of options. Each of these options can have a set of suboptions, which would be unique compared to if they selected one of the other sibling options. At the end of their selection, they will have a Product object.
I'm looking for advice on how to model this kind of hierarchy in CoreData. I'm thinking that the leaf nodes should be a Product object, and that the intermediate options should just be regular NSManagedObjects, with a list of suboptions that can be selected.
Sounds like you might want an entity to represent a decision, with to-many relationships with itself and with a product entity. Something like:
entity: Decision
relationship: decisions ->> Decision
relationship: product ->> Product
entity: Product
attribute: name
attribute: price
attribute: color
...
That way, one decision can lead to one or more other decisions just as your "Option 1" node leads to three more decisions. Or, it can lead to one or more products, or to some combination of both.