お知らせ

現在サイトのリニューアル作業中のため、表示が崩れているページが存在することがあります。

公式のリファレンスが情報少なすぎるのでメモ
特にこれというフォーマットはなく、ある程度幅広い書式があるようで、公式のドキュメントを見る限り、多少のブレはよしなに解釈してくれるっぽい?
この記事ではoperatorなどの用語が登場しますが、これは私が勝手に名付けたものなので、特に公式の用語ではありません

手組するの面倒なので雑にコマンド生成ツールを作りました。

https://tool.lycolia.info/slack-remider-creator

登録

基本

  • フォーマット
    • /remind [宛先] [メッセージ] [実行日時]
    • /remind #random "hoge piyo fuga" at 10:00 every monday, sunday

書式

宛先
宛先 意味
me 自分
@someone メンション
#channel チャンネル
メッセージ

"hoge piyo fuga"のように書けるが、hoge piyo fugaでも一応通じる
ダブルクォートで囲む場合、改行も利用可能

実行日時
  • <oparator> <repeat-operator>
    • <oparator>で実行日時を設定
    • <repeat-operator>で繰り返しを設定
    • at 10:00 every monday, sunday
oparator
オペレーター 意味
in <value> (seconds \ minutes \ hours)
at <HH:mm> at 1700 指定時刻に実行
on <yyyy-MM-dd HH:mm> on 2023-10-10 09:15 指定日時に実行
repeat-operator
  • every <operator>
    • every monday, sunday
operator
day
weekday
sunday, monday, tuesday, wednesday, thursday, friday, saturday

削除

  • /remind listでリスト表示して消す

一覧

  • /remind list

Twilogには特定ツイートを一括で削除する機能がなかったので適当に作りました。
ページネーション機能はないので暇な人作ってください。
事前にページネーションリンクを取得して各ページのHTMLを取得してID引っこ抜けばできると思います。多分

/**
 * これは何?
 *  Twilogで現在表示中のページのツイートをすべて削除します
 *  事前に削除対象のツイートを日付選択や検索などで表示した上で実行します
 *  ページネーション機能はありません
 *
 * 使い方
 *  このスクリプトをChromeのDevtoolsのConsoleにコピペして実行します
 *  複数ページある場合はページをリロードして同様に操作します
 */

const getSession = () => {
  const scr = [...document.getElementsByTagName('script')].find(v => v.text.match(/j-delete-tweet.rb/) !== null)
  const mat = scr.text.match(/j-delete-tweet.rb\?c=(.+?)&.+&token=(.+)"/)
  return {
    c: mat[1],
    token: mat[2]
  }
}

const getDeleteIdList = () => {
  return [...document.getElementsByClassName('tl-del')]
    .map((el) => {
      const mat = el.children[0].onclick.toString().match(/delete_tweet\('(.+?)','(.+?)',/)
      return {
        date: mat[1],
        status_id: mat[2]
      }
    }
  )
}

const createDeleteRequest = (c, token) => {
  return async (date, statusId) => {
    return fetch(`https://twilog.org/j-delete-tweet.rb?c=${c}&date=${date}&status_id=${statusId}&token=${token}`)
  }
}

const session = getSession()
const requestDelete = createDeleteRequest(session.c, session.token)

const deleteIdList = getDeleteIdList()

let index = 0;
setInterval(async () => {
  if (index < deleteIdList.length) {
      const del = deleteIdList[index]
      const result = await requestDelete(del.date, del.status_id)
      console.log(`${index} / ${deleteIdList.length}`, result)
      ++index
  }
}, 1000)
2024/01/22 11:33 OS::Windowsその他::SSH
  • %HOMEPATH%.ssh\configに以下のように設定すると踏み台サーバーを経由したSSH接続が可能
    • 設定は踏み台には証明書認証があるが、宛先にはないケースを想定
  • ssh target-host.devとすると踏み台経由でアクセス可能
    • ProxyCommandではssh.exeをフルパスで記述する必要がある
# Read more about SSH config files: https://linux.die.net/man/5/ssh_config
Host proxy.ssh-host.dev
  HostName proxy.ssh-host.dev
  User foo
  IdentityFile C:\Users\user-name\.ssh\id_rsa
  ForwardAgent yes
Host target-host.dev
  Hostname target-host.dev
  User bar
  ProxyCommand C:\Windows\System32\OpenSSH\ssh.exe -l %r -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null proxy.ssh-host.dev -W %h:%p