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 / build_redshift_on_freebsd_10.2
Created January 11, 2016 18:15
Build Redshift on FreeBSD 10.2
1 sudo pkg install autoconf devel/py-xdg x11-toolkits/py-gtk2 intltool libtool automake
2 Remove `#include <alloca.h>` line in `src/gamma-drm.c`
3 Follow official guide as normal
# Suppose we have this history:
$ git log --oneline
2750b94 Finally fix bug #84.
da52aaa Fix bug #84.
31f5476 Fixing bug #84.
# We enter rebasing with:
git rebase --interactive HEAD~3
# HEAD~3 says from HEAD include 3 commits
@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.
@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 / 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 / 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 / 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 / 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 / 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 / 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.