Skip to content

Instantly share code, notes, and snippets.

View darkgeek's full-sized avatar
🎯
Focusing

Justin Yang darkgeek

🎯
Focusing
View GitHub Profile
@darkgeek
darkgeek / gist:f927765f98b0e70d594c7e99f01bab10
Created May 30, 2019 16:24
Failed to build openresty on OpenBSD
🕒 05-31 00:13:53 👉 ~/Shares/openresty-1.15.8.2rc0 $ ./configure --prefix=/home/justin/Apps/openresty --with-luajit-ldflags='-lc++abi -lpthread' <
platform: bsd (openbsd)
cp -rp bundle/ build
cd build
cd LuaJIT-2.1-20190507
INFO: found -msse4.2 in cc.
gmake TARGET_STRIP=@: CCDEBUG=-g XCFLAGS='-DLUAJIT_ENABLE_LUA52COMPAT -msse4.2' LDFLAGS='-lc++abi -lpthread' CC=cc PREFIX=/home/justin/Apps/openresty/luajit
==== Building LuaJIT 2.1.0-beta3 ====
gmake -C src
gmake[1]: Entering directory '/home/justin/Shares/openresty-1.15.8.2rc0/build/LuaJIT-2.1-20190507/src'
@darkgeek
darkgeek / PKGBUILD.patch
Created August 30, 2018 18:38
Support aarch64 for qemu-user-static
--- PKGBUILD 2018-08-31 02:30:42.954132382 +0800
+++ PKGBUILD.after 2018-08-31 02:36:12.363488755 +0800
@@ -5,7 +5,7 @@
pkgver=2.12
pkgrel=4
pkgdesc="A generic and open source processor emulator which achieves a good emulation speed by using dynamic translation, statically linked."
-arch=('i686' 'x86_64')
+arch=('i686' 'x86_64' 'aarch64')
license=('GPL2' 'LGPL2.1')
url="http://wiki.qemu.org/Index.html"
@darkgeek
darkgeek / adjust-screen-size-on-vbox
Created June 7, 2016 07:32
Adjust screen size on Virtualbox
VirtualBox supports both UGA (Universal Graphic Adapter) and GOP (Graphics Output Protocol) but FreeBSD loader uses GOP. Default GOP mode seems to be 2 (1024x768) and it panics kernel if the system memory is small.
As a stopgap, you may lower the resolution with VBoxManage, i.e.,
VBoxManage setextradata "VM name" VBoxInternal2/EfiGopMode N
where "VM name" is the name of your VM and N is from 0 to 5. For example,
VBoxManage setextradata FreeBSD VBoxInternal2/EfiGopMode 1
will lower video mode to 800x600 for your "FreeBSD" VM. Please see the manual for more information.
@darkgeek
darkgeek / fetch_ports_from_github
Created May 29, 2016 12:34
How to fetch ports tree from github
sudo git clone --depth 1 --no-single-branch https://github.com/freebsd/freebsd-ports /usr/ports
# If you only need a quartly branch, check it out:
sudo git checkout -t origin/branches/2016Q2
@darkgeek
darkgeek / gtk.css
Created May 28, 2016 18:47
How to remove black area around gtk3 apps when there's no composite enabled
# ~/.config/gtk-3.0/gtk.css
.window-frame.solid-csd {
border-radius: 0;
margin: 1px;
background-color: #eee;
box-shadow: none;
}
@darkgeek
darkgeek / openbsd_xorg_on_virtualbox
Created May 14, 2016 13:19
Better Xorg resolution for OpenBSD as a guest on Virtualbox
# Get from https://www.snip2code.com/Snippet/619307/OpenBSD-Virtualbox-guest-xorg-conf , thanks!
Section "ServerLayout"
Identifier "X.org Configured"
Screen 0 "Screen0" 0 0
InputDevice "Mouse0" "CorePointer"
InputDevice "Keyboard0" "CoreKeyboard"
EndSection
Section "Files"
ModulePath "/usr/X11R6/lib/modules"
@darkgeek
darkgeek / fsck_rootfs_freebsd
Created January 28, 2016 10:33
How to do fsck rootfs on FreeBSD
1. Go into single user mode
# shutdown now
2. Mount / as read-only:
# mount -fr /
3. Run fsck to repair UFS:
# fsck -y
4. Remount / as read-write:
@darkgeek
darkgeek / Xorg.0.log
Created January 27, 2016 16:42
Error log of startx on Debian Stretch
[ 1438.790]
X.Org X Server 1.17.3
Release Date: 2015-10-26
[ 1438.790] X Protocol Version 11, Revision 0
[ 1438.790] Build Operating System: Linux 3.16.0-4-amd64 x86_64 Debian
[ 1438.790] Current Operating System: Linux debian-darkgeek 4.3.0-1-amd64 #1 SMP Debian 4.3.3-7 (2016-01-19) x86_64
[ 1438.790] Kernel command line: BOOT_IMAGE=/vmlinuz-4.3.0-1-amd64 root=/dev/mapper/debian--darkgeek--vg-root ro quiet
[ 1438.790] Build Date: 27 October 2015 11:41:02PM
[ 1438.790] xorg-server 2:1.17.3-2 (http://www.debian.org/support)
[ 1438.790] Current version of pixman: 0.33.6
@darkgeek
darkgeek / startx_out.log
Created January 27, 2016 16:40
The errors after typing startx on console on Debian Stretch
X.Org X Server 1.17.3
Release Date: 2015-10-26
X Protocol Version 11, Revision 0
Build Operating System: Linux 3.16.0-4-amd64 x86_64 Debian
Current Operating System: Linux debian-darkgeek 4.3.0-1-amd64 #1 SMP Debian 4.3.3-7 (2016-01-19) x86_64
Kernel command line: BOOT_IMAGE=/vmlinuz-4.3.0-1-amd64 root=/dev/mapper/debian--darkgeek--vg-root ro quiet
Build Date: 27 October 2015 11:41:02PM
xorg-server 2:1.17.3-2 (http://www.debian.org/support)
Current version of pixman: 0.33.6
Before reporting problems, check http://wiki.x.org
@darkgeek
darkgeek / enable_network_on_chroot_under_android
Created January 26, 2016 18:12
Enable network connectivity in chrooted environment under Android
Add the following two lines to `/etc/group`:
inet:x:3003:root
net_raw:x:3004:root
Then, add other users to those groups.