Skip to content

Instantly share code, notes, and snippets.

View reishoku's full-sized avatar
😺

reishoku reishoku

😺
  • Tokyo
  • 03:07 (UTC +09:00)
View GitHub Profile
@reishoku
reishoku / User-Group-management-macOS.md
Last active July 22, 2023 07:13
User-Group-management-macOS

macOSでのユーザ・グループ管理

  • ユーザ・グループ一覧
# 一般ユーザでも実行可能

dscl . -list /Users
dscl . -list /Groups
@reishoku
reishoku / timemachine-sparsebundle-mount.md
Last active July 19, 2023 12:22
timemachine-sparsebundle-mount

Time Machineのsparsebundleを他のホストからマウントする

うまくいくことは確認済み (2023/07/19)

# on macOS
osascript -e 'mount volume "nfs://<server>:<path/to/file>"'
cd /Volumes/Time\ Machine  # このpathはあくまで一例
@reishoku
reishoku / linux-man-in-macOS.md
Last active July 19, 2023 11:56
linux-man-in-macOS.md

macOSでLinuxのmanを読む方法

ややうろ覚えぎみなのであまり当てにはしないでほしいけれど。

使用シェルは fish

reishoku@Jade ~> sw_vers
ProductName:  macOS
  • macOS Ventura (13.4, M1) 環境で確認済み。

Disable mDNS on macOS

  1. sudo defaults write /Library/Preferences/com.apple.mDNSResponder.plist NoMulticastAdvertisements -bool YES
  2. Reboot

Enable mDNS on macOS

  1. sudo defaults write /Library/Preferences/com.apple.mDNSResponder.plist NoMulticastAdvertisements -bool NO
#!/usr/bin/env bash
g++-10 -x c++ -o program - << EOF
#include <iostream>
int main(void){
std::cout << "Hello, world!" << std::endl;
}
EOF
#!/usr/bin/env zsh
# Note that '追加' means 'add'. Localized word should be entered there.
# worked in macOS Big Sur 11.2.1 & MacBookPro 2016
open -a Mission\ Control && osascript -e ''tell application "System Events" to click (every button whose value of attribute "AXDescription" contains "追加") of group 2 of group 1 of group 1 of process "Dock"''
@reishoku
reishoku / std_list_factor.cpp
Last active February 12, 2021 14:12
C++のstd::listを使って素因数分解
// 2021-02-12. std::listで素因数分解プログラムを書きたい衝動に襲われたので書いた。
// g++ source.cpp -o prog -lm -std=gnu++14
#include <iostream>
#include <list>
#include <cmath>
using namespace std;