Skip to content

Instantly share code, notes, and snippets.

View bwv988's full-sized avatar
💭
🔥

Ralph Schlosser bwv988

💭
🔥
View GitHub Profile
@bwv988
bwv988 / converting_and_merging_gopro_vids_on_linux.md
Created May 7, 2023 18:50
Converting and merging GoPro videos on Linux

Converting and merging GoPro videos on Linux

RS20230507

  1. Copy all raw videos into a folder.
  2. Install / Use Handbrake to batch-convert (queue) all videos into an output directory using an appropriate Preset, for example Fast1030p30.
  3. Once completed, use ffmpeg to concatenate all videos in the output directory into a single .mp4 file:
$ find *.mp4 -printf "file '%p'\n" | tee mp4_list.txt
$ ffmpeg -f concat -i mp4_list.txt -c copy ../gopro_merged/merged.mp4
# Add this to bash profile
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
export PS1="[\[\e[33;1;40m\]\t\[\e[0m\]][\u@\h:\[\e[37;1;40m\]\w\[\e[0m\]]\$ "
# This adds the current git branch to the PS1 string started above.
function execute_parse {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
airlinePlot = {
var myPlot = html`<div></div>`;
var trace1 = {
x: airlineData.map(function(d){
return d["Month"];
}),
y: airlineData.map(function(d){
return d["International airline passengers: monthly totals in thousands. Jan 49 ? Dec 60"];
})
@bwv988
bwv988 / docker-compose.yml
Created April 24, 2018 10:53
Docker compose file for the Kaggle Python container
version: '2'
services:
kaggle:
image: kaggle/python
container_name: kaggle
command: jupyter notebook --allow-root --no-browser --ip="0.0.0.0" --notebook-dir=/notebooks --NotebookApp.token='' --allow-root
user: root
ports:
- "8888:8888"
volumes:
x y
1 1
2 4
3 9
4 16
# Generate word clouds from R.
# RS10062015
# May need to install the below packages.
#req <- c("wordcloud", "tm")
#install.packages(req)
library(tm)
library(wordcloud)
startup_message off
vbell off
hardstatus alwayslastline
hardstatus string '%{gk}[ %{G}%H %{g}][%= %{wk}%?%-Lw%?%{=b kR}(%{W}%n*%f %t%?(%u)%?%{=b kR})%{= kw}%?%+Lw%?%?%= %{g}]%{=y C}[%d/%m %c]%{W}'
@bwv988
bwv988 / docker-cleanup-resources.md
Created February 1, 2018 15:10 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

import pandas as pd
import numpy as np
# I want to clean col2. This records equipemnts.
data = {'col1': [1, 2, 4], 'col2': ["e70", "e70 e80 ua", "b20"]}
# Create a Pandas data frame.
df = pd.DataFrame(data)
# Quick helper function to flatten a nested list.