Skip to content

Instantly share code, notes, and snippets.

@show0k
show0k / README.md
Last active November 20, 2016 17:49
Fix DXF issues on onshape export

Assorted tools needed when dealing with e.g. Onshape DXF exports.

Example usage to batch fix all .dxf files in a directory:

cd directory_with_dxf_files pip install ezdxf mkdir output for f in ls *.dxf; do python convert_onshape_dxf.py -i $f -o output/$f; done;

@show0k
show0k / incremental_backup_maya.py
Last active October 5, 2016 22:06
Custom incremental backup for maya. It creates an OLD directory and copy the working file in this directory and increment it version number.
import os
import re
import glob
from shutil import copyfile
import maya.cmds as cmds
BACKUP_NAME = "OLD"
full_filename_uri = cmds.file(save=True, type='mayaAscii')
filename = os.path.basename(full_filename_uri)
@show0k
show0k / boards_benchmark.ipynb
Last active March 31, 2016 11:37
Sysbench on Odroid U3 Odroid XU4 Raspberry Pi2 Raspberry Pi3 and i7-5557U laptop
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/usr/bin/env python
"""
build_conda_packages.py creates conda packages for the specified recipe for all operating systems and python versions.
Usage:
anaconda login --user USER --password PASSWORD
python build_conda_packages.py ANACONDA_USER --destination-path conda_recipe/build/ --recipe-path conda_recipe/
where:
@show0k
show0k / .bash_profile
Last active March 6, 2016 20:18
My bash profile, with some hints for OSX
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@show0k
show0k / mesh_decimation.bash
Created December 9, 2015 06:48
Clean STL for 3D simulator
#!/bin/bash
# Delete 80% of meshes
# you need to install meshlab before :
# -> sudo apt-get install meshlab on Debian
# -> brew install meshlab on OSX
for f in `ls *.STL`; do
echo $f
meshlabserver -i "$f" -s script.mlx -o "$f"
done
@show0k
show0k / ffmpeg.bash
Created November 25, 2015 12:43
Ffmpeg scripts
# encode a MTS (from a Canon photo camera video file) to an Avi
ffmpeg -i file.mts -acodec copy -vcodec libx264 -crf 21 -r 30000/1001 -deinterlace -y -threads 0 file.avi
@show0k
show0k / clean_files_for_windows.bash
Last active August 29, 2015 14:24
Clean files for windows (remove illegal characters)
find . -name "*[<>:\\|?*]*" -exec bash -c 'x="{}"; y=$(sed "s/[<>:\\|?*]\+/-/g" <<< "$x") && mv "$x" "$y" && echo "change $x to $y"' \;
@show0k
show0k / rsync_backup.sh
Last active August 29, 2015 14:24
backup to a remote shell with Rsync (keep rights and dates to files, can be rexecuted if trasnfer failed)
rsync -arzvvPh dir/to/backup user@host.local:/remote/dir
# you can use also -files-from=to_be_backuped.txt with a list of directories
@show0k
show0k / reveal.html
Created July 2, 2015 14:50
include a video in reveal.js
<center>
<video autoplay="true" loop="true" muted="true" width="640">
<source src="https://s3.amazonaws.com/orm-atlas-media/atlas-jupyter/edit-with-atlas.mp4" type="video/mp4"> Your browser does not support the video tag.
</video>
</center>