Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh -e
# Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This file is sourced from main.sh to update distro-specific defaults.
# It must set at least ARCH and MIRROR if not already specified.
if [ -z "$ARCH" ]; then
ARCH="`uname -m | sed -e 's i.86 i386 ;s x86_64 amd64 ;s arm.* armhf ;'`"
@drinkcat
drinkcat / clipboard-test
Last active December 28, 2015 08:09
clipboard testing procedure
git 3662f3d96e438e80a474ebd0d04bca2c63aa6cd5
- Samsung ARM Chromebook, stable 4537.147.0
- precise: 12345678
- saucy: 12345
- wheezy: 12345
Testing procedure for clipboard sync:
0. (once only)
- In host-ext, run
- sh -e gencrx.sh
@drinkcat
drinkcat / gist:7998826
Created December 17, 2013 02:13
Arch mirrors
# https://www.archlinux.org/mirrorlist/?country=US&protocol=http&ip_version=4&use_mirror_status=on
export CROUTON_MIRROR_arch='http://mirrors.lax1.thegcloud.com/arch/$repo/os/$arch'
# http://archlinuxarm.org/about/mirrors
export CROUTON_MIRROR_alarm='http://ca.us.mirror.archlinuxarm.org/armv7h/$repo'
@drinkcat
drinkcat / 01 mount and dmesg errors
Last active January 1, 2016 19:49
btrfs mount fail
[root@machin ~]# uname -a
Linux machin 3.13.0-rc5-custom #1 SMP PREEMPT Thu Dec 26 11:53:39 SGT 2013 x86_64 GNU/Linux
[root@machin ~]# mount /dev/sdb3 /home
mount: wrong fs type, bad option, bad superblock on /dev/sdb3,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so.
[root@machin ~]# dmesg -c
[ 3892.863456] btrfs: device label home devid 1 transid 29333 /dev/sdb3
@drinkcat
drinkcat / test.c
Last active January 2, 2016 04:39
#include <stdio.h>
/* ARM output:
1000 / div = 10
-1000 / div = 42949662
-1000 / (long)div = -10
*/
int main() {
unsigned long div = 100;
@drinkcat
drinkcat / test.c
Last active January 2, 2016 04:39
#include <stdio.h>
/*
ARM output:
delay=45
delay=45
delay=97346
delay=-45
x86 output:
@drinkcat
drinkcat / drm-fix.patch
Last active May 14, 2018 07:48
DRM fix
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
index 4177780..bbfc071 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
@@ -170,6 +170,9 @@ static struct drm_ioctl_desc drm_ioctls[] = {
#define DRM_CORE_IOCTL_COUNT ARRAY_SIZE( drm_ioctls )
+/* Allow set/drop master ioctls as normal user */
+static u32 drm_master_relax = 0;
echo "Send signals from another console:"
echo "kill -USR1 $$"
SIG='force'
trap "SIG='USR1'" USR1
# Create a dummy FIFO. Reading the FIFO will block until interrupted by a signal
SIGFIFO="clip.fifo"
if [ ! -p "$SIGFIFO" ]; then
rm -f "$SIGFIFO"
@drinkcat
drinkcat / Xorg.1.log
Created February 20, 2014 17:08
Xorg log, precise on C720
[ 7066.401]
X.Org X Server 1.11.3
Release Date: 2011-12-16
[ 7066.402] X Protocol Version 11, Revision 0
[ 7066.402] Build Operating System: Linux 2.6.42-23-generic x86_64 Ubuntu
[ 7066.402] Current Operating System: Linux localhost 3.8.11 #1 SMP Wed Jan 29 23:31:03 PST 2014 x86_64
[ 7066.402] Kernel command line: cros_secure console= loglevel=7 init=/sbin/init cros_secure oops=panic panic=-1 root=/dev/dm-0 rootwait ro dm_verity.error_behavior=3 dm_verity.max_bios=-1 dm_verity.dev_wait=1 dm="1 vroot none ro 1,0 2097152 verity payload=PARTUUID=67be82bf-b5a2-6a49-bfda-aa142d9cb337/PARTNROFF=1 hashtree=PARTUUID=67be82bf-b5a2-6a49-bfda-aa142d9cb337/PARTNROFF=1 hashstart=2097152 alg=sha1 root_hexdigest=f7d8ec0d0c9f9b58cac161fa9707cefed2593e66 salt=c1076dcdf8200314877740fef74339266fbdf60b93e0907492df7d6414c3dafc" noinitrd vt.global_cursor_default=0 kern_guid=67be82bf-b5a2-6a49-bfda-aa142d9cb337 add_efi_memmap boot=local noresume noswap i915.modeset=1 tpm_tis.force=1 tpm_tis.interrupts=0 nmi_watchdog=panic,lap
@drinkcat
drinkcat / testsig.sh
Last active August 29, 2015 13:59
Test if kernel is signed
verifykernelsig() {
dev_debug_vboot -c -i "`rootdev -s -d`" | tee /tmp/dev_debug_vboot
echo "Checking output:"
cat /tmp/dev_debug_vboot | mawk '
!/^ / {
label = ""
}
/^Kernel / {
sub(/:$/, "", $2)
( "blkid -o value -s PARTLABEL " $2) | getline label