Skip to content

Instantly share code, notes, and snippets.

View takekazuomi's full-sized avatar
:octocat:
on code

Takekazu Omi takekazuomi

:octocat:
on code
View GitHub Profile
@takekazuomi
takekazuomi / log.txt
Created September 3, 2018 10:28
IL Linker result
Before linking (B) After linking (B) Size decrease
----------- ----------- ----------- -----------
Total size of assemblies 44,803,072 25,964,544 42.047%
----------- ----------- ----------- -----------
dotnetapp.dll 8,192 8,192 0.000%
utils.dll 4,608 4,608 0.000%
Microsoft.CSharp.dll 775,680 0 100.000%
Microsoft.VisualBasic.dll 460,800 0 100.000%
Microsoft.Win32.Primitives.dll 10,240 9,728 5.000%
Microsoft.Wi
Task Deploy -depends Archive -description "Deploy functions" -requiredVariables $name {
$container = "content"
$webapp = Get-AzureRmWebApp -Name $name | % {$_}
$h = @{}
$webapp.SiteConfig.AppSettings | % { $h[$_.Name] = $_.Value}
$zip = (Get-ChildItem "$buildDir/*.zip" | Select-Object -Last 1).FullName
$ctx = New-AzureStorageContext -ConnectionString $h["AzureWebJobsStorage"]
New-AzureStorageContainer -Name $container -Permission Off -Context $ctx -ErrorAction SilentlyContinue | Out-Null
$blob = Set-AzureStorageBlobContent -Container $container -BlobType Block -File $zip -Context $ctx -Force
$now = Get-Date
using System;
using System.Text;
namespace ConsoleApp4
{
class Program
{
static void Main(string[] args)
{
foreach (var encodingInfo in Encoding.GetEncodings())
@takekazuomi
takekazuomi / psakefile.ps1
Created August 7, 2018 19:37
psakefile for new netcore console projects
Properties {
$projects = @(
@{
template="console"
name = "diconsole"
}
@{
template="classlib"
name = "classlib01"
}
@takekazuomi
takekazuomi / get-functionkey.ps1
Created July 1, 2018 23:43
getting a functions secrets
#Requires -Version 5.1
#Requires -Modules AzureRM.Profile, AzureRM.Websites
[CmdletBinding()]
Param(
$Name
)
# https://github.com/projectkudu/kudu/wiki/Functions-API#getting-a-functions-secrets
# https://github.com/Azure/azure-powershell/issues/4212#issuecomment-338366729
$ sudo apt-get -o Debug::pkgProblemResolver=true -f install aspnetcore-runtime-2.1
Reading package lists... Done
Building dependency tree
Reading state information... Done
Starting pkgProblemResolver with broken count: 2
Starting 2 pkgProblemResolver with broken count: 2
Investigating (0) dotnet-host:amd64 < none -> 2.1.0-rc1-1 @un uN Ib >
using System;
using System.Runtime.InteropServices;
namespace smbclient
{
public class NativeWindowsNetworking
{
#region Consts
const int RESOURCE_CONNECTED = 0x00000001;
#Requires -Version 5.1
#Requires -Modules AzureRM.Profile, AzureRM.Websites
[CmdletBinding()]
Param(
$ResourceGroupName,
$Name,
$Path
)
$ErrorActionPreference = "Stop"
@takekazuomi
takekazuomi / accelerated_networking_allowed_sizes.txt
Last active January 6, 2018 23:42
The sizes available in the japan east region and accelerated networking allowed vm sizes 2018/1/7
SQLGL,
SQLGLCore,
Standard_D12_v2,
Standard_D12_v2_ABC,
Standard_D12_v2_Promo,
Standard_D13_v2,
Standard_D13_v2_ABC,
Standard_D13_v2_Promo,
Standard_D14_v2,
Standard_D14_v2_ABC,
$j = Get-AzureRmResourceGroup | ? {
$_.ResourceGroupName -like "hogehoge*"
} | % {
Start-Job {
param ($c, $n) Remove-AzureRmResourceGroup -AzureRmContext $c -ResourceGroupName $n -Verbose -Confirm:$false -Force
} -ArgumentList (Get-AzureRmContext), $_.ResourceGroupName
}
$j | Receive-Job -AutoRemoveJob -Wait -WriteJobInResults