Skip to content

Instantly share code, notes, and snippets.

@randy3k
randy3k / sony.txt
Created November 5, 2022 05:01
a list of sony tv supported key
list of available commands: PowerOff, Input, GGuide, EPG, Favorites, Display, Home, Options, Return, Up, Down, Right, Left, Confirm, Red, Green, Yellow, Blue, Num1, Num2, Num3, Num4, Num5, Num6, Num7, Num8, Num9, Num0, Num11, Num12, VolumeUp, VolumeDown, Mute, ChannelUp, ChannelDown, SubTitle, ClosedCaption, Enter, DOT, Analog, Teletext, Exit, Analog2, *AD, Digital, Analog?, BS, CS, BSCS, Ddata, PicOff, Tv_Radio, Theater, SEN, InternetWidgets, InternetVideo, Netflix, SceneSelect, Mode3D, iManual, Audio, Wide, Jump, PAP, MyEPG, ProgramDescription, WriteChapter, TrackID, TenKey, AppliCast, acTVila, DeleteVideo, PhotoFrame, TvPause, KeyPad, Media, SyncMenu, Forward, Play, Rewind, Prev, Stop, Next, Rec, Pause, Eject, FlashPlus, FlashMinus, TopMenu, PopUpMenu, RakurakuStart, OneTouchTimeRec, OneTouchView, OneTouchRec, OneTouchStop, DUX, FootballMode, Social
@randy3k
randy3k / fifo.R
Created December 5, 2021 10:34
R fifo example
tf <- tempfile()
f <- fifo(tf, "w+b", blocking = TRUE)
p <- callr::r_bg(function(tf) {
f <- fifo(tf, "wb", blocking = TRUE)
x <- rnorm(1e6)
b <- serialize(x, NULL)
writeBin(length(b), f)
writeBin(b, f)
close(f)
@randy3k
randy3k / docker-compose.yaml
Last active August 27, 2021 18:18
docker compose file for wireguard
# to show qr
# docker exec -it wireguard /app/show-peer 1
version: "2.1"
services:
wireguard:
image: linuxserver/wireguard
container_name: wireguard
cap_add:
- NET_ADMIN
- SYS_MODULE
@randy3k
randy3k / octopi
Last active June 9, 2024 12:02
octopi/octoprint config for nginx proxy manager
location ~ ^/webcam/(.*) {
rewrite ^/webcam/(.*) /octopi/webcam/$1 redirect;
}
location /octopi/ {
if ($scheme != "https") {
rewrite ^ https://$host$uri permanent;
}
rewrite ^/octopi/(.*)$ /$1 break;
proxy_pass http://192.168.0.167;
@randy3k
randy3k / num_rows_csv.R
Created June 5, 2020 19:20 — forked from peterhurford/num_rows_csv.R
What's the fastest way to determine the number of rows of a CSV in R?
# What's the fastest way to determine the number of rows of a CSV in R?
# ...Reading the entire CSV to only get the dimensions is likely too slow. Is there a faster way?
# Benchmarks done on a EC2 r3.8xlarge
# Cowritten with Abel Castillo <github.com/abelcastilloavant>
m <- 1000000
d <- data.frame(id = seq(m), a = rnorm(m), b = runif(m))
dim(d)
# [1] 1000000 3
pryr::object_size(d)
@randy3k
randy3k / # rstudio-server - 2020-06-03_00-37-06.txt
Created June 3, 2020 01:04
rstudio-server (rstudio-server) on Ubuntu 16.04.6 LTS - Homebrew build logs
Homebrew build logs for rstudio-server on Ubuntu 16.04.6 LTS
Build date: 2020-06-03 00:37:06
@randy3k
randy3k / # boost-rstudio-server - 2020-06-02_18-07-27.txt
Created June 2, 2020 23:41
boost-rstudio-server (boost-rstudio-server) on Ubuntu 20.04 LTS - Homebrew build logs
Homebrew build logs for boost-rstudio-server on Ubuntu 20.04 LTS
Build date: 2020-06-02 18:07:27
@randy3k
randy3k / # rstudio-server - 2020-06-02_22-36-55.txt
Created June 2, 2020 22:55
rstudio-server (rstudio-server) on Ubuntu 20.04 LTS - Homebrew build logs
Homebrew build logs for rstudio-server on Ubuntu 20.04 LTS
Build date: 2020-06-02 22:36:55
@randy3k
randy3k / server.R
Created April 6, 2020 23:11
preview private github repo
library(httpuv)
library(httr)
library(stringr)
app <- list(
call = function(req) {
paths <- str_split(req$PATH_INFO, "/")[[1]]
owner <- paths[2]
repo <- paths[3]
path <- str_c(paths[4:length(paths)])
@randy3k
randy3k / launcher.cc.diff
Created February 14, 2020 04:46 — forked from talonsensei/launcher.cc.diff
Diff of launcher.cc from shiny-server showing the changes necessary to make it work on OS X. From https://github.com/nathanweeks/shiny-server/commit/d5240ef6d795dafc89c74a49d6f14d7fe0509541
@@ -1,1 +1,1 @@
/*
* launcher.cc
*
* Copyright (C) 2009-13 by RStudio, Inc.
*
* This program is licensed to you under the terms of version 3 of the
* GNU Affero General Public License. This program is distributed WITHOUT
* ANY EXPRESS OR IMPLIED WARRANTY, INCLUDING THOSE OF NON-INFRINGEMENT,
* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Please refer to the