Skip to content

Instantly share code, notes, and snippets.

View otakusid's full-sized avatar
🏠
Working from home

otakuSiD otakusid

🏠
Working from home
View GitHub Profile
@otakusid
otakusid / ms-sql-db-move.md
Created March 26, 2020 18:40
move files of MS SQL database used for log-shipping to new volume
  • run SQL Management Studio
  • SQL Server Agent - Jobs - LSRestore_MAIN_DB_SERVER_YOUR_DATABASE_NAME - right click - Disable
  • get database files settings
select * from YOUR_DATABASE_NAME.sys.database_files
GO
  • switch database offline
ALTER DATABASE YOUR_DATABASE_NAME SET OFFLINE WITH ROLLBACK IMMEDIATE
@otakusid
otakusid / assume-role-with-mfa-local.md
Created April 2, 2018 08:56
Assume role with MFA for local environment
  • configure default profile with IAM user credentials
aws configure
  • get session token (valid 12 hours by default)
aws sts get-session-token --serial-number arn:aws:iam::123456789012:mfa/IAM-USER-HERE --token-code MFA-CODE-HERE
@otakusid
otakusid / Dockerfile
Last active October 23, 2017 12:30
image with android-sdk and gradle
FROM openjdk:8u141-jdk-slim
ENV ANDROID_HOME /opt/android-sdk
ARG ANDROID_BUILD_TOOLS_VERSION=25.0.0
ARG ANDROID_SDK_TOOLS_SHA256=444e22ce8ca0f67353bda4b85175ed3731cae3ffa695ca18119cbacef1c1bea0
ARG ANDROID_SDK_TOOLS_FILE=sdk-tools-linux-3859397.zip
ARG GRADLE_VERSION=3.5.1
ARG GRADLE_SHA256=8dce35f52d4c7b4a4946df73aa2830e76ba7148850753d8b5e94c5dc325ceef8
ENV GRADLE_HOME /opt/gradle-${GRADLE_VERSION}
@otakusid
otakusid / configure_aws_codedeploy.ps1
Created May 12, 2016 08:02
change root directory for AWS CodeDeploy service to fix issue with long paths
$logrand = Get-Random -minimum 0 -maximum 99
Start-Transcript -path "$PSCommandPath$logrand.log" -Force
Stop-Service -Name codedeployagent
$codedeployconfig = "C:\ProgramData\Amazon\CodeDeploy\conf.yml"
(Get-Content $codedeployconfig) -replace "'Amazon/CodeDeploy'", 'c:\codedeploy' | Set-Content $codedeployconfig
Start-Service -Name codedeployagent
@otakusid
otakusid / delete-service.ps1
Last active March 22, 2016 11:42
AWS Code Deploy - delete windows service during 'ApplicationStop' event
$serviceName = '[[[service.name]]]' # in format 'Namespace.ServiceName'
$service = Get-WmiObject -Class Win32_Service -Filter "Name='$serviceName'"
$i = $serviceName.LastIndexOf('.');
$serviceShortName = $serviceName.Substring($i + 1);
$eventSourceName = "CodeDeploy.$serviceShortName.ApplicationStop"
if(-Not [System.Diagnostics.EventLog]::SourceExists($eventSourceName)) {
New-EventLog –LogName "Application" –Source $eventSourceName
@otakusid
otakusid / configure_ssl.rake
Created February 5, 2016 09:27
Download latest SSL certificate and setup environment to make it accessible for Ruby
task :configure_ssl do
puts 'configure SSL'
cacert_file = File.join(Dir.tmpdir, 'cacert.pem')
if File.exist?(cacert_file)
puts "Used #{cacert_file} bundle of certificate authorities"
else
Net::HTTP.start("curl.haxx.se") do |http|
resp = http.get("/ca/cacert.pem")

vNext

.NET

  • .NET Native
  • .NET Compiler Platform ("Roslyn")
    • Provide API to get information from compiler 'black box'. This API will be used in the MSVS vNext (some features available in MSVS 2013) and third-party tools.
    • Can work with some features of C# 6.0
    • Scripting API
@otakusid
otakusid / MSDeploy_Create_Deploy_Package
Created June 30, 2013 17:30
How to create and deploy MSDeploy package using precompiled ASP.NET Web Application
rem Create package using manifest:
msdeploy -verb:sync -source:manifest="G:\CI_on_DVCS\PackageManifest.xml" -dest:package="g:\CI_on_DVCS\Package.zip"
rem Install package using manifest:
msdeploy -verb:sync -source:package="g:\CI_on_DVCS\Package.zip" -dest:manifest="G:\CI_on_DVCS\PackageInstallationManifest.xml",computerName=AMI,username="UserName",password="Password"
rem Create package using command line: