發表文章

目前顯示的是 12月 29, 2018的文章

Akka actor for http request Java

圖片
0 Hello I am trying to look for a simple example in AKKA - Java to create a HTTP Client un an Actor. So far I am able to create a request and get the response Http Entity. I need to migrate it to an actor , so I can call multiple actors in parallel with a time out. final ActorSystem system = ActorSystem.create(); final Materializer materializer = ActorMaterializer.create(system); final List<HttpRequest> httpRequests = Arrays.asList( HttpRequest.create(url) // Content-Encoding: gzip in respons ); Unmarshaller<ByteString, BitTweet> unmarshal = Jackson.byteStringUnmarshaller(BitTweet.class); JsonEntityStreamingSupport support = EntityStreamingSupport.json(); final Http http = Http.get(system); final Function<HttpResponse, HttpResponse> decodeResponse = response -> // Pick the right coder final Coder coder; if (HttpEncodings.gzip().equals(response.encoding())) coder = Coder.Gzip; else if (HttpEncodings.deflate().equals(response.encoding...

Remove certain characters from write-host output in Powershell (Get-ADuser)

圖片
1 I'm comparing users between two domains to make sure users that are disabled in one, are disabled in the other, using these two steps: Domain 1: Get-ADUser -SearchBase "OU=ou2,OU=ou1,DC=pre,DC=domain1,DC=com" -Filter * -Properties * | Select-Object Name | Export-Csv -encoding "utf8" Users.csv Domain 2: $input = import-csv -path "Users.csv" ForEach ($User in $input) $result = get-aduser -SearchBase "OU=ou2,OU=ou1,DC=pre,DC=domain2,DC=com" -Filter "name -eq '$($User.Name)'" This works, but gives me the following output: Name Enabled ---- ------- Firstname1 Lastname1 True @Name=Firstname2 Lastname2 - Name not found. Please do a manual check How do I remove "@Name=" and ""? I have tried adding -ExtendProperity to $result, and Replace with no luck. I'm probably doing it wrong.. powershell compare share | improve this question asked Nov 12 at 14:20 Erik M. 36 5 ...