mac: 14 items found.

英语话题王: Are you a Mac or a PC user? What are some of the differences? (or Android or iPhone?)

Ice Breaking Topics

  • If your house catches fire, what item would you save? Why?
  • What public holidays do you have in your country?
  • What are your views on online dating?
  • Would you exchange your flaws for someone else's?
  • What’s on your bucket list?
  • What is your favorite type of hat?
  • What's the most interesting volunteer work you've done, and what did you learn from it?
  • What does our society need most?
More ~

Ubuntu 防火墙 UFW 操作指北

Ubuntu上默认安装了一个防火墙服务 ufw, 全称为 Uncomplicated Firewall。默认是禁用的。

想用GUI可以看下Gufw。

基本用法

启用ufw: sudo ufw enable

To check the status of UFW:

查看 ufw状态: sudo ufw status verbose
也可以用 sudo ufw show raw 查看详情
也可以在 ** /etc/ufw**目录下查看 .rules的规则文件

More ~

shell function: Syntax error: “(” unexpected

shell执行时报这个错

./shell/notify.sh: 7: ./shell/notify.sh: Syntax error: "(" unexpected

notify.sh 写了个方法如

function notify() {
  echo "hello"
}

在mac上执行没问题,但是jenkins下跑时报错了。原因查到在这:

shell中函数定义应该是这样,没有function

notify() {
  echo "hello"
}

如果你硬要加function,那就去掉括号(),如下

function notify {
  echo "hello"
}
More ~

开始玩树莓派 - 将树莓派连接的USB打印机搞成打印服务器

当初为了省钱,买了个不支持无线的有线打印机,联想的LJ2205,黑白激光。
其实mac连接后,共享也没啥问题,不过用的时候mac要开机。

树莓派上先装cups相关的服务。

sudo apt-get install cups

装完执行sudo cupsctl --remote-any 允许远程访问

USB连接打印机。这个LJ2205有linux驱动,但是解压出的pdd文件没法用。找了些资料,说是联想的打印机都是Brother代工的,驱动大同小异。索性就用Brother的驱动试。

sudo apt-cache search printer-driver*可以查找下有哪些驱动,期中有个printer-driver-brlaser

于是装了这个sudo apt-get install printer-driver-brlaser

在Add printers时使用这个**Brother HL-L2300D, using brlaser v4 **,试了下测试页可以正常打出了。

前面试过其它打出的是空白的,一些坑就不细说了。
另外在访问https://*:631时,https在chrome下报错,可以在Safari下正常访问。

以下我也试了,iPhone手机和安卓手机,mac添加没问题,除了win10没试
To enable LPR support for Windows, we need to install the inet daemon:

apt-get install openbsd-inetd
Once installed, add the following line to the end of /etc/inetd.conf:

printer stream tcp nowait lp /usr/lib/cups/daemon/cups-lpd cups-lpd -o document-format=application/octet-stream

Restart inetd with:

systemctl restart openbsd-inetd

For AirPrint support, you must install avahi-daemon:

apt-get install --no-install-recommends avahi-daemon libnss-mdns

参考:
https://jtanx.github.io/2016/12/27/making-a-fast-rpi-print-server/

More ~

开始玩树莓派 - TF卡刷系统

树莓派官网提供了个imager工具,用来烧录系统。可是我在win10和mac下装上刷完系统,开机没任何反应。

最后在哪看到要用SDCardFormater格式化,这个试了也是一样,格式化应该用mac系统带的Disk Utility就可以。

主要原因应该还是烧录系统的问题。后来用dd命令试了刷了系统可以启动。

diskutil list 先查sd卡,如disk3

diskutil umount /dev/disk3s1 再卸载挂载的

sudo dd bs=4m if=/Users/xxx/Downloads/2020-02-13-raspbian-buster.img of=/dev/disk3

status=progress mac不支持这个选项。
再往盘里写系统

More ~

旧款macbook升级到macOS Catalina 10.15

我的macbook是2011款,曾经换成固态硬盘,内存从2Gx2升到2G+8G,现在基本上还能应付一般开发。
10.14开始就已经不支持这台2011年款macbook。不过也是从某个网站下的patch工具,将10.14的镜像打上补丁可以升级上来。
Screen Shot 2019-10-09 at 23.54.01.png

10.15也有这样的工具,将macOS Catalina的镜像打上补丁支持旧款macbook. 这个工具网站http://dosdude1.com/catalina/

先查这个再看兼容列表是否支持。
Screen Shot 2019-10-10 at 00.12.59.png

More ~