{"action":"created","comment":{"url":"https://api.github.com/repos/Nanocloud/nanocloud/pulls/comments/87166576","pull_request_review_id":7788341,"id":87166576,"diff_hunk":"@@ -0,0 +1,26 @@\n+# Set allowed ASCII character codes to Uppercase letters (65..90),\n+$charcodes = 65..90\n+\n+# Convert allowed character codes to characters\n+$allowedChars = $charcodes | ForEach-Object { [char][byte]$_ }\n+\n+$LengthOfName = 10\n+# Generate computer name\n+$pw = ($allowedChars | Get-Random -Count $LengthOfName) -join \"\"\n+$prefix = \"CDW12\"\n+$name = $prefix+$pw\n+\n+$ComputerName = $name\n+\n+Remove-ItemProperty -path \"HKLM:\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\" -name \"Hostname\"\n+Remove-ItemProperty -path \"HKLM:\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\" -name \"NV Hostname\"\n+\n+New-PSDrive -name HKU -PSProvider \"Registry\" -Root \"HKEY_USERS\"\n+\n+Set-ItemProperty -path \"HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Computername\\Computername\" -name \"Computername\" -value $ComputerName\n+Set-ItemProperty -path \"HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Computername\\ActiveComputername\" -name \"Computername\" -value $ComputerName\n+Set-ItemProperty -path \"HKLM:\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\" -name \"Hostname\" -value $ComputerName\n+Set-ItemProperty -path \"HKLM:\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\" -name \"NV Hostname\" -value $ComputerName\n+Set-ItemProperty -path \"HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\" -name \"AltDefaultDomainName\" -value $ComputerName\n+Set-ItemProperty -path \"HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\" -name \"DefaultDomainName\" -value $ComputerName\n+#Set-ItemProperty -path \"HKU:.Default\\Software\\Microsoft\\Windows Media\\WMSDK\\General\" -name \"Computername\" -value $ComputerName","path":"image/changeComputerName.ps1","position":26,"original_position":26,"commit_id":"13f50a6cf39703773a39cea35bd4af2537e8e445","original_commit_id":"13f50a6cf39703773a39cea35bd4af2537e8e445","user":{"login":"dynamiccast","id":10377736,"avatar_url":"https://avatars.githubusercontent.com/u/10377736?v=3","gravatar_id":"","url":"https://api.github.com/users/dynamiccast","html_url":"https://github.com/dynamiccast","followers_url":"https://api.github.com/users/dynamiccast/followers","following_url":"https://api.github.com/users/dynamiccast/following{/other_user}","gists_url":"https://api.github.com/users/dynamiccast/gists{/gist_id}","starred_url":"https://api.github.com/users/dynamiccast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dynamiccast/subscriptions","organizations_url":"https://api.github.com/users/dynamiccast/orgs","repos_url":"https://api.github.com/users/dynamiccast/repos","events_url":"https://api.github.com/users/dynamiccast/events{/privacy}","received_events_url":"https://api.github.com/users/dynamiccast/received_events","type":"User","site_admin":false},"body":"Why is this line commented ?\r\nCan you provide the origin of the script ?","created_at":"2016-11-09T10:29:15Z","updated_at":"2016-11-09T10:29:15Z","html_url":"https://github.com/Nanocloud/nanocloud/pull/473#discussion_r87166576","pull_request_url":"https://api.github.com/repos/Nanocloud/nanocloud/pulls/473","_links":{"self":{"href":"https://api.github.com/repos/Nanocloud/nanocloud/pulls/comments/87166576"},"html":{"href":"https://github.com/Nanocloud/nanocloud/pull/473#discussion_r87166576"},"pull_request":{"href":"https://api.github.com/repos/Nanocloud/nanocloud/pulls/473"}}},"pull_request":{"url":"https://api.github.com/repos/Nanocloud/nanocloud/pulls/473","id":92813659,"html_url":"https://github.com/Nanocloud/nanocloud/pull/473","diff_url":"https://github.com/Nanocloud/nanocloud/pull/473.diff","patch_url":"https://github.com/Nanocloud/nanocloud/pull/473.patch","issue_url":"https://api.github.com/repos/Nanocloud/nanocloud/issues/473","number":473,"state":"open","locked":false,"title":"Change Windows hostname on each machine","user":{"login":"Leblantoine","id":10654878,"avatar_url":"https://avatars.githubusercontent.com/u/10654878?v=3","gravatar_id":"","url":"https://api.github.com/users/Leblantoine","html_url":"https://github.com/Leblantoine","followers_url":"https://api.github.com/users/Leblantoine/followers","following_url":"https://api.github.com/users/Leblantoine/following{/other_user}","gists_url":"https://api.github.com/users/Leblantoine/gists{/gist_id}","starred_url":"https://api.github.com/users/Leblantoine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Leblantoine/subscriptions","organizations_url":"https://api.github.com/users/Leblantoine/orgs","repos_url":"https://api.github.com/users/Leblantoine/repos","events_url":"https://api.github.com/users/Leblantoine/events{/privacy}","received_events_url":"https://api.github.com/users/Leblantoine/received_events","type":"User","site_admin":false},"body":"Fixes #467 #451 \r\n\r\nTo have a unique hostname on each machine we have to add a script in the AMI and create a registry key before create an image. This registry key has the effect to run the script on start. ","created_at":"2016-11-08T16:38:23Z","updated_at":"2016-11-09T10:29:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ddb3857251ffeb172655c5c433be5a0448aea82f","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Nanocloud/nanocloud/pulls/473/commits","review_comments_url":"https://api.github.com/repos/Nanocloud/nanocloud/pulls/473/comments","review_comment_url":"https://api.github.com/repos/Nanocloud/nanocloud/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Nanocloud/nanocloud/issues/473/comments","statuses_url":"https://api.github.com/repos/Nanocloud/nanocloud/statuses/13f50a6cf39703773a39cea35bd4af2537e8e445","head":{"label":"Leblantoine:hostname","ref":"hostname","sha":"13f50a6cf39703773a39cea35bd4af2537e8e445","user":{"login":"Leblantoine","id":10654878,"avatar_url":"https://avatars.githubusercontent.com/u/10654878?v=3","gravatar_id":"","url":"https://api.github.com/users/Leblantoine","html_url":"https://github.com/Leblantoine","followers_url":"https://api.github.com/users/Leblantoine/followers","following_url":"https://api.github.com/users/Leblantoine/following{/other_user}","gists_url":"https://api.github.com/users/Leblantoine/gists{/gist_id}","starred_url":"https://api.github.com/users/Leblantoine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Leblantoine/subscriptions","organizations_url":"https://api.github.com/users/Leblantoine/orgs","repos_url":"https://api.github.com/users/Leblantoine/repos","events_url":"https://api.github.com/users/Leblantoine/events{/privacy}","received_events_url":"https://api.github.com/users/Leblantoine/received_events","type":"User","site_admin":false},"repo":{"id":64128502,"name":"nanocloud","full_name":"Leblantoine/nanocloud","owner":{"login":"Leblantoine","id":10654878,"avatar_url":"https://avatars.githubusercontent.com/u/10654878?v=3","gravatar_id":"","url":"https://api.github.com/users/Leblantoine","html_url":"https://github.com/Leblantoine","followers_url":"https://api.github.com/users/Leblantoine/followers","following_url":"https://api.github.com/users/Leblantoine/following{/other_user}","gists_url":"https://api.github.com/users/Leblantoine/gists{/gist_id}","starred_url":"https://api.github.com/users/Leblantoine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Leblantoine/subscriptions","organizations_url":"https://api.github.com/users/Leblantoine/orgs","repos_url":"https://api.github.com/users/Leblantoine/repos","events_url":"https://api.github.com/users/Leblantoine/events{/privacy}","received_events_url":"https://api.github.com/users/Leblantoine/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Leblantoine/nanocloud","description":null,"fork":true,"url":"https://api.github.com/repos/Leblantoine/nanocloud","forks_url":"https://api.github.com/repos/Leblantoine/nanocloud/forks","keys_url":"https://api.github.com/repos/Leblantoine/nanocloud/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Leblantoine/nanocloud/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Leblantoine/nanocloud/teams","hooks_url":"https://api.github.com/repos/Leblantoine/nanocloud/hooks","issue_events_url":"https://api.github.com/repos/Leblantoine/nanocloud/issues/events{/number}","events_url":"https://api.github.com/repos/Leblantoine/nanocloud/events","assignees_url":"https://api.github.com/repos/Leblantoine/nanocloud/assignees{/user}","branches_url":"https://api.github.com/repos/Leblantoine/nanocloud/branches{/branch}","tags_url":"https://api.github.com/repos/Leblantoine/nanocloud/tags","blobs_url":"https://api.github.com/repos/Leblantoine/nanocloud/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Leblantoine/nanocloud/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Leblantoine/nanocloud/git/refs{/sha}","trees_url":"https://api.github.com/repos/Leblantoine/nanocloud/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Leblantoine/nanocloud/statuses/{sha}","languages_url":"https://api.github.com/repos/Leblantoine/nanocloud/languages","stargazers_url":"https://api.github.com/repos/Leblantoine/nanocloud/stargazers","contributors_url":"https://api.github.com/repos/Leblantoine/nanocloud/contributors","subscribers_url":"https://api.github.com/repos/Leblantoine/nanocloud/subscribers","subscription_url":"https://api.github.com/repos/Leblantoine/nanocloud/subscription","commits_url":"https://api.github.com/repos/Leblantoine/nanocloud/commits{/sha}","git_commits_url":"https://api.github.com/repos/Leblantoine/nanocloud/git/commits{/sha}","comments_url":"https://api.github.com/repos/Leblantoine/nanocloud/comments{/number}","issue_comment_url":"https://api.github.com/repos/Leblantoine/nanocloud/issues/comments{/number}","contents_url":"https://api.github.com/repos/Leblantoine/nanocloud/contents/{+path}","compare_url":"https://api.github.com/repos/Leblantoine/nanocloud/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Leblantoine/nanocloud/merges","archive_url":"https://api.github.com/repos/Leblantoine/nanocloud/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Leblantoine/nanocloud/downloads","issues_url":"https://api.github.com/repos/Leblantoine/nanocloud/issues{/number}","pulls_url":"https://api.github.com/repos/Leblantoine/nanocloud/pulls{/number}","milestones_url":"https://api.github.com/repos/Leblantoine/nanocloud/milestones{/number}","notifications_url":"https://api.github.com/repos/Leblantoine/nanocloud/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Leblantoine/nanocloud/labels{/name}","releases_url":"https://api.github.com/repos/Leblantoine/nanocloud/releases{/id}","deployments_url":"https://api.github.com/repos/Leblantoine/nanocloud/deployments","created_at":"2016-07-25T11:21:26Z","updated_at":"2016-07-25T11:21:27Z","pushed_at":"2016-11-08T16:49:59Z","git_url":"git://github.com/Leblantoine/nanocloud.git","ssh_url":"git@github.com:Leblantoine/nanocloud.git","clone_url":"https://github.com/Leblantoine/nanocloud.git","svn_url":"https://github.com/Leblantoine/nanocloud","homepage":"http://nanocloud.com","size":2574,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Nanocloud:master","ref":"master","sha":"0bb77d48b8d50040fd43d02c3b63deaf9950cd35","user":{"login":"Nanocloud","id":8394601,"avatar_url":"https://avatars.githubusercontent.com/u/8394601?v=3","gravatar_id":"","url":"https://api.github.com/users/Nanocloud","html_url":"https://github.com/Nanocloud","followers_url":"https://api.github.com/users/Nanocloud/followers","following_url":"https://api.github.com/users/Nanocloud/following{/other_user}","gists_url":"https://api.github.com/users/Nanocloud/gists{/gist_id}","starred_url":"https://api.github.com/users/Nanocloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nanocloud/subscriptions","organizations_url":"https://api.github.com/users/Nanocloud/orgs","repos_url":"https://api.github.com/users/Nanocloud/repos","events_url":"https://api.github.com/users/Nanocloud/events{/privacy}","received_events_url":"https://api.github.com/users/Nanocloud/received_events","type":"Organization","site_admin":false},"repo":{"id":63088572,"name":"nanocloud","full_name":"Nanocloud/nanocloud","owner":{"login":"Nanocloud","id":8394601,"avatar_url":"https://avatars.githubusercontent.com/u/8394601?v=3","gravatar_id":"","url":"https://api.github.com/users/Nanocloud","html_url":"https://github.com/Nanocloud","followers_url":"https://api.github.com/users/Nanocloud/followers","following_url":"https://api.github.com/users/Nanocloud/following{/other_user}","gists_url":"https://api.github.com/users/Nanocloud/gists{/gist_id}","starred_url":"https://api.github.com/users/Nanocloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nanocloud/subscriptions","organizations_url":"https://api.github.com/users/Nanocloud/orgs","repos_url":"https://api.github.com/users/Nanocloud/repos","events_url":"https://api.github.com/users/Nanocloud/events{/privacy}","received_events_url":"https://api.github.com/users/Nanocloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Nanocloud/nanocloud","description":null,"fork":false,"url":"https://api.github.com/repos/Nanocloud/nanocloud","forks_url":"https://api.github.com/repos/Nanocloud/nanocloud/forks","keys_url":"https://api.github.com/repos/Nanocloud/nanocloud/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Nanocloud/nanocloud/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Nanocloud/nanocloud/teams","hooks_url":"https://api.github.com/repos/Nanocloud/nanocloud/hooks","issue_events_url":"https://api.github.com/repos/Nanocloud/nanocloud/issues/events{/number}","events_url":"https://api.github.com/repos/Nanocloud/nanocloud/events","assignees_url":"https://api.github.com/repos/Nanocloud/nanocloud/assignees{/user}","branches_url":"https://api.github.com/repos/Nanocloud/nanocloud/branches{/branch}","tags_url":"https://api.github.com/repos/Nanocloud/nanocloud/tags","blobs_url":"https://api.github.com/repos/Nanocloud/nanocloud/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Nanocloud/nanocloud/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Nanocloud/nanocloud/git/refs{/sha}","trees_url":"https://api.github.com/repos/Nanocloud/nanocloud/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Nanocloud/nanocloud/statuses/{sha}","languages_url":"https://api.github.com/repos/Nanocloud/nanocloud/languages","stargazers_url":"https://api.github.com/repos/Nanocloud/nanocloud/stargazers","contributors_url":"https://api.github.com/repos/Nanocloud/nanocloud/contributors","subscribers_url":"https://api.github.com/repos/Nanocloud/nanocloud/subscribers","subscription_url":"https://api.github.com/repos/Nanocloud/nanocloud/subscription","commits_url":"https://api.github.com/repos/Nanocloud/nanocloud/commits{/sha}","git_commits_url":"https://api.github.com/repos/Nanocloud/nanocloud/git/commits{/sha}","comments_url":"https://api.github.com/repos/Nanocloud/nanocloud/comments{/number}","issue_comment_url":"https://api.github.com/repos/Nanocloud/nanocloud/issues/comments{/number}","contents_url":"https://api.github.com/repos/Nanocloud/nanocloud/contents/{+path}","compare_url":"https://api.github.com/repos/Nanocloud/nanocloud/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Nanocloud/nanocloud/merges","archive_url":"https://api.github.com/repos/Nanocloud/nanocloud/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Nanocloud/nanocloud/downloads","issues_url":"https://api.github.com/repos/Nanocloud/nanocloud/issues{/number}","pulls_url":"https://api.github.com/repos/Nanocloud/nanocloud/pulls{/number}","milestones_url":"https://api.github.com/repos/Nanocloud/nanocloud/milestones{/number}","notifications_url":"https://api.github.com/repos/Nanocloud/nanocloud/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Nanocloud/nanocloud/labels{/name}","releases_url":"https://api.github.com/repos/Nanocloud/nanocloud/releases{/id}","deployments_url":"https://api.github.com/repos/Nanocloud/nanocloud/deployments","created_at":"2016-07-11T17:36:07Z","updated_at":"2016-10-24T13:11:39Z","pushed_at":"2016-11-09T08:45:10Z","git_url":"git://github.com/Nanocloud/nanocloud.git","ssh_url":"git@github.com:Nanocloud/nanocloud.git","clone_url":"https://github.com/Nanocloud/nanocloud.git","svn_url":"https://github.com/Nanocloud/nanocloud","homepage":"http://nanocloud.com","size":3073,"stargazers_count":9,"watchers_count":9,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":40,"forks":6,"open_issues":40,"watchers":9,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Nanocloud/nanocloud/pulls/473"},"html":{"href":"https://github.com/Nanocloud/nanocloud/pull/473"},"issue":{"href":"https://api.github.com/repos/Nanocloud/nanocloud/issues/473"},"comments":{"href":"https://api.github.com/repos/Nanocloud/nanocloud/issues/473/comments"},"review_comments":{"href":"https://api.github.com/repos/Nanocloud/nanocloud/pulls/473/comments"},"review_comment":{"href":"https://api.github.com/repos/Nanocloud/nanocloud/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Nanocloud/nanocloud/pulls/473/commits"},"statuses":{"href":"https://api.github.com/repos/Nanocloud/nanocloud/statuses/13f50a6cf39703773a39cea35bd4af2537e8e445"}}}}
{"actor":{"display_login":"dynamiccast"}}