Skip to content

Instantly share code, notes, and snippets.

View buszk's full-sized avatar

Zekun Shen buszk

  • NY
View GitHub Profile

Turn on Bluetooth on mobile device and run bluetooth scan on raspberry pi.

hcitool scan
hcitool cc <BT MAC>
hcitool auth <BT MAC>

Create the following script and add it to /etc/rc.local.

#!/bin/bash
#!/bin/sh
sudo apt update && sudo apt upgrade
sudo apt install -y vim dnsmasq netatalk hfsplus hfsutils hfsprogs gdisk
@buszk
buszk / signext.c
Created July 31, 2020 17:37
Signed integer extension with number of bytes
int64_t signext(uint64_t val, uint64_t bytes) {
uint64_t bits = 8 * bytes;
uint64_t bitmask = (1 << bits) - 1;
uint64_t value = bitmask & val;
uint64_t mask = 1 << (bits-1);
if (mask & val) {
value |= ((uint64_t)-1) ^ bitmask;
}
return value;
}

Keybase proof

I hereby claim:

  • I am buszk on github.
  • I am bruceshenzk (https://keybase.io/bruceshenzk) on keybase.
  • I have a public key ASBEjjtDRKf5acknlT1ZDS8su49s8u6hjxaswyhYPkQ4-go

To claim this, I am signing this object:

@buszk
buszk / llvm-3.3-intall.sh
Created September 20, 2017 18:47
Script to intall llvm and clang on giant-panda.
wget -nc http://llvm.org/releases/3.3/cfe-3.3.src.tar.gz
wget -nc http://llvm.org/releases/3.3/llvm-3.3.src.tar.gz
rm -rf llvm
mkdir -p llvm
tar xfz llvm-3.3.src.tar.gz -C llvm --strip-components=1
mkdir -p llvm/tools/clang
tar xfz cfe-3.3.src.tar.gz -C llvm/tools/clang --strip-components=1
mkdir -p build
cd build

Keybase proof

I hereby claim:

  • I am bruceshenzk on github.
  • I am bruceshenzk (https://keybase.io/bruceshenzk) on keybase.
  • I have a public key ASBEjjtDRKf5acknlT1ZDS8su49s8u6hjxaswyhYPkQ4-go

To claim this, I am signing this object: