#' Current system host name
#' @description Return hostname.
#' @export
hostname <- function(){
system('hostname',intern = TRUE)
}
#' Current host IP address
#' @description Return the IPv4 address.
#' @export
ipaddress <- function(){
system('ip addr',intern = TRUE) %>%
{
.[str_detect(.,'inet') | str_detect(.,'<BROADCAST')]
} %>%
{
.[which(str_detect(.,'<BROADCAST')) + 1]
} %>%
stringr::str_split_fixed('/',2) %>%
.[,1] %>%
str_remove_all('inet') %>%
str_remove_all(' ')
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.