Skip to content

Instantly share code, notes, and snippets.

Lars Vilhuber larsvilhuber

Block or report user

Report or block larsvilhuber

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View myOpenMPI.qsub
#!/bin/bash -l
# Output (log) and errors will go into the system-defined stdout file
#PBS -j oe
##############################################################################
# Based on http://csc.cnsi.ucsb.edu/docs/running-jobs-torque
# IMPORTANT: the next line determines how many nodes to run on
# nodes is number of nodes, ppn= processors (cores) per node
#
#PBS -l nodes=2:ppn=32
#
@larsvilhuber
larsvilhuber / SR-test.tex
Created Sep 6, 2016
Code that seems to flumox StatRep package.
View SR-test.tex
\begin{Sascode}[store=mytest,program]
%macro main;
data one;
do j=1 to 10;
%do i = 1 %to 70;
var&i. = &i.;
%end;
output;
end;
run;
@larsvilhuber
larsvilhuber / mirror.repec.sh
Created Sep 30, 2016
Mirroring of Stata packages from Repec
View mirror.repec.sh
#!/bin/bash
SRCURL=http://fmwww.bc.edu/repec/bocode/
if [[ -z $1 ]]
then
cat << EOF
$0 start
mirror $SRCURL to this directory
@larsvilhuber
larsvilhuber / jupyter.qsub
Created Nov 11, 2016
Qsub file to run a jupyter notebook instance
View jupyter.qsub
#!/bin/bash -l
#PBS -l walltime=01:00:00
#PBS -l ncpus=1
#PBS -N jupyter
source /etc/profile.d/modules.sh
module load python/anaconda
hostname
jupyter notebook
@larsvilhuber
larsvilhuber / sds_initialize.do
Last active Aug 10, 2017
Work with REPEC mirror on SDSx
View sds_initialize.do
/* set the local install versions to the project directory */
/* this will ensure that the project directory contains a local copy */
/* Ensure the directories exist! */
global PROJDIR "/projects/user/xyz/project1"
sysdir set PLUS "${PROJDIR}/stata/plus"
sysdir set PERSONAL "${PROJDIR}/stata/personal"
/* from https://www2.vrdc.cornell.edu/news/synthetic-data-server/step-4-using-the-sds/#Packages
and https://gist.github.com/larsvilhuber/002ffc7fa96136426a4801e1470e0189#file-sds_initialize-do */
@larsvilhuber
larsvilhuber / sds_initialize.R
Last active Aug 24, 2017
Work with CRAN mirror on SDS
View sds_initialize.R
CRAN_base <- "file:/cac/contrib/mirror/CRAN/" # location of the local CRAN mirror - this will be different at validation!
# set CRAN base, ensuring that install.packages() can find its files
mypackages <- c("xyz","abc")
local({
r <- getOption("repos")
r["CRAN"] <- CRAN_base
options(repos = r)
})
install.packages(mypackages)
@larsvilhuber
larsvilhuber / gist:77eba9016504bedbede51dd6683aa573
Created Oct 26, 2017
OJS3 import with href submission file
View gist:77eba9016504bedbede51dd6683aa573
<?xml version="1.0"?>
<issue xmlns="http://pkp.sfu.ca" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" published="1" current="1" access_status="1" xsi:schemaLocation="http://pkp.sfu.ca native.xsd">
<id type="internal" advice="ignore">1</id>
<issue_identification>
<volume>1</volume>
<number>10</number>
<year>2009</year>
<title locale="en_US">Old Issue</title>
</issue_identification>
<date_published>2009-01-01</date_published>
@larsvilhuber
larsvilhuber / etoggle.tex
Created Dec 15, 2017
Use of toggle in latex
View etoggle.tex
\usepackage{etoolbox}
\newtoggle{final}
\newtoggle{blind}
%\togglefalse{final}
\toggletrue{final}
%\toggletrue{blind}
\togglefalse{blind}
@larsvilhuber
larsvilhuber / convert_bepress_metadata.py
Last active Feb 26, 2018
Script to convert CSV to OJS metadata format (approximately Bepress import from non-standard metadata)
View convert_bepress_metadata.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Dec 17 11:40:28 2017
@author: vilhuber
"""
# Replaced by https://github.com/journalprivacyconfidentiality/jpc-migration/releases/tag/1.0
@larsvilhuber
larsvilhuber / gitcreate.sh
Created Mar 26, 2018 — forked from robwierzbowski/gitcreate.sh
A simple litte script. Create and push to a new github repo from the command line.
View gitcreate.sh
#!/bin/bash
# https://gist.github.com/robwierzbowski/5430952/
# Create and push to a new github repo from the command line.
# Grabs sensible defaults from the containing folder and `.gitconfig`.
# Refinements welcome.
# Gather constant vars
CURRENTDIR=${PWD##*/}
GITHUBUSER=$(git config github.user)
You can’t perform that action at this time.