Skip to content

Instantly share code, notes, and snippets.

View ryujisnote's full-sized avatar

Ryuji Coffee ryujisnote

View GitHub Profile
@ryujisnote
ryujisnote / FileMove.ps1
Created June 2, 2024 12:52
PowerShellでファイルを移動するスクリプト
#requires -PSEdition Core
param (
[parameter(Mandatory=$true, Position=0)][String] $TwAc
)
#
# どこかからダウンロードしたファイルをNASに保存するスクリプト
#
$TGTPath = "~\Downloads\twitter_media_harvest\" + $TwAc
if( -! (Test-Path -Path $TGTPath)){ throw 'フォルダがありません' }
@ryujisnote
ryujisnote / com.google.chrome.ios.appconfig
Last active June 9, 2023 08:46
Google Chrome AppConfig Test
<dict>
<key>NTPContentSuggestionsEnabled</key>
<false/>
<key>BrowserSignin</key>
<integer>0</integer>
<key>AutoFillEnabled</key>
<false/>
<key>PasswordManagerEnabled</key>
<false/>
<key>NewTabPageLocation</key>
@ryujisnote
ryujisnote / homebridge-config.json
Created February 27, 2023 04:58
いまのHomeBridgeのconfig.json (APIキーなどはマスク済み)ずいぶんとシンプルになったなぁ…
{
"bridge": {
"name": "Homebridge X123",
"username": "01:23:45:67:89:AB",
"port": 65534,
"pin": "000-11-222"
},
"platforms": [
{
"name": "Homebridge X123",
@ryujisnote
ryujisnote / countExposureChecks
Created January 23, 2022 14:37
count json from iPhone covid19radar export file / iPhoneの接触通知ログを軽く確認した時の( ..)φメモ
PS > $jsonObj = Get-Content -path "\\DS918plus-001\home\Documents\ExposureChecks-2022-01-23.json" | ConvertFrom-Json
PS > $jsonObj.ExposureChecks.Files | foreach { if ($_.MatchCount -ne 0) { $_.MatchCount,$_.Timestamp -join ',' }}
PS > $jsonObj.ExposureChecks.Files | foreach { if ($_.MatchCount -ne 0) { $_.MatchCount,$_.Timestamp -join ',' ; $totalcount += $_.MatchCount }} ; Write-Host $totalcount
param ($Arg1)
Write-Host "$Arg1 秒"
$second = $Arg1 % 60
$Arg1 = ($Arg1 - $second) / 60
Write-Host "$Arg1 分 $second 秒"
$minute = $Arg1 % 60
$Arg1 = ($Arg1 - $minute) / 60
Write-Host "$Arg1 時間 $minute 分 $second 秒"
$hour = $Arg1 % 24
$Arg1 = ($Arg1 - $hour) / 24
function ffmpegencoding($filename)
{
if (!(Test-Path ./$filename.mp4 ))
{
. 'C:\Program Files (x86)\Streamlink\ffmpeg\ffmpeg.exe' -i .\${filename}.ts -vcodec libx264 -crf 23 -acodec aac -ab 192k .\${filename}.mp4
}
}
(Get-ChildItem -Recurse -File -Include *.ts).BaseName | ForEach-Object { ffmpegencoding $_ }
@ryujisnote
ryujisnote / ShowSecondsInSystemClock.ps1
Last active January 2, 2020 16:46
タスクバーの通知領域に秒針(seconds)時間を表示する - Windows 10
$path = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
$name = "ShowSecondsInSystemClock"
New-ItemProperty -Path $path -Name $name -PropertyType DWord -Value "1"
(
echo 'digraph{'
echo バニラバニラバニラ求人バニラバニラ高収入バニラバニラバニラ求人バニラバニラでアルバイト | sed 's/./& /g' | sed -r 's/(.).*/&バ/'| awk '{for(i=1;i<NF;i++)print $i "->"$(i+1),";"}'
echo '}'
) | circo -Tpng > /images/a.png #シェル芸
#!/bin/bash
text1=$1
if [ -w ${text1} ]; then
echo $text1
text2=`file $text1 | sed -e 's/.*datetime=\(.*\)\].*/\1/g' -e "s/://g" -e "s/\s/-/g"`
echo ${text2}_${text1}
if [ -n "${text2}" ]; then
mv -i ${text1} ${text2}_${text1}
fi