Have a look at this script: bin/macos/hack.sh.
$ bin/macos/hack.shFor removing unused iOS simulators from Xcode:
$ xcrun simctl delete unavailableFirstly, enable USB debugging in the developer menu in the Android device.
Install scrcpy with:
$ brew install scrcpy
$ brew brew install android-platform-toolsHere is the guide.
Connect the Android device to macOS with USB cable, and get its IP address with:
$ adb shell ip routeenable adb over TCP/IP with:
$ adb tcpip 5555disconnect the USB cable, and connect it over TCP/IP with:
$ adb connect YOUR_DEVICE_IP:5555$ scrcpy --tcpip=YOUR_DEVICE_IP:5555For forwarding audio only:
$ scrcpy --tcpip=YOUR_DEVICE_IP:5555 --no-video --audio-buffer=400 --audio-bit-rate=320K --turn-screen-off$ sudo modprobe bcm2708_wdog
$ sudo vi /etc/modulesthen add following line:
bcm2708_wdog
Install watchdog and edit conf:
$ sudo apt-get install watchdog
$ sudo vi /etc/watchdog.confuncomment following line:
watchdog-device = /dev/watchdog
and restart the service:
$ sudo systemctl restart watchdog$ sudo modprobe i2c_dev
$ sudo vi /etc/modulesuncomment following line:
i2c-dev
edit blacklist:
$ sudo vi /etc/modprobe.d/raspi-blacklist.confand comment out following lines if exist:
blacklist spi-bcm2708
blacklist i2c-bcm2708
Then do the following:
$ sudo apt-get install i2c-tools
$ sudo usermod -a -G i2c USERNAMECreate a file named wpa_supplicant.conf with following content:
country=JP
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="YOUR-SSID"
psk=YOUR-PSK
# Protocol type can be: RSN (for WP2) and WPA (for WPA1)
proto=RSN
# Key management type can be: WPA-PSK or WPA-EAP (Pre-Shared or Enterprise)
key_mgmt=WPA-PSK
# Pairwise can be CCMP or TKIP (for WPA2 or WPA1)
pairwise=CCMP
# Authorization option should be OPEN for both WPA1/WPA2 (in less commonly used are SHARED and LEAP)
auth_alg=OPEN
# SSID scan technique (0 for broadcast, 1 for hidden)
scan_ssid=1
# Priority
priority=1
}
Replace YOUR-SSID and YOUR-PSK to yours.
YOUR-PSK can be generated like this:
$ wpa_passphrase [SSID] [PASSWORD]For example,
$ wpa_passphrase my_ssid 0123456789abcNow put the file on the root of your Raspberry-Pi-ready sdcard and boot with it.
Do the same on file: /etc/wpa_supplicant/wpa_supplicant.conf.
$ sudo vi /etc/wpa_supplicant/wpa_supplicant.confAfter that, turn the WLAN device off and on:
$ sudo ifdown wlan0
$ sudo ifup wlan0Your WLAN device's name may be different from 'wlan0'.
You can list yours with following command:
$ ls /sys/class/net | grep wl$ sudo apt-get install netatalk
$ sudo apt-get install avahi-daemonCreate a service file:
$ sudo vi /etc/avahi/services/SERVICE_NAME.serviceand add following lines:
<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h</name>
<service>
<type>_afpovertcp._tcp</type>
<port>548</port>
</service>
<service>
<type>_http._tcp</type>
<port>80</port>
</service>
<service>
<type>_ssh._tcp</type>
<port>22</port>
</service>
<service>
<type>_device-info._tcp</type>
<port>0</port>
<txt-record>model=Xserve</txt-record>
</service>
</service-group>
Try mounting frequently-written directories (including /tmp) to tmpfs.
For example, this is a part of my /etc/fstab file:
# tmpfs (https://wiki.archlinux.org/title/tmpfs)
tmpfs /tmp tmpfs defaults,noatime,nosuid,size=1536m 0 0
tmpfs /var/log tmpfs defaults,noatime,nosuid,mode=0755,size=128m 0 0
See this article.
If the SSD supports TRIM,
Create /etc/udev/rules.d/10-trim.rules file with the following line:
ACTION=="add|change", ATTRS{idVendor}=="XXXX", ATTRS{idProduct}=="YYYY", SUBSYSTEM=="scsi_disk", ATTR{provisioning_mode}="unmap"
where XXXX is the vendor id and YYYY is the product id
which can be retrieved from lsusb command:
Bus 002 Device 002: ID XXXX:YYYY My Lovely SSD
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
For running fstrim automatically, enable a timer with:
$ sudo systemctl enable fstrim.timerOpen conf:
$ sudo vi /etc/dhcp/dhclient.confand add following line:
supersede domain-name-servers 8.8.8.8, 8.8.4.4;
Install pi-bluetooth:
$ sudo apt-get install pi-bluetoothand reboot.
After reboot, use bluetoothctl for turning up, scanning, and connecting.
$ sudo bluetoothctlType help for commands and options.
- referenced: http://wiki.debian.org/BluetoothUser
$ sudo hciconfig hci0 piscan
$ sudo bluetooth-agent 0000Do as the screen says, and make Raspberry Pi hidden from other bluetooth devices again:
$ sudo hciconfig hci0 noscan$ hcitool dev$ hcitool scanOpen conf:
$ sudo vi /etc/default/bluetoothand add/alter following lines:
# edit
#HID2HCI_ENABLED=0
HID2HCI_ENABLED=1
# add static device information
device 01:23:45:AB:CD:EF {
name "Bluetooth Device Name";
auth enable;
encrypt enable;
}
Create a file:
$ sudo vi /etc/logrotate.d/some_fileand add following lines:
/some_where/*.log {
compress
copytruncate
daily
delaycompress
missingok
rotate 7
size=5M
}
Open fstab:
$ sudo vi /etc/fstaband add following lines:
/dev/some_hdd1 /some/where/to/mount1 ext4 defaults 0 0
/dev/some_hdd2 /some/where/to/mount2 vfat rw,noatime,uid=7777,gid=7778,user 0 0
uid and gid can be retrieved with command 'id'.
$ crontab -eand add following lines:
# every 5 minutes
*/1 * * * * bash -l /some/script_that_needs_login.sh
# every 1 hour
0 1 * * * bash -l -c /some/ruby_script_under_rvm.rb
$ sudo iptables -A INPUT -s 999.999.999.999 -j DROPAppend smsc95xx.turbo_mode=N to /boot/cmdline.txt file, and
add/alter following lines in /etc/sysctl.conf:
#vm.vfs_cache_pressure = 100
vm.vfs_cache_pressure = 300
#vm.min_free_kbytes=8192
vm.min_free_kbytes=32768
Try appending nvme_core.default_ps_max_latency_us=0 pcie_aspm=off to /boot/firmware/cmdline.txt file.
Install binutils-gold:
$ sudo apt install binutils-gold$ sudo dd if=/dev/zero of=/swapfile bs=1024 count=1M
$ sudo chmod 0600 /swapfile
$ sudo mkswap /swapfileand append following line to /etc/fstab:
/swapfile swap swap defaults 0 0
$ sudo apt-get install locales tzdata
$ sudo locale-gen en_US.UTF-8
$ sudo locale-gen ko_KR.UTF-8
$ sudo dpkg-reconfigure tzdataCreate a systemd override file for tailscaled:
$ sudo mkdir -p /etc/systemd/system/tailscaled.service.d
$ sudo vi /etc/systemd/system/tailscaled.service.d/override.confand add following lines:
[Service]
LogLevelMax=notice
then restart tailscaled:
$ sudo systemctl daemon-reload && sudo systemctl restart tailscaledInstall WSL on Windows 11 with this guide.
Windows Terminal is recommended.
Open Windows Terminal's settings and change 'Starting Directory' to: \\wsl$\LINUX-DISTRO\home\USERNAME
where LINUX-DISTRO is your Linux distro's name (eg. Ubuntu), and USERNAME is your linux username.
Use winget: Windows Package Manager.
# eg.
$ winget search tailscale
$ winget install tailscale
$ winget upgrade --allOpen conf:
$ sudo vi /etc/mysql/my.cnfand add following lines:
[mysql]
default-character-set = utf8mb4
[client]
default-character-set = utf8mb4
[mysqld]
character-set-client-handshake=FALSE
init_connect="SET collation_connection = utf8mb4_unicode_ci
init_connect="SET NAMES utf8mb4"
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
[mysqldump]
default-character-set = utf8mb4