| if (-not Test-Path -Path $profile) { New-Item -path $profile -type file -force } | |
| Add-Content -Path $profile -Value '$user32 = Add-Type -Name ''User32'' -Namespace ''Win32'' -PassThru -MemberDefinition ''[DllImport("user32.dll")]public static extern int GetWindowLong(IntPtr hWnd, int nIndex);[DllImport("user32.dll")]public static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong);[DllImport("user32.dll", SetLastError = true)]public static extern bool SetLayeredWindowAttributes(IntPtr hWnd, uint crKey, int bAlpha, uint dwFlags);''' | |
| Add-Content -Path $profile -Value 'Get-Process | Where-Object { @(''powershell'', ''cmd'') -contains $_.ProcessName } | % { $user32::SetWindowLong($_.MainWindowHandle, -20, ($user32::GetWindowLong($_.MainWindowHandle, -20) -bor 0x80000)) | Out-Null;$user32::SetLayeredWindowAttributes($_.MainWindowHandle, 0, 200, 0x02) | Out-Null }' |
| using System; | |
| using System.Collections.Generic; | |
| using System.Text; | |
| namespace PowerShellLsaWrapper { | |
| using System.Runtime.InteropServices; | |
| using System.Security; | |
| using System.Management; | |
| using System.Runtime.CompilerServices; | |
| using System.ComponentModel; |
| ((New-Object -c Shell.Application).Namespace('{0}\system32' -f $env:SystemRoot).parsename('cmd.exe')).InvokeVerb('taskbarpin') |
| function Get-DiskPartitions { | |
| $partitions = Get-WmiObject -Class Win32_DiskDriveToDiskPartition | % { | |
| $dDep = $_.Dependent | |
| $p = Get-WmiObject -Class Win32_DiskPartition | Where-Object { $_.Path.Path -eq $dDep } | |
| $d = Get-WmiObject -Class Win32_LogicalDiskToPartition | Where-Object { $_.Antecedent -in $dDep } | % { | |
| $lDep = $_.Dependent | |
| Get-WmiObject -Class Win32_LogicalDisk | Where-Object { $_.Path.Path -in $lDep } | |
| } | |
| New-Object PSObject -Property @{ | |
| Drive = if ($d -eq $null) { $null } else { $d.DeviceID }; |
| function Write-Log { | |
| <# | |
| .Synopsis | |
| Logs to the userdata run log file, with timestamps. | |
| .Parameter message | |
| The body of the log message | |
| .Parameter severity | |
| The severity of the message, to enable filtering in log aggregators or reporting. | |
| .Parameter path | |
| The full path to the log file. |
| sudo dnf erase -y git | |
| sudo dnf install -y curl-devel expat-devel gettext-devel openssl-devel perl-devel zlib-devel asciidoc xmlto docbook2X | |
| sudo ln -s /usr/bin/db2x_docbook2texi /usr/bin/docbook2x-texi | |
| wget https://www.kernel.org/pub/software/scm/git/git-2.7.4.tar.gz | |
| wget https://www.kernel.org/pub/software/scm/git/git-2.7.4.tar.sign | |
| gpg2 --keyserver gpg.mozilla.org --recv-keys 96AFE6CB | |
| gunzip git-2.7.4.tar.gz | |
| gpg2 --verify git-2.7.4.tar.sign git-2.7.4.tar |
| :: Taskcluster friendly wrapper for performing fx desktop builds via mozharness. | |
| :: Inputs, with defaults | |
| ::if not defined MOZHARNESS_SCRIPT set MOZHARNESS_SCRIPT=mozharness\scripts\fx_desktop_build.py | |
| ::if not defined MOZHARNESS_CONFIG set MOZHARNESS_CONFIG=builds\releng_base_windows_64_builds.py | |
| if not defined TOOLTOOL_CACHE set TOOLTOOL_CACHE=%SystemDrive%\home\worker\tooltool-cache | |
| if not defined NEED_XVFB set NEED_XVFB=false |
-
what's the scopes problem with new tc-worker y-2012 (https://treeherder.mozilla.org/#/jobs?repo=try&revision=c2a12e796c42&selectedJob=16774445)
solution: add scope (queue:create-task:aws-provisioner-v1/y-2012) to role (https://tools.taskcluster.net/auth/roles/#moz-tree:level:1)
-
how do you differentitate worker types for try vs build (https://bugzilla.mozilla.org/attachment.cgi?id=8719743&action=diff#a/testing/taskcluster/tasks/windows_build.yml_sec1)
solution: set the worker type somewhere under: https://hg.mozilla.org/try/file/c2a12e796c42/testing/taskcluster/tasks/branches/try
-
how do we manage termination of idle instances?
solution: provisioner should handle this by only spinning up instances as required. Still need to understand why all y-2012 instances stay up always.
| // A demonstration example for http://stackoverflow.com/a/26124494 | |
| // It runs a goroutine locked to an OS thread on Windows | |
| // then impersonates that thread as another user using its name | |
| // and plaintext password, then reverts to the default security | |
| // context before detaching from its OS thread. | |
| package main | |
| import ( | |
| "log" | |
| "runtime" |