Sunday, March 24, 2019

Play with the cyphr package

The cyphr package seems to provide a good choice for small research group that shares sensitive data over internet (e.g., DropBox). I did some simple experiment myself and made sure it can actually serve my purpose.

I did my experiment on two computers (using openssl): I created the test data on my Linux workstation running Manjaro then I tried to access the data on a Windows 7 laptop.

For creating the data (Linux workstation):

library(cyphr)

# Create the test data

data_dir <- file.path("~/Dropbox/temp_files", "data")
dir.create(data_dir)
dir(data_dir)

# Encrypt the test data

cyphr::data_admin_init(data_dir)

key <- cyphr::data_key(data_dir)


filename <- file.path(data_dir, "iris.rds")

cyphr::encrypt(saveRDS(iris, filename), key)
dir(data_dir)

# Cannot read the data without decrypting it first

readRDS(filename)

# Read the decrypted version of the data

head(cyphr::decrypt(readRDS(filename), key))

For accessing the data (Windows laptop):

library(cyphr)

key <- data_key("C:/Users/Ssong/Dropbox/temp_files/data", path_user = "C:/Users/Ssong/.ssh")


# Make data access request

data_request_access("C:/Users/Ssong/Dropbox/temp_files/data", 
path_user = "C:/Users/Ssong/.ssh")

On Windows 7,  the system cannot locate the public located in "~/.ssh", which is pretty dumb.

Going back to the Linux workstation to approve the data access request:

# Review the request and approve (to share with other users)
req <- data_admin_list_requests(data_dir)
data_admin_authorise(data_dir, yes = TRUE)
data_admin_list_keys(data_dir)

Now I can access the data on my Windows laptop:

key <- data_key("C:/Users/Ssong/Dropbox/temp_files/data", path_user = "C:/Users/Ssong/.ssh")

d <- decrypt( readRDS( "C:/Users/Ssong/Dropbox/temp_files/data/iris.rds"), key)



Monday, February 18, 2019

‘Meta’ machine learning packages in R

Instead of using multiple packages for different machine learning tasks, it is now possible to use one of those meta packages to do (almost) all of them.

Wednesday, February 06, 2019

Thursday, January 31, 2019

How GPL makes me leave R for Python

Informative post, especially David's response.

Monday, December 03, 2018

The new 4.19 kernel is causing trouble

A "kworker" process is hogging my CPU. I have to go back to 4.18 kernel to resolve this issue.

UPDATE (01/24/2019)

The solution is amazingly simple. Follow this post:

  1. Install perf;
  2. sudo perf record -g -a sleep 10
  3. sudo perf report
Scrolling down the records, it looks like the problem is related to my USB hub. Unplug the hub and the problem goes away. 

Saturday, December 01, 2018

Thursday, November 29, 2018

Saturday, November 24, 2018

Counter