Skip to content

Instantly share code, notes, and snippets.

@Ovis
Ovis / .NET Core Publish
Last active January 28, 2019 10:29
.NET Core Publish
PS D:\Documents\GitHub\PostDietProgress\PostDietProgress> dotnet publish --configuration Release
.NET Core 向け Microsoft (R) Build Engine バージョン 15.9.20+g88f5fadfbe
Copyright (C) Microsoft Corporation.All rights reserved.
D:\Documents\GitHub\PostDietProgress\PostDietProgress\PostDietProgress.csproj のパッケージを復元しています...
MSBuild ファイル D:\Documents\GitHub\PostDietProgress\PostDietProgress\obj\PostDietProgress.csproj.nuget.g.props を生成しています。
MSBuild ファイル D:\Documents\GitHub\PostDietProgress\PostDietProgress\obj\PostDietProgress.csproj.nuget.g.targets を生成しています。
D:\Documents\GitHub\PostDietProgress\PostDietProgress\PostDietProgress.csproj の復元が 782.4 ms で完了しました。
PostDietProgress -> D:\Documents\GitHub\PostDietProgress\PostDietProgress\bin\Release\netcoreapp2.2\PostDietProgress.dll
PostDietProgress -> D:\Documents\GitHub\PostDietProgress\PostDietProgress\bin\Release\netcoreapp2.2\publish\
@Ovis
Ovis / DogaRadiTaskExport.ps1
Created June 30, 2019 12:26
どがらじの録音予約エクスポート
$taskBasePath = "\DogaRadi\*"
$taskSaveDir = "D:\TaskScheduler\Task"
Get-ScheduledTask -TaskPath $taskBasePath | foreach {
$taskDir = Join-Path $taskSaveDir $_.TaskPath
if( -not (Test-Path -Path $taskDir)) {
mkdir -Path $taskDir
}
$path = (Join-Path $taskDir "$($_.TaskName).xml")
Export-ScheduledTask -TaskName $_.TaskName -TaskPath $_.TaskPath | Out-File $path # -WhatIf
$XmlinPath = "D:\TaskScheduler\Task\DogaRadi\WakeUp\"
$TaskinPath = "\DogaRadi\WakeUp\"
$tasks = Get-ChildItem "$XmlinPath\*.xml" -name
foreach ($i in $tasks)
{
schtasks /create /XML $XmlinPath$i /TN "$TaskinPath$i".Replace(".xml","")
}
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<Date>2019-02-05T13:11:41.883+09:00</Date>
<Description>Title=林原めぐみのTokyo Boogie Night,Service=radiko,StationId=CRK,StationName=ラジオ関西,Starttime=20190209230000,Endtime=20190209233000,StartMargin=15,TimeFree,GetTitle,CopyPath=C:\Users\Ovis\Radio,CopyFormat=.mp3</Description>
<URI>\DogaRadi\RadioRecorder\radiko_CRK_林原めぐみのTokyoBoogieNight_201902092300_201902092330</URI>
</RegistrationInfo>
<Principals>
<Principal id="Author">
<UserId>S-1-5-21-〇〇〇〇〇〇〇〇〇〇〇〇〇〇</UserId>
@Ovis
Ovis / MainWindow.xaml
Created November 24, 2019 08:45 — forked from kekyo/MainWindow.xaml
DelegateCommand on WPF
<Window x:Class="WpfApp1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfApp1"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Button x:Name="button">
TEST
@Ovis
Ovis / gist:4831aefdf613026c613fc98ed9f8da71
Created January 8, 2020 05:10
SoftEther Bridge用設定
## loopback
auto lo
iface lo inet loopback
## Ethernet port
auto eth0
iface eth0 inet manual
## Bridge interface
auto br0
@Ovis
Ovis / softether-vpnserver.service
Last active January 8, 2020 05:13
TAPデバイス有効化
[Unit]
Description=SoftEther VPN Server
After=network.target
[Service]
Type=forking
ExecStart=/usr/local/vpnserver/vpnserver_start
ExecStop=/usr/local/vpnserver/vpnserver stop
KillMode=process
Restart=on-failure
@Ovis
Ovis / Cron
Last active January 13, 2020 06:37
Raspberry Piで.NET Coreアプリを定期実行する場合のCronファイル
# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/home/pi/dotnet
# Example of job definition:
@Ovis
Ovis / vpnserver_start.sh
Last active February 17, 2020 10:23
SoftEther起動用シェルスクリプト
#!/bin/bash
/usr/local/vpnserver/vpnserver start
#SoftEther起動に時間がかかって、tapが取得できない問題の対応
sleep 5
tap=$(/sbin/ifconfig -a| awk '$1 ~ /^tap/ {print $1}')
/sbin/brctl addif br0 $tap
@Ovis
Ovis / gist:23e51634cb5cf819f181f96bf0c0f43a
Created March 22, 2020 16:36
RaspberryPi 4 sudo fdisk -l
pi@raspberrypi:~ $ sudo fdisk -l
Disk /dev/ram0: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
(中略)
Disk /dev/mmcblk0: 14.5 GiB, 15582887936 bytes, 30435328 sectors
Units: sectors of 1 * 512 = 512 bytes