This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Enable RSA/Public Key Autentication (or default?) | |
| # Disable Password Authentication | |
| sudo vi /etc/ssh/sshd_config | |
| # Set proper privileges on ssh artifacts | |
| cd ~ | |
| chmod u-w ~ | |
| chmod 700 .ssh | |
| chmod 600 .ssh/authorized_keys |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #install samba | |
| sudo yum install samba | |
| sudo yum install samba-client | |
| #set workgroup | |
| sudo vi /etc/samba/smb.conf | |
| #set hostname | |
| sudo hostnamectl set-hostname frankg --static | |
| sudo service restart network |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| with a(n) as (select 0 union all select 1), | |
| b(n) as (select 2*x.n+y.n from a x, a y), | |
| c(n) as (select 4*x.n+y.n from b x, b y), | |
| d(n) as (select 16*x.n+y.n from c x, c y), | |
| e(n) as (select 256*x.n+y.n from d x, d y), | |
| f(n) as (select 65536*x.n+y.n from e x, e y) | |
| select top 100000000 n from f |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $cn = new-object Data.SqlClient.SqlConnection 'Server=.;Database=CIA;Trusted_Connection=true' | |
| $cn.open() | |
| $q = @' | |
| select count(*) from journaalposten.unv_conversierekeningschema | |
| where grootboeksysteem='QIS' and maatschappij=@m and gb_rekening=@gbr and kostenplaats=@kp and kostendrager=@kd | |
| '@ | |
| $cm = new-object Data.SqlClient.SqlCommand -a $q, $cn | |
| $p = $cm.parameters |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| open System | |
| open System.Data | |
| open System.Data.Common | |
| let exec exec sql = | |
| let factory = DbProviderFactories.GetFactory("System.Data.SqlClient") | |
| use connection = factory.CreateConnection() | |
| connection.ConnectionString <- "Data Source=.;Initial Catalog=tempdb;Integrated Security=SSPI" | |
| connection.Open() | |
| use command = factory.CreateCommand() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Windows Registry Editor Version 5.00 | |
| [HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\General] | |
| "SuppressUppercaseConversion "=dword:00000001 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Data.SqlClient; | |
| using System.Text; | |
| using System.Text.RegularExpressions; | |
| namespace Company.Product | |
| { | |
| using ModelTableAdapters; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Data; | |
| using System.IO; | |
| namespace Company.Product | |
| { | |
| internal class DataReaderStream : Stream | |
| { | |
| private long _position = 0L; | |
| private readonly IDataReader _reader; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| filter Get-LastChildItem { Join-Path $_ (gci $_ -Name | sort | select -Last 1) } | |
| $Outs = 'C:\(ProductName)\Branch\99 - bin\Deliverables\Name\Log\Compile\Compile_result.xml', | |
| "$('\\portal\DailyBuildResult\ProductName\Branch' | Get-LastChildItem | Get-LastChildItem)\CIName\Compile\compile.log" | % { | |
| ([xml](gc $_)).results.message | | |
| where {$_.type -eq 'warning'} | | |
| sort -CaseSensitive '#text' | | |
| % {"<message>$($_.'#text')</message>"} | | |
| Out-File ($Out = [IO.Path]::GetTempFileName()) | |
| $Out | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private static bool IsFileLocked(IOException exception) | |
| { | |
| int errorCode = Marshal.GetHRForException(exception) & ((1 << 16) - 1); | |
| return errorCode == 32 || errorCode == 33; | |
| } |