顯示具有 mac 標籤的文章。 顯示所有文章
顯示具有 mac 標籤的文章。 顯示所有文章

2024年7月1日 星期一

Brave does not trigger suggestions Brave搜尋列的google 提示與計算機功能

 

Brave的網址列沒有顯示Google suggestions的功能,可以到這裡去啟動。

brave://settings/search


ref
'Autocomplete searches and URLs' does not exist in settings - Brave Search / Search Feedback - Brave Community https://community.brave.com/t/autocomplete-searches-and-urls-does-not-exist-in-settings/503031

2024年4月16日 星期二

[mac] 安裝 RIME | 中州韻輸入法 鼠鬚管 臺灣正體注音 輸入法 並設定ASDF選字模式

 
RIME | 中州韻輸入法引擎 https://rime.im/
"下載、安裝完成後,切換到 Rime 輸入法,立即擊響中文之韻。按組合鍵 Ctrl+` 或 F4 鍵喚出輸入方案選單,由此切換到朙月拼音、注音、倉頡等已啓用的輸入方案。亦可調整 Rime 輸入法最常用的選項。"

安裝完 rime 後 可以使用 ctrl + ~ 選擇 臺灣正體

設定檔 ~/Library/Rime/build/bopomofo_tw.schema.yaml

可以把選字模式改成跟gcin一樣的模式 

menu:
    # alternative_select_keys: ABCDEFGHIJ
    alternative_select_keys: ASDFGHJKL
    page_size: 9



2023年4月11日 星期二

[mac] 如何在 Mac 使用 automator 加入常用的 shell script shortcut 指令

 如何在 Mac 使用 automator 加入常用的 shortcut 指令

在Mac中可以使用 automator shell script 設定 service 並且使用keyboard shortcut 呼叫

例如想要快速的輸入日期跟時間格式 2023-04-11 Tue 11:04:49

在shell 下使用 date "+%F %a %H:%M:%S" | pbcopy

可以在 automator 加入quick action 使用 run shell script , pass input to stdin

另外在 keyboard shortcut 使用一個不衝突的 shortcut 設定




2023年3月6日 星期一

[Mac] sudo 使用 Touch ID 不用輸入密碼 /etc/pam.d/sudo



在 terminal sudo 時需要輸入一次密碼,可不可以使用Touch ID 來取代呢?

sudo vi /etc/pam.d/sudo
加入

```
auth       sufficient     pam_tid.so
```
之後在 sudo 狀態下就可以使用 touch ID了 

2021年7月29日 星期四

[mac] always on top 置頂視窗 AfloatX

 有在使用 Linux 的 X windows 都會使用的 always on top 把視窗置頂的功能。
Mac的 X windows的使用哲學下,沒有提供相對應功能。除了,使用 Chrome 可以在播放影片的時候,使用 Picture in Picture的功能。

在 mac 中,除了可以使用 

rwu823/afloat: Always on top solution, quickly install Afloat in macOS https://github.com/rwu823/afloat

但是新的版本可能會有相容性問題,
還有另外一個方案可以使用 AfloatX (搭配MacForge使用)

jslegendre/AfloatX: An alternative to Afloat that lives in the dock icon menu https://github.com/jslegendre/AfloatX
"An alternative to Afloat that lives in the dock icon menu"
MacEnhance/MacForge: 📦 Plugin, App, and Theme store which includes plugin injection for macOS https://github.com/MacEnhance/MacForge
"📦 Plugin, App, and Theme store which includes plugin injection for macOS"
安裝 MacForge 步驟如下,要注意到  recovery mode 去 Disable System Integrity Protection
Open MacForge and allow it to install helper tools
Disable System Integrity Protection
Open Terminal.app and run the command
sudo defaults write /Library/Preferences/com.apple.security.libraryvalidation.plist DisableLibraryValidation -bool true
Boot to recovery mode by rebooting and holding down ⌘ + R
Open the Terminal from the menubar and run the command
csrutil enable --without debug --without fs
Reboot



除了可以置頂以外還可以設置透明度



2020年10月12日 星期一

[mac] Modify Mac default timeout for TIME_WAIT

macOS has only 16K ports available that won't be released until socket

TIME_WAIT is passed. The default timeout for TIME_WAIT is 15 seconds.

Consider reducing in case of available port bottleneck.


You can check whether this is a problem with netstat:


    # sysctl net.inet.tcp.msl

    net.inet.tcp.msl: 15000


    # sudo sysctl -w net.inet.tcp.msl=1000

    net.inet.tcp.msl: 15000 -> 1000


Run siege.config to create the ~/.siegerc config file.

2020年7月20日 星期一

[kindle] macOS Catalina 10.15 無法使用 kindleGen


macOS Catalina 10.15 無法使用 kindleGen

macOS Catalina 10.15 無法使用 kindleGen
Amazon.com Message https://www.amazon.com/gp/feature.html?ie=UTF8&docId=1000765211
內下載的版本 會出現錯誤訊息
zsh: bad CPU type in executable: /usr/local/bin/kindleGen

可以使用 kindle-previewer 內帶的 kindlegen

brew cask install kindle-previewer

安裝完後 ln 一下

 ln -s "/Applications/Kindle Previewer 3.app/Contents/lib/fc/bin/kindlegen" /usr/local/bin/kindlegen


~/workspace $
 kindlegen

*************************************************************
 Amazon kindlegen(MAC OSX) V2.9 build 0000-kdevbld
 A command line e-book compiler
 Copyright Amazon.com and its Affiliates 2015
*************************************************************


2020年2月27日 星期四

[Mac] Mac 使用 osascript 與 display notification (linux 下使用 notify)


[Mac] Mac 使用 osascript 與 display notification (linux 下使用 notify)

Mac 怎麼與 Linux 一樣使用 nofify來跳出通知呢?

可以使用 osascript 與 display notification 跟 Crontab 來達成

Ex:

如果在 crontab 中可以設定 周間的1800 通知
00 18 * * 1-5 osascript -e 'display notification "\o/ \o/" with title "Notify"'


Rer
applescript - Change icon of notification when using osascript -e "display notification" - Stack Overflow https://stackoverflow.com/questions/48856158/change-icon-of-notification-when-using-osascript-e-display-notification
Commands Reference https://developer.apple.com/library/archive/documentation/AppleScript/Conceptual/AppleScriptLangGuide/reference/ASLR_cmds.html#//apple_ref/doc/uid/TP40000983-CH216-SW224

2020年2月26日 星期三

[vscode] terminal 選擇複製 terminal select to copy


一般的 terminal 中可以設定選擇後自動複製到剪貼簿(select to copy)

在 user setting 中加上
 "terminal.integrated.copyOnSelection":true

"Select to copy" in integrated terminal · Issue #21821 · microsoft/vscode https://github.com/Microsoft/vscode/issues/21821
"This ended up being added, see #36271. See the terminal.integrated.copyOnSelection setting"


2020年2月18日 星期二

[mac] Mac 下 zsh 的 forward word short cut



Mac 下 zsh 的 forward word short cut

在Mac使用iterm2 zsh 的 forward word 看一下 short cut 應該是 option(alt) + ->
可是一直不work。

使用 cat 看一下 option(alt) + -> 與 option(alt) + <-
分別是什麼 然後寫在 ~/.zshrc 內

bindkey "^[^[[D" backward-word
bindkey "^[^[[C" forward-word


ref
shell - Looking for ALT+LeftArrowKey solution in zsh - Stack Overflow https://stackoverflow.com/questions/12382499/looking-for-altleftarrowkey-solution-in-zsh

2019年9月17日 星期二

[mac] 怎麼刪除 chrome app 在 mac launchpad 上的 application

怎麼刪除 mac launchpad 上的 application

Command + shift + H
可以開啟
Applications
Chrome apps 就在
Chrome Apps 內

2019年5月14日 星期二

[mac] 如何在bash 加上 auto completion 使用 bash-completion


在使用Linux 時的bash 基本上有 auto completion
如何在Mac 中的 bash 加上 auto completion
可以使用 bash-completion

brew install bash-completion

Add the following lines to your ~/.bash_profile:

[[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]] && . "/usr/local/etc/profile.d/bash_completion.sh"
需要在這裡 ~/.bash_profile 加上這段指令

然後再當前 terminal 下要馬上使用,可以   .  ~/.bash_profile 使新的 bash 環境生效

2018年6月25日 星期一

[mac][docker] mac 中使用 mitmproxy An interactive TLS-capable intercepting HTTP proxy for penetration testers and software developers.

An interactive TLS-capable intercepting HTTP proxy for penetration testers and software developers.

由於 mitmproxy  不支援 python 2.7 只支援 python3
在 Mac 中使用 mitmproxy 可能還需要安裝 python3
所以使用了 mitmproxy docker image
mitmproxy/mitmproxy - Docker Hub
https://hub.docker.com/r/mitmproxy/mitmproxy/

因為要使用的是 mitmweb ,所下的 command 為

docker run --rm -it -v ~/.mitmproxy:/home/mitmproxy/.mitmproxy -p 8879:8080 -p 127.0.0.1:8081:8081 mitmproxy/mitmproxy mitmweb --web-iface 0.0.0.0 -s /home/mitmproxy/.mitmproxy/football.py

把 host 家目錄的 ~/.mitmproxy ssl key 掛載在 container 內
expose host 的 8879 對應到 proxy port 8080
至於 mitmweb 的 web port 就使用 8081 ,並限定只對 127.0.0.1 開放

-s 是為了 load script 。

2017年11月18日 星期六

[mac] bash bash-completion 指令自動補齊


在ubuntu 中在 bash 打指令,
像是 git checkout 按上 tab 他會幫你自動補齊。

如果在mac bash 中呢?
使用 bash-completion

$ brew install bash-completion
==> Downloading https://homebrew.bintray.com/bottles/bash-completion-1.3_1.el_capitan.bottle.tar.gz
######################################################################## 100.0%
==> Pouring bash-completion-1.3_1.el_capitan.bottle.tar.gz
==> Caveats
Add the following lines to your ~/.bash_profile:
  if [ -f $(brew --prefix)/etc/bash_completion ]; then
    . $(brew --prefix)/etc/bash_completion
  fi

Homebrew's own bash completion script has been installed to
  /usr/local/etc/bash_completion.d

Bash completion has been installed to:
  /usr/local/etc/bash_completion.d
==> Summary
🍺  /usr/local/Cellar/bash-completion/1.3_1: 188 files, 605.9K

2017年2月20日 星期一

[mac][python] mac 下 brew install gtk ,pygtk in virtaulenv


在 mac 中,想使用 gtk 的工具
知道要install gtk , pygtk

(mypython) peicheng@IronMan[~/workarea/openxenmanager]{10:48}
$ python openxenmanager
Traceback (most recent call last):
 File "openxenmanager", line 23, in <module>
   import gtk
ImportError: No module named gtk

直接使用 pip install 出現,

$ pip install pygtk
Collecting pygtk
  Using cached pygtk-2.24.0.tar.bz2
    Complete output from command python setup.py egg_info:
    ********************************************************************
    * Building PyGTK using distutils is only supported on windows. *
    * To build PyGTK in a supported way, read the INSTALL file.    *
    ********************************************************************

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/bn/73_b2959181dz267sk7x5y080000gp/T/pip-build-g0KAka/pygtk/

所以使用 brew install gtk pygtk

(mypython) peicheng@IronMan[~/workarea/openxenmanager]{10:49}
$ brew install gtk
(mypython) peicheng@IronMan[~/workarea/openxenmanager]{10:49}
$ brew install pygtk
(mypython) peicheng@IronMan[~/workarea/openxenmanager]{10:49}
$ python openxenmanager
Traceback (most recent call last):
 File "openxenmanager", line 23, in <module>
   import gtk
ImportError: No module named gtk

安裝好還是有這個訊息,環境下是有使用 virtaulenv的 brew install 的 packages 在另外一個目錄下,
切到 virtualenv  的 site-packages 的路徑下

cd /Users/peicheng/env/mypython/lib/python2.7/site-packages

ln -s /usr/local/lib/python2.7/site-packages/gtk-2.0 ./gtk-2.0
ln -s /usr/local/lib/python2.7/site-packages/pygtk.pth pygtk.pth


這樣就可以正常使用了

2016年11月21日 星期一

[mac][vim] error: There was a problem with the editor 'vi'. Please supply the message using either -m or -F option.


遇到

error: There was a problem with the editor 'vi'.
Please supply the message using either -m or -F option.


使用

$ git config --global core.editor

指定編輯器

2016年11月13日 星期日

[mac] mac 使用 android 的 usb 網路共用




除了使用 手機的無線基地台功能,也可以透過 usb網路共用的設定分享網路出來。



只要裝了

HoRNDIS: USB tethering driver for Mac OS X | Joshua Wise's domain
重開機後, android 手機插入電腦 開啟 usb網路共用 如果有讀取到就可以使用網路。




2016年10月31日 星期一

[mac] 移除已經安裝的印表機驅動程式 remove mac printer driver



位置在 /Library/Printers/PPDs/Contents/Resources

看看要移除哪些

example

移除所有的  Fuji Xerox 驅動程式

rm -rf FX*

and

rm -rf Fuji\ Xerox\ *

[mac] install fx printer driver for mac os x 使用 fujixerox 印表機的驅動程式



使用 Fuji Xerox 的 printer ,從  web console 看起來是 ApeosPort-V C3374 。
可是裝了 mac 的 Fuji Xerox 印表機驅動程式 v3.0 (OS X) 選了對應型號也是無法使用。
https://support.apple.com/kb/DL1776?locale=zh_TW



從 air printer 自己選擇的driver 來看確實是 Fuji Xeror 的機器沒錯 但是使用不同的 driver 。





a在加入新的 printer 時 ,輸入ip後他會幫你選擇使用的driver ,這時候自行選用 fx printer driver for mac os x (下方有下載網址)




Print Driver for Mac OS X : Description : Download : Fuji Xerox

使用了這個 driver 就可以在 mac 上 使用 fuji xerox 的印表機了。






2016年5月23日 星期一

[mac] sublime_diagram_plugin in setup raise Exception('No working processors found!') Exception: No working processors found! 解決方式


使用 Sublime + PlantUML 的 sublime_diagram_plugin 可能會出現下面問題

s/jvantuyl-sublime_diagram_plugin-034b659/diagram/__init__.py", line 49, in setup raise Exception('No working processors found!') Exception: No working processors found!

後來發現是沒有安裝 graphviz

#brew install graphviz

就解決了 (ps 要有java env)

使用 Sublime + PlantUML 高效地画图 - 简书
http://www.jianshu.com/p/e92a52770832/comments/1064420