Skip to content

Instantly share code, notes, and snippets.

View royge's full-sized avatar
👨‍💻
...

Roy E royge

👨‍💻
...
  • Cebu, Philippines
View GitHub Profile
@royge
royge / gist:67728bf62da93d9dc0d871f5bbd53969
Created December 6, 2023 07:19 — forked from mberman84/gist:e3418c826306e614e04affde49abcc79
LLaVA Install (RunPod OR Linux/WSL)
git clone https://github.com/haotian-liu/LLaVA.git
cd LLaVA
pip install --upgrade pip
pip install torch
pip install -e .
# for runpod: edit pod to have port 3000 and 100GB of temporary storage
python3 -m llava.serve.controller --host 0.0.0.0 --port 10000
# open new terminal, keep previous one open
python -m llava.serve.model_worker --host 0.0.0.0 --controller http://localhost:10000 --port 40000 --worker http://localhost:40000 --model-path liuhaotian/llava-v1.5-13b
# open new terminal, keep previous one open
@royge
royge / checkenv.go
Created July 30, 2020 10:00
Check required environment variables in running tests.
package checkenv
import (
"os"
"testing"
)
func CheckEnvs(t *testing.T, envs ...string) {
t.Helper()

Keybase proof

I hereby claim:

  • I am royge on github.
  • I am roye (https://keybase.io/roye) on keybase.
  • I have a public key ASBQIpj-UhA8sTeDn6lcSBwtrC7KveGtk0xcVBwxCCZcfwo

To claim this, I am signing this object:

@royge
royge / android_instructions.md
Last active January 6, 2019 06:22 — forked from patrickhammond/android_instructions.md
Easily setup an Android development environment on a Mac

Here is a high level overview for what you need to do to get most of an Android environment setup and maintained.

Prerequisites (for Homebrew at a minimum, lots of other tools need these too):

  • XCode is installed (via the App Store)
  • XCode command line tools are installed (xcode-select --install will prompt up a dialog)
  • Java

Install Homebrew:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

@royge
royge / vault-aws-secrets-rc
Created November 21, 2018 02:00
Get new vault AWS dynamic secrets and set environment variables.
# Vault config
export VAULT_ADDR=http://127.0.0.1:8200
export VAULT_TOKEN=<your-vault-token>
TMP_FILE=$(mktemp)
# Get new credentials
vault read aws/creds/admin > $TMP_FILE
# Extract from the output.
@royge
royge / go1.0-vs-go1.11.txt
Created October 8, 2018 00:15 — forked from davecheney/go1.0-vs-go1.11.txt
test/bench/go1 benchmark results
name old time/op new time/op delta
BinaryTree17 5.44s ± 2% 3.27s ± 2% -39.90% (p=0.000 n=20+19)
Fannkuch11 4.95s ± 2% 2.68s ± 2% -45.87% (p=0.000 n=20+20)
FmtFprintfEmpty 142ns ± 2% 49ns ± 3% -65.39% (p=0.000 n=20+18)
FmtFprintfFloat 765ns ± 2% 260ns ± 2% -66.02% (p=0.000 n=20+20)
FmtFprintfInt 341ns ± 2% 95ns ± 2% -72.08% (p=0.000 n=19+20)
FmtFprintfIntInt 554ns ± 2% 150ns ± 1% -72.95% (p=0.000 n=20+19)
FmtFprintfPrefixedInt 497ns ± 3% 178ns ± 3% -64.12% (p=0.000 n=20+20)
FmtFprintfString 466ns ± 2% 86ns ± 3% -81.54% (p=0.000 n=20+20)
FmtManyArgs 2.23µs ± 2% 0.59µs ± 1% -73.46% (p=0.000 n=20+17)
@royge
royge / myip.go
Created January 27, 2018 13:09 — forked from jniltinho/myip.go
Get My IP Golang
package main
/*
URL: https://github.com/mccoyst/myip/blob/master/myip.go
URL: http://changsijay.com/2013/07/28/golang-get-ip-address/
*/
import (
"net"
"os"
@royge
royge / macaddr.go
Created January 27, 2018 13:07
a simple example of how to grab a mac address in Golang.
// getMacAddr gets the MAC hardware
// address of the host machine
func getMacAddr() (addr string) {
interfaces, err := net.Interfaces()
if err == nil {
for _, i := range interfaces {
if i.Flags&net.FlagUp != 0 && bytes.Compare(i.HardwareAddr, nil) != 0 {
// Don't use random as we have a real address
addr = i.HardwareAddr.String()
break
@royge
royge / nginx-osx-install.sh
Created June 29, 2017 02:30
Mac OS X nginx installation from source
# download PCRE and nginx source
sudo mkdir -p /usr/local/src
cd /usr/local/src
# copy PCRE to directory
# eg. cp /tmp/pcre-8.20.tar.gz /usr/local/src/
tar xzvf pcre-8.20.tar.gz
cd pcre-8.20
./configure --prefix=/usr/local
make && sudo make install && make clean
@royge
royge / irq_balance_habrahabr.sh
Created October 24, 2016 08:13 — forked from pavel-odintsov/irq_balance_habrahabr.sh
irq_balance_habrahabr.sh
#!/bin/bash
# from http://habrahabr.ru/post/108240/
ncpus=`grep -ciw ^processor /proc/cpuinfo`
test "$ncpus" -gt 1 || exit 1
n=0
for irq in `cat /proc/interrupts | grep eth | awk '{print $1}' | sed s/\://g`
do
f="/proc/irq/$irq/smp_affinity"