Skip to content

Instantly share code, notes, and snippets.

View yzgyyang's full-sized avatar

Guangyuan Yang yzgyyang

View GitHub Profile
diff --git a/x11-toolkits/mauikit-filebrowsing/Makefile b/x11-toolkits/mauikit-filebrowsing/Makefile
new file mode 100644
index 000000000000..d4d11d39401c
--- /dev/null
+++ b/x11-toolkits/mauikit-filebrowsing/Makefile
@@ -0,0 +1,31 @@
+# Created by: Guangyuan Yang <ygy@FreeBSD.org>
+
+PORTNAME= filebrowsing
+DISTVERSIONPREFIX= v

Understanding FreeBSD UMA from a Safety Prospective

Author: wzt @ kernsec https://mp.weixin.qq.com/s/20ACZFyQiUWZf5cIm_ZW-w
Translated by: ygy

Disclaimer: I translated this at 1 am in 15 minutes, hopefully it is still readable...

1.1 Introduction

FreeBSD's kernel object allocator is called UMA (Universal Memory Allocator). This article only discusses its security features, please refer to other articles for general functionality. Its security feature set is a lot smaller than that in XNU, NT and Linux, along with some security flaws from the design and architecture, as we will discuss below.

#!/bin/sh -e
DOC_TREE="/usr/home/guangyuan/fbrepo/freebsd-doc/zh_TW.UTF-8" #/zh_CN.UTF-8
echo "Doc tree defined as ${DOC_TREE}."
cd ${DOC_TREE}
FILES_CVT=$(ag --files-with-matches "Original [Rr]evision: r[0-9]*\s")
echo $(echo ${FILES_CVT} | wc -w) files
sudo apt update
sudo apt upgrade -y
# ubuntu: tasksel
sudo apt install kali-desktop-xfce -y
sudo apt install xrdp -y
sudo cp /etc/xrdp/xrdp.ini /etc/xrdp/xrdp.ini.bak
sudo sed -i 's/3389/3390/g' /etc/xrdp/xrdp.ini
sudo sed -i 's/max_bpp=32/#max_bpp=32\nmax_bpp=128/g' /etc/xrdp/xrdp.ini
sudo sed -i 's/xserverbpp=24/#xserverbpp=24\nxserverbpp=128/g' /etc/xrdp/xrdp.ini
sudo service xrdp start
@yzgyyang
yzgyyang / streaming_server.sh
Last active July 16, 2020 21:19
How to start a streaming service on Vultr?
# Restream is another choice
# This guide is based on:
# https://obsproject.com/forum/resources/how-to-set-up-your-own-private-rtmp-server-using-nginx.50/
sudo apt update
sudo apt upgrade -y
sudo apt install -y unzip build-essential libpcre3 libpcre3-dev libssl-dev zlib1g-dev
wget http://nginx.org/download/nginx-1.15.1.tar.gz
@yzgyyang
yzgyyang / destroy.sh
Created January 28, 2019 23:45
Docker stop and delete all
# Stop all running containers
docker stop $(docker ps -aq)
# Remove all containers
docker rm $(docker ps -aq)
# Remove all images
docker rmi $(docker images -q)
@yzgyyang
yzgyyang / build_chromium_os.sh
Last active December 1, 2022 09:20
Build Chromium OS from Ubuntu curl -fsSL URL_HERE | sh
#!/bin/sh
set -xe
sudo apt-get install git-core gitk git-gui subversion curl lvm2 thin-provisioning-tools python-pkg-resources python-virtualenv python-oauth2client
# install depot tools
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
PATH=$PATH:/path/to/depot_tools
# Making sudo a little more permissive
@yzgyyang
yzgyyang / get.sh
Last active August 20, 2018 06:50
Coala Bootstrap Script (Experimental)
#!/bin/sh
set -xe
# This script is meant for quick & easy install via:
# $ curl -fsSL URL_HERE | sh
# On FreeBSD:
# $ fetch --no-verify-peer -qo - URL_HERE | sh
get_platform() {
platform=$(uname)

Keybase proof

I hereby claim:

  • I am yzgyyang on github.
  • I am yzgyyang (https://keybase.io/yzgyyang) on keybase.
  • I have a public key ASBYJVVTj5GHRdSL8rmS7RNtYEGjvle5hbKWOeX4z2DE9Qo

To claim this, I am signing this object:

@yzgyyang
yzgyyang / gist:436d7a05716a48e748ba380783485889
Created October 31, 2017 03:11
Convert VirtualBox .vdi to VMWare .vmdk
VBoxManage list hdds
vboxmanage clonehd 846e5dbd-a88e-439e-8519-ea8aa47d7eb7 D:\Ubuntu.vmdk –format vmdk