Skip to content

Instantly share code, notes, and snippets.

free21

Polyglot code to print "FREE " 21 times in both (obfuscated) C and brainf*ck. The C version prints an additional newline character at the end.

/****************************************************************************/

          /****[****/
        #define x  0x0a
      #define o   putchar
@evanlinde
evanlinde / rstudio-who.sh
Created October 7, 2019 17:41
Show running RStudio Server sessions
#!/bin/bash
#
# Print basic info about running RStudio Server sessions
#
# Requires root/sudo for accurate output.
# Does not include info about suspended sessions (i.e. where no rsession
# process is currently running).
# Start time is when the rsession process started; if session was previously
# suspended and relaunched, this will be the the relaunch time.
#
@evanlinde
evanlinde / mbox2gg.py
Last active January 27, 2024 00:37 — forked from pecigonzalo/mbox2gg.py
mbox to Google Groups
#
# Import an mbox file into Google Groups using the Groups Migration API
#
# To run this script, you will need to:
# 1. Be an admin on your domain
# 2. Enable API access in your domain
# 3. Create a project on the developer console
# 4. Activate the Groups Migration API for the project
# 5. Create an OAuth Client ID and Secret for the project
# 6. Install the google-api-python-client and google-auth-oauthlib

Analyzing the XSEDE Campus Champions List Archive

Prepare the data

There are mbox files for each month named in %Y-%m format (e.g. 2017-12). Most are uncompressed and have no extension but a few are gzipped and have a .gz extension.

Remove the gzip files that are duplicates of uncompressed files.

@evanlinde
evanlinde / asciiart.cmd
Created December 23, 2015 17:27
batch file to display self-contained ASCII art
::
:: Display an ASCII Art image defined in this file.
::
:: ASCII Art images are declared with a line like "::IMAGE:name::" where
:: the name may contain letters, numbers, and the characters '_' and '-'.
:: Lines beginning with ":::name:::" define the image.
::
@echo off
:: Display usage info, including available images, if no argument is given.
@evanlinde
evanlinde / readSetting.R
Created December 23, 2015 14:45
R function to read variable definition from a bash script
readSetting <- function(setting_name, file){
# Settings appear in the file in the form of
# SETTING_NAME="SETTING_VALUE"
# with no leading whitespace characters.
setting_begin <- paste0("^", setting_name, "=\"")
setting_end <- "\" *$"
setting_line <- grep(setting_begin, readLines(file), value=TRUE)
setting_value <- gsub(setting_end, "", gsub(setting_begin, "", setting_line, fixed=FALSE), fixed=FALSE)
return(setting_value)
}