Skip to content

Instantly share code, notes, and snippets.

@vherolf
vherolf / convert.R
Last active May 16, 2024 11:39
Convert SPSS sav to csv with R
## install haven library first.
# install.packages("haven")
#
## run with
# Rscipt convert.R
#
library("haven")
dataframe <- read_sav("input.sav")
@vherolf
vherolf / .zshrc
Last active March 4, 2024 08:57
alias for virtual env
# add to .zshrc or .bashrc
alias vnv='python3 -m venv venv --prompt . && source ./venv/bin/activate && pip install -U pip setuptools wheel pip-tootls &> /dev/null'
alias ae="source ./venv/bin/activate"
alias req="pip install -r requirements.txt"
@vherolf
vherolf / dvgrab.sh
Last active April 4, 2018 21:19
use dvgrab to archive old DV tapes to mp4
#!/bin/bash
##
## dvgrab
##
## use dvgrab to archive old DV tapes to mp4
##
dvgrab -size=0 -rewind -t mpeg2 -showstatus -timesys -autosplit=10000 dv-grabbed-video.dv
@vherolf
vherolf / ffmpeg-sidebyside.sh
Last active April 4, 2018 21:33
put videos side by side with ffmpeg with filter_complex
#!/bin/bash
##################################
## vertical 2 way sidebyside merge
##################################
ffmpeg -i 1.mp4 -i 2.mp4 -filter_complex "[0:0]pad=iw*1:ih*2[out1];[out1][1:0]overlay=x=0:y=h" -c:a copy -c:v libx264 output.mp4
####################################
## horizontal 2 way sidebyside merge
#!/bin/bash
## for cisco switches
## scan from network wall socket to find on with switch port it is connected
##
tcpdump -nn -vv ---interface=eno1 --snapshot-length=1500 -c 1 'ether[20:2] == 0x2000'