Skip to content

Instantly share code, notes, and snippets.

View sharl's full-sized avatar
🐰

Sharl Morlaroll sharl

🐰
View GitHub Profile
@sharl
sharl / CentOS7onWSLmemo.md
Last active April 30, 2020 00:53
CentOS7 on WSL memo
  • https://github.com/yuk7/CentWSL
  • get release CentOS7.zip
  • mkdir somewhere(ex. %USERPROFILE%\AppData\Local\WSL\CentOS7), unpack (CentOS7.exe, rootfs.tar.gz) and run CentOS7.exe (install)
  • run CentOS7.exe (launch root)
  • adduser user
  • gpasswd -a user wheel
  • visudo -> NOPASSWD
  • exit
  • CentOS7.exe config --default-user user
  • CentOS7.exe config --default-uid 1000
@sharl
sharl / test-TLSv1_3.py
Created April 28, 2020 01:26
TLSv1.3のテスト
# -*- coding: utf-8 -*-
from __future__ import print_function
import socket
import ssl
import pprint
try:
ssl.HAS_TLSv1_3
except AttributeError:
@sharl
sharl / dqxpresence.sh
Created September 2, 2019 07:13
DQ10の現在の職業とレベルをSlackのステータスに反映する
#!/bin/bash
# -*- coding: utf-8 -*-
# $HOME/.dqxpresence format
# {
# "slack_token": "xoxp-xxxx",
# "id": 667538238772,
# "icon_emoji": ":dot_slime:"
# }
# id は https://hiroba.dqx.jp/sc/character/${user_id} です。マイページ全体の公開設定が『制限なしで公開』になっている必要があります。
slack_token=$(cat $HOME/.dqxpresence | jq -r .slack_token)
@sharl
sharl / ame.sh
Created June 7, 2019 09:37
みんな大好き東京アメッシュ
#!/bin/bash
# -*- coding: utf-8 -*-
# 東京アメッシュの画像を取得して合成
now=$(date +%s)
BASE_URL=https://tokyo-ame.jwa.or.jp
MAP=/map/map000.jpg
MSK=/map/msk000.png
# https://tokyo-ame.jwa.or.jp/mesh/000/201906071525.gif
rfm=$(date --date=@$((now / (5 * 60) * 5 * 60 - 5 * 60)) +%Y%m%d%H%M)
@sharl
sharl / brew-openssl-cacert-get-failed.md
Last active March 27, 2019 02:57
opensslアップデート時のcacert取得に失敗するときの対処方法

opensslアップデート時のcacert取得に失敗するときの対処方法

毎回忘れるのでメモ。

TL;DR

$ wget https://curl.haxx.se/ca/cacert.pem -O /home/linuxbrew/.linuxbrew/etc/openssl/cert.pem
@sharl
sharl / DQ10_on_Steam.md
Created September 10, 2018 14:55
ドラゴンクエストXオンラインをSteam上で遊んでいるゲームとして表示する方法

ドラゴンクエストXオンラインをSteam上で遊んでいるゲームとして表示する方法

  • Steamクライアント起動
  • 左下の「ゲームを追加」を選択
  • 「非Steamゲームを追加」を選択
  • 「参照」を選択
  • C:\Program Files (x86)\SquareEnix\DRAGON QUEST X\Game の DQXGame.exe をダブルクリック
  • 「選択したプログラムを追加」を選択
  • Steamクライアントのライブラリ → ゲーム で DQXGame を右クリックしてプロパティを選択
  • DQXGame となっているところを ドラゴンクエストXオンライン に変更
for f in $(curl -s https://www.asahi.com/articles/ASL4J669JL4JUEHF016.html | sed -e 's,^<td class="link"><a href="\(.*.pdf\)".*$,\1,p;d'); do wget $f; done
@sharl
sharl / slack-display-name.md
Created March 22, 2018 06:27
Slackの表示名を変更する一行野郎

SlackのLegacyTokenを取得

https://api.slack.com/custom-integrations/legacy-tokens チームのトークンを発行(これは自分用になります)

/usr/bin/curl -s -X POST -d 'token=YourToken' -d "profile={\"display_name\":\"ほげほげ\"}" https://slack.com/api/users.profile.set

とか

@sharl
sharl / SHIROBAKO.pl
Created February 1, 2018 06:26
SHIROBAKO
#!/usr/bin/perl -l
# -*- coding: utf-8 -*-
use strict;
use warnings;
my $word = $ARGV[0];
exit unless $word;
use NKF;
use LWP::UserAgent;