Skip to content

Instantly share code, notes, and snippets.

View Chilledheart's full-sized avatar
:electron:

Keeyou Chilledheart

:electron:
View GitHub Profile
@chr5tphr
chr5tphr / bwfull
Last active August 6, 2023 08:48
Bubblewrap full isolation
#!/bin/sh
BWROOT="${1:?"Root not specified!"}"
shift
env -i bwrap \
--bind "$BWROOT" / \
--unshare-user \
--unshare-cgroup \
--unshare-ipc \
--unshare-pid \
@shawnhermans
shawnhermans / create-iso.sh
Created September 23, 2015 15:58
Script I used to create a Yosemite ISO image
#!/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
@vladon
vladon / boost_asio_streambuf_to_string.cpp
Last active May 27, 2023 06:45
Returns `boost::asio::streambuf` contents represented as `std::string`
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;
}