Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

<# copilot prompt
テキストファイルに列挙したファイルのみを特定のフォルダにコピーするPowerShellのスクリプトを書いてください。
- コピーするファイル名は相対パスで列挙
- コピー元のフォルダはsourcePathに設定
- コピー先のフォルダはdestinationPathに設定
- コピーするファイル名を列挙したファイルのパスはfileListPathに設定
- ファイル名を列挙したファイルはUTF8で読み込む
- コピー中のファイルの情報を表示
- コピー先にファイルが存在する場合はコピーをスキップする
- コピー元のファイルは再帰的に検索する
<!DOCTYPE html>
<html class=""><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>sample</title>
<body style="margin: 0px 0px 0px 126.5px; overflow: hidden;">
<script src="https://aframe.io/releases/0.8.2/aframe.min.js"></script>
<script src="https://cdn.rawgit.com/jeromeetienne/AR.js/1.5.5/aframe/build/aframe-ar.js"></script>
<a-scene embedded="" arjs="trackingMethod:best; debugUIEnabled:false;" class="" canvas="" inspector="" keyboard-shortcuts="" screenshot="" vr-mode-ui="">
<a-marker type="pattern" url="pattern-1414.patt">
<a-box position="0 0.8 0" wireframe="false" color="#843233" rotation="" scale="" visible="" material="" geometry="" src="" width="0.7" height="0.7" depth="0.7" >
<html>
<head>
<meta charset="utf-8">
<title>QR Shooter</title>
<script src="https://cdn.jsdelivr.net/npm/jsqr@1.4.0/dist/jsQR.min.js"></script>
<link href="https://fonts.googleapis.com/css?family=Ropa+Sans" rel="stylesheet">
<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<style>
body {
font-family: 'Ropa Sans', sans-serif;
@yoshimov
yoshimov / minecraft.service
Created July 11, 2021 06:56
systemd service for minecraft server
[Unit]
After=multi-user.target
[Service]
ExecStartPre=/home/ec2-user/check_version.sh
ExecStart=/usr/bin/java -Xmx7500M -Xms3000M -jar server.jar nogui
User=ec2-user
Restart=always
WorkingDirectory=/home/ec2-user
@yoshimov
yoshimov / check_version.sh
Last active September 21, 2022 20:16
check papermc builds and download latest jar file.
#!/bin/bash
# jq required
API="https://papermc.io/api/v2/projects/paper"
VER="1.17.1"
BUILDS_JSON=$(curl -s $API/versions/$VER)
#echo $BUILDS_JSON
LATEST=$(echo $BUILDS_JSON | jq '.builds[-1]')

Mastodon on ECSの構成

これだけ使ってみました。

  • Amazon ELB x2
    • Webサイト用とStreaming用に2つ用意
  • Amazon ElastiCache x1
    • Redisのt2.micro
  • Amazon RDS x1
  • PostgreSQLのt2.micro
@yoshimov
yoshimov / mastodon-http.diff
Last active May 19, 2017 01:51
mastodon v1.3.3 patch for http server
--- /mastodon/app/lib/tag_manager.rb.org
+++ /mastodon/app/lib/tag_manager.rb
@@ -69,7 +69,7 @@
uri = Addressable::URI.new
uri.host = domain.gsub(/[\/]/, '')
- uri.normalize.host
+ uri.normalize.authority
end
@yoshimov
yoshimov / esp8266-espruino-light-sensor.js
Created September 8, 2016 00:48
Light sensor script for Espruino on ESP8266
var http = require("http");
var pre = 0;
var count = 0;
var MAX = 50;
var TIMEOUT = 100;
var POSTURL="http://dweet.io/dweet/for/xxx";
var NOTIFYURL="http://auto-remote-url";
function loop() {
// 0 < val < 1
@yoshimov
yoshimov / fetch-latest-dweet.gs
Created September 1, 2016 02:42
Fetch latest dweet data and append to spreadsheet
function addData(time, val) {
var sheet = SpreadsheetApp.getActiveSheet();
var last = sheet.getLastRow();
var cell = sheet.getRange(last, 1);
var pretime = cell.getValue();
if (pretime != time) {
cell.offset(1, 0).setValue(time);
cell.offset(1, 1).setValue(val);
}
}
@yoshimov
yoshimov / slack-train-notify.gs
Last active September 13, 2016 09:02
Notify train accident to Slack using Google Apps Script
// GAS Script for train daemon on Slack
// ScriptProperties:
// - trainUrl: JR line information web page URL
// - trainName: Name of JR line
// - slackHookUrl: Slack web hook URL
// - slackChannel: Channel name of Slack
function trainRetrieve() {
var url = PropertiesService.getScriptProperties().getProperty("trainUrl");