运维烂笔头

一个 SA 老兵的工作日志


  • projects

  • Home

  • About

  • Tags

  • Categories

  • Archives

  • Sitemap

  • Commonweal 404

  • Search

几个问题

Posted on 2020-12-02 | Edited on 2020-12-03

缘起

没啥可说的,面试被问了几个问题,感觉当时答的不太好,事后查了下文档,特此记录下。

Docker 是基于什么

我理解是问 Docker 技术的底层原理是什么。

先看看 Docker 官方是怎么说的:

The underlying technology((Docker 的)底层技术)

Read more »

support alibaba cloud in draw.io

Posted on 2020-11-11 | Edited on 2020-11-13

背景

最近几年一直在用 draw.io 来画一些工作中的架构图之类的各种图,这个工具对于 AWS、azure 甚至于 GCP 都支持,但惟独就是还不支持阿里云,而工作中有几家公司偏偏就是用的阿里云,其实也可以用 AWS 之类的图标来画,但强迫症让我必须用阿里云自己的图标。于是就有了本篇内容。

Read more »

How to install/upgrade fomula from local dmg file

Posted on 2020-10-12 | Edited on 2020-10-13

缘起

brew 升级 Joplin 的时候,由于大陆从 github 下载软件包太慢,所以几乎每次都无法完整下载软件包而 timeout 退出。

于是就找了个 github 的代理手工下载(二进制)软件包,然后想通过 brew 直接用本地的 .dmg 文件来升级。

这里的难点,也是本文要谈的问题,就是如何让 brew 直接使用本地下载好的 .dmg 文件升级 Joplin(其他软件也一样)而不是从网上(github)下载。

Read more »

面试之查漏补缺

Posted on 2020-09-11 | Edited on 2020-09-13

乍一看,题都不难,但手生了后好多不看 manual 都生写不出来。

没啥可说的,直接上问题。

Read more »

用 Python 实现简单的俄罗斯方块(tetris)游戏

Posted on 2020-08-09 | Edited on 2020-08-10

缘起

最近又(为什么要说“又”呢?)在学着用 Python 来解决一些实际问题,希望能从真实应用场景中提升编码的能力。前面的 用 Kindle 追网文之二 是,现在的俄罗斯方块也是。

Read more »

用 Kindle 来追网文之二

Posted on 2020-07-07 | Edited on 2020-07-12

背景

前面的文章 用 kindle 追网文 提到了一种用 kindle 追网文的方式,正常工作过一段时间之后,情况又发生变化了:每个章节都被拆成两个页面。这样就导致我只抓了每个章节的第一个页面,第二个页面没抓,自然内容也就不完整了。这部分内容主要是对 用 kindle 追网文 的代码做了些简单的改动,以适应最新情况。

Read more »

利用 sed 和 awk 做简单日志分析

Posted on 2020-06-14 | Edited on 2020-06-15

环境

本实验是在 macOS 下做的,Linux 下可能会稍有不同(比如 gzcat)。

日志文件

1
gzcat data.gz | head -n 40 # data.gz 是日志文件

系统输出:

May 13 00:01:58 BBAOMACBOOKAIR2 com.apple.xpc.launchd[1] (com.apple.mdworker.bundles[12513]): Could not find uid associated with service: 0: Undefined error: 0 501
May 13 00:01:58 BBAOMACBOOKAIR2 com.apple.xpc.launchd[1] (com.apple.mdworker.bundles[12513]): Service exited with abnormal code: 78
May 13 00:02:12 BBAOMACBOOKAIR2 com.apple.xpc.launchd[1] (com.apple.xpc.launchd.domain.pid.mdmclient.12523): Failed to bootstrap path: path = /usr/libexec/mdmclient, error = 108: Invalid path
May 13 00:04:20 BBAOMACBOOKAIR2 syslogd[113]: ASL Sender Statistics
May 13 00:05:58 BBAOMACBOOKAIR2 com.apple.xpc.launchd[1] (com.apple.mdworker.bundles[12535]): Could not find uid associated with service: 0: Undefined error: 0 501
May 13 00:05:58 BBAOMACBOOKAIR2 com.apple.xpc.launchd[1] (com.apple.mdworker.bundles[12535]): Service exited with abnormal code: 78
May 13 00:09:58 BBAOMACBOOKAIR2 com.apple.xpc.launchd[1] (com.apple.mdworker.bundles[12536]): Could not find uid associated with service: 0: Undefined error: 0 501
May 13 00:09:58 BBAOMACBOOKAIR2 com.apple.xpc.launchd[1] (com.apple.mdworker.bundles[12536]): Service exited with abnormal code: 78
May 13 00:17:59 BBAOMACBOOKAIR2 com.apple.xpc.launchd[1] (com.apple.mdworker.bundles[12555]): Could not find uid associated with service: 0: Undefined error: 0 501
May 13 00:17:59 BBAOMACBOOKAIR2 com.apple.xpc.launchd[1] (com.apple.mdworker.bundles[12555]): Service exited with abnormal code: 78
May 13 00:17:59 BBAOMACBOOKAIR2 syslogd[113]: ASL Sender Statistics
May 13 00:19:59 BBAOMACBOOKAIR2 com.apple.xpc.launchd[1] (com.apple.mdworker.bundles[12556]): Could not find uid associated with service: 0: Undefined error: 0 501
May 13 00:19:59 BBAOMACBOOKAIR2 com.apple.xpc.launchd[1] (com.apple.mdworker.bundles[12556]): Service exited with abnormal code: 78
May 13 00:21:59 BBAOMACBOOKAIR2 com.apple.xpc.launchd[1] (com.apple.mdworker.bundles[12560]): Could not find uid associated with service: 0: Undefined error: 0 501
May 13 00:21:59 BBAOMACBOOKAIR2 com.apple.xpc.launchd[1] (com.apple.mdworker.bundles[12560]): Service exited with abnormal code: 78
May 13 00:22:18 BBAOMACBOOKAIR2 com.apple.xpc.launchd[1] (com.apple.xpc.launchd.domain.user.914945058): Service “com.apple.xpc.launchd.unmanaged.loginwindow.594” tried to register for endpoint “com.apple.tsm.uiserver” already registered by owner: com.apple.TextInputMenuAgent
May 13 00:22:49 — last message repeated 1 time —
May 13 00:23:50 BBAOMACBOOKAIR2 timed[158]: settimeofday({0x5ebacd96,0x52ddf}) == 0
May 13 00:28:05 BBAOMACBOOKAIR2 syslogd[113]: ASL Sender Statistics
May 13 00:28:07 BBAOMACBOOKAIR2 com.apple.xpc.launchd[1] (com.apple.ScreenSaver.Computer-Name[12564]): Service exited due to SIGKILL | sent by Computer Name[12564]
May 13 00:28:17 BBAOMACBOOKAIR2 VTDecoderXPCService[960]: DEPRECATED USE in libdispatch client: Changing the target of a source after it has been activated; set a breakpoint on _dispatch_bug_deprecated to debug
May 13 00:28:17 BBAOMACBOOKAIR2 VTDecoderXPCService[960]: DEPRECATED USE in libdispatch client: Changing target queue hierarchy after xpc connection was activated; set a breakpoint on _dispatch_bug_deprecated to debug
May 13 00:28:18 BBAOMACBOOKAIR2 VTDecoderXPCService[960]: DEPRECATED USE in libdispatch client: Changing the target of a source after it has been activated; set a breakpoint on _dispatch_bug_deprecated to debug
May 13 00:28:18 BBAOMACBOOKAIR2 VTDecoderXPCService[960]: DEPRECATED USE in libdispatch client: Changing target queue hierarchy after xpc connection was activated; set a breakpoint on _dispatch_bug_deprecated to debug
May 13 00:28:19 BBAOMACBOOKAIR2 VTDecoderXPCService[960]: DEPRECATED USE in libdispatch client: Changing the target of a source after it has been activated; set a breakpoint on _dispatch_bug_deprecated to debug
May 13 00:28:19 BBAOMACBOOKAIR2 VTDecoderXPCService[960]: DEPRECATED USE in libdispatch client: Changing target queue hierarchy after xpc connection was activated; set a breakpoint on _dispatch_bug_deprecated to debug
May 13 00:28:20 BBAOMACBOOKAIR2 VTDecoderXPCService[960]: DEPRECATED USE in libdispatch client: Changing the target of a source after it has been activated; set a breakpoint on _dispatch_bug_deprecated to debug
May 13 00:28:20 BBAOMACBOOKAIR2 VTDecoderXPCService[960]: DEPRECATED USE in libdispatch client: Changing target queue hierarchy after xpc connection was activated; set a breakpoint on _dispatch_bug_deprecated to debug
May 13 00:28:26 BBAOMACBOOKAIR2 com.apple.xpc.launchd[1] (com.apple.preference.displays.MirrorDisplays): Service only ran for 9 seconds. Pushing respawn out by 1 seconds.
May 13 00:28:31 BBAOMACBOOKAIR2 com.apple.xpc.launchd[1] (com.apple.preference.displays.MirrorDisplays): Service only ran for 4 seconds. Pushing respawn out by 6 seconds.
May 13 00:29:49 BBAOMACBOOKAIR2 com.apple.xpc.launchd[1] (com.apple.mdworker.bundles[12610]): Could not find uid associated with service: 0: Undefined error: 0 501
May 13 00:29:49 BBAOMACBOOKAIR2 com.apple.xpc.launchd[1] (com.apple.mdworker.bundles[12610]): Service exited with abnormal code: 78
May 13 00:30:00 BBAOMACBOOKAIR2 syslogd[113]: Configuration Notice:
ASL Module “com.apple.cdscheduler” claims selected messages.
Those messages may not appear in standard system log files or in the ASL database.
May 13 00:30:00 BBAOMACBOOKAIR2 syslogd[113]: Configuration Notice:
ASL Module “com.apple.install” claims selected messages.
Those messages may not appear in standard system log files or in the ASL database.
May 13 00:30:00 BBAOMACBOOKAIR2 syslogd[113]: Configuration Notice:
ASL Module “com.apple.callhistory.asl.conf” claims selected messages.

Read more »

用 Kindle 来追网文

Posted on 2020-05-01 | Edited on 2020-07-12

用 Kindle 来追网文

为嘛要干这个呢?这个说来话长,可能还是跟本人的实际情况有关系,别人可能还真没有这需求,毕竟,各种设备基本上都有 Kindle 和 Instapaper 的应用吧,直接看不香吗?所以,这里不解释,有需求的自然懂。

代码及主要思路来自于:这里

Read more »

手撸一个 Android 的 RAT(reote administration tool)

Posted on 2020-03-14 | Edited on 2020-03-15

整一个 Android 的 RAT

缘起

这个需求来源没法说,就是想找个 Android 手机的远程管理工具。

Read more »

How to change MySQL server's data directory on Ubuntu

Posted on 2020-02-04 | Edited on 2020-02-21

How to change MySQL server’s data directory on Ubuntu

背景

MySQL server

  1. MySQL server 的缺省 Data 目录是 /var/lib/mysql
  2. /var/lib/mysql 目录一般在 / 分区下
  3. / 区一般都不大,而且不推荐放数据
  4. 所以但凡正常 MySQL server,都存在 Data 目录放真正数据分区的需求
  5. 如果刚开始时没有设置好 Data 目录在数据分区,那么后来都有迁移 Data 目录到数据分区的需求
Read more »
123…8

老杨

好记性比不过烂笔头

80 posts
8 categories
323 tags
RSS
GitHub Twitter Weibo DouBan ZhiHu
© 2022 老杨
Powered by Hexo v3.8.0
|
Theme – NexT.Pisces v6.7.0