Skip to content

Instantly share code, notes, and snippets.

@anekos
anekos / without timzone.sql
Last active April 9, 2023 10:17
telegraf → TimescaleDB を Grafana に表示する
SELECT
host,
MAX(usage_user),
time_bucket('10min', time) AS bucket
FROM
telegraf.cpu
WHERE
(
to_timestamp($__unixEpochFrom()) -
(NOW() - NOW() AT TIME ZONE 'UTC')
for n in $(seq 1 8)
do
curl "https://www.google.com/logos/fnbx/animal_paws/audio/cat_sound_${n}.mp3" > "/tmp/xmosh/cat_sound_${n}.mp3"
done
for n in $(seq 1 9)
do
curl "https://www.google.com/logos/fnbx/animal_paws/cat_paw_${n}.png" > "/tmp/xmosh/cat_paw_${n}.png"
done
@anekos
anekos / switch-sddm-and-gdm.sh
Created December 21, 2022 13:24
SDDM と GDM を切り替えるスクリプト
#!/bin/bash
set -euC
# set -o pipefail
# exec 5>> /tmp/xmosh/shell-script-debug.out
# BASH_XTRACEFD="5"
# PS4='$LINENO: '
# set -x
@anekos
anekos / GCP.txt
Last active May 9, 2022 13:37
ゴミ文字を OCR してみた
2022-04-08
早くかくしな。 おおさめ下さい。
ごめんね。Sebastian, だっことそ。
&い)石けん。毎日良い臭い。におい。
石好き。
リんご。Quartz ボこん。石好を
Franc
Franc
九五六-Chang
風呂入れ。ファシ。
@anekos
anekos / tobu.js
Created April 4, 2021 11:41
getpocket でオリジナルのページに勝手に飛ぶ
// ==UserScript==
// @name Auto jump to origin - getpocket
// @namespace Violentmonkey Scripts
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://getpocket.com/read/*
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant none
// ==/UserScript==
@anekos
anekos / insensitive-mattn.css
Created October 22, 2020 09:05
センシティブな人物をインセンシティブにします
@-moz-document domain("chrome.google.com") {
img[src="https://lh3.googleusercontent.com/cf8qK3xF5SiuKQGaVC_J39ztLtZkjZ-YLl-Lja85-gadBMZUJ_JTOy_rMkQi6yrFJpNCordAHg=w128-h128-e365-rj-sc0x00ffffff"] {
filter: blur(2px);
}
}
Array.from(document.querySelectorAll('.gameListRowItemName')).map((it) => it.textContent).join("\n")
@anekos
anekos / tally-counter
Created May 6, 2020 11:07
Tally counter (Press ESC to exit)
#!/bin/bash
set -euC
# set -o pipefail
declare -A counts
function result () {
stty "$stty"
for i in "${!counts[@]}"
@anekos
anekos / support-internet-explorer.js
Created March 5, 2020 08:09
Internet Explorer に対応する JavaScript
if (~window.navigator.userAgent.indexOf('Trident')) {
location.href = 'https://getfirefox.com';
}