Mac OSX USB installer

In order to create OSX installer on USB memory drive you need to:

  • Download the Mac OSX Yosemite installer from AppStore on you Mac.
  • Create installation media from Terminal by executing following command (remember to adjust YOURUSBVOLUME value):

    sudo /Applications/Install\ OS\ X\ Yosemite.app/Contents/Resources/createinstallmedia --volume /Volumes/YOURUSBVOLUME --applicationpath /Applications/Install\ OS\ X\ Yosemite.app --nointeraction
  • Boot target Mac from USB by pressing ALT/OPTION key while powering-on the computer.
  • Remember to format target drive first with Disk Utility if you want to perform clean installation.

Mac OSX Bluetooth Modem resource busy

In case you wonder why your device does not connect as Modem via Bluetooth to the Mac OSX, or you cannot see COM port on Windows, your mobile device may not simply support or provide DUN (Dial Up Network) and/or SPP (Serial Port Profile) profile.

On Mac OSX I got following error, until I tried another device and/or starting by hand DUN service on a mobile/client machine:

cannot open /dev/cu.Bluetooth-Modem: Resource busy

Notes:

  • Read Bluetooth specification for Serial Port Profile.
  • Read Bluetooth specification for Dial-Up Network Profile.
  • Modern mobile phones / USB 3G dongles, unfortunately, do not provide direct AT/Hayes access to the Radio Modem anymore.
  • You can install DUN application for your smartphone, but it will be only a simple dummy wrapper imitating modem for simple applications, but they do not provide full modem functionality, beware, its a fake.
  • Its only necessary for devices to be paired first in order to get SPP/DUN working. If device does not provide serial port over bluetooth when devices are paired and online, probably its just not there implemented.

FreeBSD sFTP SSHD chroot nologin

There are situations when you have a nice server out there, and you want/need someone to upload important files, but you only want to give them a minimal access to the system. You can use SSHD with sFTP and /sbin/nologin shell for that in chroot environment (dedicated limited userspace). Note that SCP in fact requires a working shell, so you need to use sFTP in this case..

Create a new user account with existing ftp group and /sbin/nologin shell:

# adduser

Alternatively you can modify an existing account to share:

# pw groupmod ftp -m username
# pw usermod username -s /sbin/nologin

You need to set correct permissions to the user home directory and public directory inside for upload:

# chown root:wheel /home/username
# mkdir /home/username/public
# chown username:ftp /home/username/public

Now modify the SSHD server configuration file /etc/ssh/sshd_config and append:

Match Group ftp
        ChrootDirectory         /home/%u
        ForceCommand            internal-sftp
        AllowTcpForwarding      no
        PermitTunnel            no
        X11Forwarding           no

Remember to restart the SSHD in order to apply new configuration:

# service sshd restart

Once the account is not necessary anymore remember to remove it:

# pw userdel username