This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
BWROOT="${1:?"Root not specified!"}" | |
shift | |
env -i bwrap \ | |
--bind "$BWROOT" / \ | |
--unshare-user \ | |
--unshare-cgroup \ | |
--unshare-ipc \ | |
--unshare-pid \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Mount the installer image | |
hdiutil attach /Applications/Install\ OS\ X\ Yosemite.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app | |
# Convert the boot image to a sparse bundle | |
hdiutil convert /Volumes/install_app/BaseSystem.dmg -format UDSP -o /tmp/Yosemite | |
# Increase the sparse bundle capacity to accommodate the packages | |
hdiutil resize -size 8g /tmp/Yosemite.sparseimage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
std::string buffer_to_string(const boost::asio::streambuf &buffer) | |
{ | |
using boost::asio::buffers_begin; | |
auto bufs = buffer.data(); | |
std::string result(buffers_begin(bufs), buffers_begin(bufs) + buffer.size()); | |
return result; | |
} |