Skip to content

Instantly share code, notes, and snippets.

View abnova's full-sized avatar

Aleksandr Blekh abnova

View GitHub Profile
results <- "3628:Access Grid:http://www.accessgrid.org/:1:A:accessgrid:accessgrid.sourceforge.net:The Access Grid (AG) is the ensemble of resources that can be used to support human interaction across the grid. It consists of multimedia display, presentation and interactions environments, and high-quality audio.:other:953140832:1:0:1:0:1:6:http://mailto:accessgrid-tech@lists.sourceforge.net:10:1:0:0:1::::::1343793057:1:0::0:0:"
@abnova
abnova / SysUpdate
Last active August 29, 2015 14:02
Commands to recover the server after data loss
# Misc.
sudo dpkg-reconfigure tzdata
sudo /etc/init.d/datadog-agent stop
# Update the system
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo apt-get autoremove
@abnova
abnova / MyQuoraA1_VC_AvgRoundSize
Created July 6, 2014 11:50
R code to create plot for my Quora answer on VC average round size dynamics for 2008-2013
if (!suppressMessages(require(ggplot2))) install.packages('ggplot2')
library(ggplot2)
seriesA <- data.frame(
year = c(2008, 2009, 2010, 2011, 2012, 2013),
avgRoundSize = c(3.6, 4.6, 4.1, 2.4, 2.8, 4.4)
)
seriesB <- data.frame(
year = c(2008, 2009, 2010, 2011, 2012, 2013),
@abnova
abnova / loadRDataDir
Created July 8, 2014 07:27
An attempt to load data from all RData files in a specified directory into a single data table
library(data.table)
fileList <- list.files("../cache/FLOSSmole", pattern="\\.RData$", full.names=TRUE)
dataset <- rbindlist(lapply(fileList, FUN=function(file) {as.data.table(load(file))}))
@abnova
abnova / rds2rda.R
Last active August 29, 2015 14:05
Utility that converts indicator-named RDS files into a single RDA file with correspondingly named objects.
rm(list=ls(all=TRUE)) # Clear R environment from previous sessions
rds2rda <- function(dataDir = ".", archiveFile = "mergeTestData.rda") {
workDir <- getwd() # save working directory
setwd(dataDir) # set new working directory
objects <- list()
for (file in dir(pattern='\\.rds$')) {
@abnova
abnova / checkDataRDS.R
Last active August 29, 2015 14:05
Quick check of data stored in current directory's RDS files
a <- dir()
lapply(seq_along(a), function(i) head(readRDS(a[i]), 20))
lapply(seq_along(a), function(i) tail(readRDS(a[i]), 20))
@abnova
abnova / latex.sh
Last active August 29, 2015 14:05
LaTeX-related
export TEXINPUTS=".:path/to/image:other/path:"
#export TEXINPUTS=~/diss-floss/figures//:~/diss-floss/present/images//:${TEXINPUTS}
@abnova
abnova / gist:70821f5bf1386b986fe1
Created August 18, 2014 09:24
Contents of the "demo-slides.log" file
This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013/Debian) (format=pdflatex 2014.8.10) 18 AUG 2014 05:17
entering extended mode
restricted \write18 enabled.
%&-line parsing enabled.
**demo-slides
(./demo-slides.tex
LaTeX2e <2011/06/27>
Babel <3.9h> and hyphenation patterns for 2 languages loaded.
(/usr/share/texmf/tex/latex/beamer/base/beamer.cls
(/usr/share/texmf/tex/latex/beamer/base/beamerbasercs.sty
@abnova
abnova / word2tex.sh
Created August 19, 2014 03:43
A template for a shell script for converting an MS-Word document to a TeX document
# Reproducible process to convert a Microsoft Word document into a TEX document
#
# (Currently under development; partially based on information in the following discussion:
# http://tex.stackexchange.com/questions/46015/converting-ms-word-doc-to-latex-by-command-line)
#
# Step 1. Save Word file as ODT
#
# Step 2. Install or verify installation of Writer2LaTeX (TODO: automate)
# (http://writer2latex.sourceforge.net/)
#
@abnova
abnova / find_big_files.sh
Created September 15, 2014 04:36
Unix: Find files with size greater than 10MB and print them with size in bytes in a descending order (my version)
sudo find / -size +10M -printf "%k %p\n" 2>&1 | sort -k 1 -g -r | grep -v "No such file"