Skip to content

Instantly share code, notes, and snippets.

@Canorus
Canorus / README.md
Created August 5, 2020 01:54 — forked from channprj/README.md
실행중인 파이썬 프로세스 모니터링하기

실행중인 파이썬 프로세스 모니터링하기

사전준비

pip install pyrasite urwid meliae

사용방법

@Canorus
Canorus / YT auto continue
Created August 3, 2020 23:49
Tampermonkey Script for automatically press continue button on YT for Safari macOS
// ==UserScript==
// @name Youtube Auto Click
// @namespace http://blog.canor.kr/
// @version 0.1
// @description Click youtube continue button automatically
// @author You
// @match *://www.youtube.com/*
// @exclude *://www.youtube.com/tv*
// @exclude *://www.youtube.com/live_chat*
// @grant none
+-o AMDFramebufferVIB <class AMDFramebuffer, id 0x1000007f7, registered, matched, active, busy 0 (521 ms), retain 160>
| {
| "IOFBScalerInfo" =
| 00000000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2E 00 00 00 00 40 00 00 00 40 00 00 00 00 00 00 .....................@...@......
| 00000020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
| "IOPMStrictTreeOrder" = Yes
| "av-signal-type" = <08000000>
| "IOFBMemorySize" = 268435456
| "IOFBDependentIndex" = 0
| "IOFBUIScale" = <01000000>
set srcFile to ((path to desktop) as text) & "dialog.txt"
set lns to paragraphs of (read file srcFile as «class utf8»)
repeat with ln in lns
my stringToClipboard(ln)
tell application "KakaoTalk" to activate
tell application "System Events"
keystroke "v" using command down
key code 36
delay 1.5
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi
echo "the-MacMini Terminal session ACTIVATED"
alias myip='curl -s icanhazip.com'
#alias myip='curl ip.appspot.com' # myip: Public facing IP Address
echo -e "\nYou are logged on ${RED}$HOST"
Feb 11 15:34:54 canors_ubuntu python3[9980]: [2020-02-11 15:34:54,686][DEBUG|teleg.py:112] >> canor searching for: {my query here}
Feb 11 15:46:20 canors_ubuntu python3[9980]: [2020-02-11 15:46:20,496][DEBUG|teleg.py:30] >> <telegram.ext.callbackcontext.CallbackContext object at 0x7fe1fb118ef0>
Feb 11 15:46:23 canors_ubuntu python3[9980]: [2020-02-11 15:46:23,987][DEBUG|teleg.py:112] >> canor searching for: {my query here}
Feb 11 15:46:36 canors_ubuntu python3[9980]: [2020-02-11 15:46:36,427][DEBUG|teleg.py:112] >> canor searching for: {my query here}
Feb 11 15:47:38 canors_ubuntu systemd[1]: Stopping Case detail Telegram bot...
Feb 11 15:47:38 canors_ubuntu systemd[1]: Stopped Case detail Telegram bot.
Feb 11 15:47:38 canors_ubuntu systemd[1]: Started Case detail Telegram bot.
Feb 11 15:47:40 canors_ubuntu python3[27903]: starting telegram bot
Feb 11 15:47:43 canors_ubuntu python3[27903]: [2020-02-11 15:47:43,647][DEBUG|teleg.py:30] >> <telegram.ext.callbackcontext.CallbackContext object at 0x7f2733632eb8>
F
@Canorus
Canorus / svg2icns.sh
Last active February 2, 2021 06:31 — forked from adriansr/svg2icns.sh
Convert SVG file to macOS icon (icns) format
#!/bin/sh -x
set -e
SIZES="
16,16x16
32,16x16@2x
32,32x32
64,32x32@2x
128,128x128
Dec 18 20:53:25 canors_ubuntu bundle[7872]: /home/mastodon/live/app/services/activitypub/process_collection_service.rb:32:in `each'
Dec 18 20:53:25 canors_ubuntu bundle[7872]: /home/mastodon/live/app/services/activitypub/process_collection_service.rb:32:in `map'
Dec 18 20:53:25 canors_ubuntu bundle[7872]: /home/mastodon/live/app/services/activitypub/process_collection_service.rb:32:in `process_items'
Dec 18 20:53:25 canors_ubuntu bundle[7872]: /home/mastodon/live/app/services/activitypub/process_collection_service.rb:19:in `call'
Dec 18 20:53:25 canors_ubuntu bundle[7872]: /home/mastodon/live/app/workers/activitypub/processing_worker.rb:9:in `perform'
Dec 18 20:53:25 canors_ubuntu bundle[7872]: /home/mastodon/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sidekiq-5.2.7/lib/sidekiq/processor.rb:192:in `execute_job'
Dec 18 20:53:25 canors_ubuntu bundle[7872]: /home/mastodon/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sidekiq-5.2.7/lib/sidekiq/processor.rb:165:in `block (2 levels) in process'
Dec 18 20:53:25
@Canorus
Canorus / kkma test #1
Created December 5, 2019 06:08
kkma 형태소 분석 시 문장 통째로 분석 넣은 산출값과 어절 단위로 분절해서 입력한 산출값의 비교
>>> l = []
>>> t = '일단 자물쇠는 풀어두고 싶은데 그런데 그렇다고 로컬탐라를 포기할 수 없어'
>>> kkma.pos(t)
[('일단', 'MAG'), ('자물쇠', 'NNG'), ('는', 'JX'), ('풀', 'VV'), ('어', 'ECD'), ('두', 'VXV'), ('고', 'ECE'), ('싶', 'VXA'), ('은데', 'ECD'), ('그런데', 'MAC'), ('그렇', 'VA'), ('다고', 'EFN'), ('로컬', 'NNG'), ('탐', 'NNG'), ('라', 'NNG'), ('를', 'JKO'), ('포기', 'NNG'), ('하', 'XSV'), ('ㄹ', 'ETD'), ('수', 'NNB'), ('없', 'VA'), ('어', 'ECD')]
>>> for i in t.split(' '):
... l.extend(kkma.pos(i))
...
>>> l
[('일단', 'MAG'), ('자물쇠', 'NNG'), ('는', 'JX'), ('풀', 'VV'), ('어', 'ECD'), ('두고', 'NNP'), ('싶', 'VXA'), ('은데', 'ECD'), ('그런데', 'MAC'), ('그렇', 'VA'), ('다고', 'EFN'), ('로컬', 'NNG'), ('탐', 'NNG'), ('라', 'NNG'), ('를', 'JKO'), ('포기', 'NNG'), ('하', 'XSV'), ('ㄹ', 'ETD'), ('수', 'NNG'), ('없', 'VA'), ('어', 'ECD')]
@Canorus
Canorus / tootcounter.py
Created November 30, 2019 14:36
툿 수 세서 k 단위로 발표해주는 스크립트
import requests # install requests package
import json
import re
h = {'Authorization': 'Bearer [access_key_here]'}
inst = 'https://[instance_address_here]'
r_user = requests.get(inst + '/api/v1/streaming/user', headers=h, stream=True)
def sendtoot(message):