Skip to content

Commit

Permalink
增加 jupyter 和 mysql 命令
Browse files Browse the repository at this point in the history
  • Loading branch information
wxnacy committed Jun 18, 2020
1 parent 591665b commit ca8a26c
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 30 deletions.
10 changes: 10 additions & 0 deletions commands/cmd_jupyter
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# 启动 jupyter notebook 服务
jupyter notebook
# 启动 jupyter notebook 服务,并制定端口号
jupyter notebook --port <port>
# 将 ipynb 转为 html 格式
jupyter nbconvert <filename>.ipynb
# 将 ipynb 转为 html 格式,并指定输出目录
jupyter nbconvert <filename>.ipynb --output-dir=<dirname>
# 将 ipynb 转为 html 格式,并指定输出名称
jupyter nbconvert <filename>.ipynb --output=<filename>
10 changes: 10 additions & 0 deletions commands/cmd_mysql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# 查询 processlist
show processlist;
# 查询 processlist
select * from information_schema.processlist;
# 按客户端 IP 分组,看哪个客户端的链接数最多
select client_ip,count(client_ip) as client_num from (select substring_index(host,':' ,1) as client_ip from information_schema.processlist ) as connect_info group by client_ip order by client_num desc;
# 查看正在执行的线程,并按 Time 倒排序,看看有没有执行时间特别长的线程
select * from information_schema.processlist where Command != 'Sleep' order by Time desc;
# 找出所有执行时间超过 5 分钟的线程,拼凑出 kill 语句
select concat('kill ', id, ';') from information_schema.processlist where Command != 'Sleep' and Time > 300 order by Time desc;
Binary file added icon/jupyter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icon/mysql.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
60 changes: 30 additions & 30 deletions info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -460,28 +460,23 @@
<dict>
<key>config</key>
<dict>
<key>concurrently</key>
<false/>
<key>escaping</key>
<integer>102</integer>
<key>script</key>
<string>$@ | while read line
do
echo $line
done</string>
<key>scriptargtype</key>
<integer>1</integer>
<key>scriptfile</key>
<string></string>
<key>type</key>
<key>argumenttype</key>
<integer>0</integer>
<key>keyword</key>
<string>run</string>
<key>subtext</key>
<string></string>
<key>text</key>
<string>执行命令并得到结果</string>
<key>withspace</key>
<true/>
</dict>
<key>type</key>
<string>alfred.workflow.action.script</string>
<string>alfred.workflow.input.keyword</string>
<key>uid</key>
<string>AEEE997C-352F-4019-BFEF-40480C5770E9</string>
<string>0FA3CA6F-AB00-446F-95B9-EAB309AA7AD4</string>
<key>version</key>
<integer>2</integer>
<integer>1</integer>
</dict>
<dict>
<key>config</key>
Expand All @@ -507,23 +502,28 @@ done</string>
<dict>
<key>config</key>
<dict>
<key>argumenttype</key>
<integer>0</integer>
<key>keyword</key>
<string>run</string>
<key>subtext</key>
<key>concurrently</key>
<false/>
<key>escaping</key>
<integer>102</integer>
<key>script</key>
<string>$@ | while read line
do
echo $line
done</string>
<key>scriptargtype</key>
<integer>1</integer>
<key>scriptfile</key>
<string></string>
<key>text</key>
<string>执行命令并得到结果</string>
<key>withspace</key>
<true/>
<key>type</key>
<integer>0</integer>
</dict>
<key>type</key>
<string>alfred.workflow.input.keyword</string>
<string>alfred.workflow.action.script</string>
<key>uid</key>
<string>0FA3CA6F-AB00-446F-95B9-EAB309AA7AD4</string>
<string>AEEE997C-352F-4019-BFEF-40480C5770E9</string>
<key>version</key>
<integer>1</integer>
<integer>2</integer>
</dict>
<dict>
<key>config</key>
Expand Down Expand Up @@ -775,7 +775,7 @@ echo -n $(nohup curl $1 -O &amp;)</string>
<key>variablesdontexport</key>
<array/>
<key>version</key>
<string>2020.06.01</string>
<string>2020.06.03</string>
<key>webaddress</key>
<string>https://github.com/wxnacy/alfred-commands-workflow</string>
</dict>
Expand Down

0 comments on commit ca8a26c

Please sign in to comment.