Code Snippets PostScript

Short texts PostScript 🧑‍💻 Code snippets PostScript ✍️ Reading lists PostScript 👀

Set gitlab runner to use git bash

[[runners]] name = “tt708-windows” url = “https://gitlab.com/” token = “[REDACTED]” executor = “shell” shell = “bash” builds_dir=”/c/gitlab-runner/builds/” cache_dir=”/c/gitlab-runner/cache/” [runners.cache] [runners.cache.s3] [runners.cache.gcs] et-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\gitlab-runner\ -Name ImagePath -Value “C:\Program Files\Git\bin\bash.exe -c `”/c/gitlab-r unner/gitlab-runner.exe run –working-directory /c/gitlab-runner –config /c/gitlab-runner/config.toml –service gitlab-runner`””

bulk_copy_from_one_db_to_another_db_with_batch_size_using_poweshell.ps

function Get-SQLTable { [CmdletBinding()] param( [Parameter(Mandatory=$true)] [string] $SourceSQLInstance, [Parameter(Mandatory=$true)] [string] $SourceDatabase, [Parameter(Mandatory=$true)] [string] $TargetSQLInstance, [Parameter(Mandatory=$true)] [string] $TargetDatabase, [Parameter(Mandatory=$true)] [string[]] $Tables, [Parameter(Mandatory=$false)] [int] $BulkCopyBatchSize = 10000, [Parameter(Mandatory=$false)] [int] $BulkCopyTimeout = 600 ) $sourceConnStr = “Data Source=$SourceSQLInstance;Initial Catalog=$SourceDatabase;Integrated Security=True;” $TargetConnStr = “Data Source=$TargetSQLInstance;Initial Catalog=$TargetDatabase;Integrated Security=True;” try { Import-Module -Name SQLServer write-host ‘module loaded’ $sourceSQLServer = New-Object Microsoft.SqlServer.Management.Smo.Server […]

Ghostscript で日本語フォントの表示確認 (横書き・縦書きとも)

%!PS-Adobe-3.0 /FontEncoding (-UniJIS-UTF8) def /FontSizeLabel 12 def /FontSizeSample 16 def /LineSep 20 def /LabelSep 12 def /ErrorFont /Courier def /MarkerSize 2 def /BorderColor { 0.8 0.8 0.8 } def /BackgroundColor { 1 1 1 } def % ページサイズをA4に設定 (-sPAPERSIZE が指定されていない場合) % gs であれば userdict にページサイズ設定用の命令 a4 が定義されていると % 期待できるが、定義されていない場合はサイズを直接指定する systemdict /PAPERSIZE known not { userdict […]