Skip to content

Instantly share code, notes, and snippets.

@tylerlindell
tylerlindell / reduce_faces.py
Last active October 24, 2022 16:52
script for reducing faces programmatically with Meshlab's api
#!/usr/bin/env python
import sys
import os
import subprocess
# Script taken from doing the needed operation
# (Filters > Remeshing, Simplification and Reconstruction >
# Quadric Edge Collapse Decimation, with parameters:
# 0.9 percentage reduction (10%), 0.3 Quality threshold (70%)
@martinvirtel
martinvirtel / krpano-to-marzipano.config
Last active May 2, 2023 19:28
Generate tile files for marzipano.net panorama viewer with krpanotools from krpano.com
# Generate tile files that can be used with https://www.marzipano.net
# This is a config file for https://krpano.com/tools/kmakemultires/config/ -
flash=false
html=false
xml=false
panotype=autodetect
tilesize=512
#!/bin/bash
{
filename="$1"
user="pi"
host="octopi.local"
destination="~/.octoprint/uploads"
bandwidth_limit="1000" # prevents stalling on large files; kbit/s
@sticilface
sticilface / PROGMEM.md
Last active July 23, 2023 11:38
PROGMEM

Guide to PROGMEM on ESP8266 and Arduino IDE

Intro

On low memory devices like the arduino and esp8266 you do not want strings to be stored in RAM. This occurs by default on these systems. Declare a string const char * xyz = "this is a string" and it will use up RAM.

The solution on these devices is to allow strings to be stored in read only memory, in Arduino this is the PROGMEM macro. Most of my experience is with the ESP8266 which is a 32bit micros controller. This device stores PROGMEM data in flash. The macro PROGMEM on ESP8266 is simply

#define PROGMEM   ICACHE_RODATA_ATTR
@yuikns
yuikns / vsftpd.conf
Last active November 20, 2022 08:12
Example config file /etc/vsftpd/vsftpd.conf
# Example config file /etc/vsftpd/vsftpd.conf
#
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
# Please see vsftpd.conf.5 for all compiled in defaults.
#
# READ THIS: This example file is NOT an exhaustive list of vsftpd options.
# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
# capabilities.
#
@Brainiarc7
Brainiarc7 / ffmpeg-gnu-parallel-snippets.md
Last active April 17, 2024 10:33
Some snippets you can quickly adapt for use with FFmpeg and GNU Parallel for use for standard tasks.

Useful Examples of ffmpeg and GNU parallel on the command-line:

Transcoding FLAC music to Opus:

ffmpeg is a highly useful application for converting music and videos. However, audio transcoding is limited to a a single core. If you have a large FLAC archive and you wanted to compress it into the efficient Opus codec, it would take forever with the fastest processor to complete, unless you were to take advantage of all cores in your CPU.

parallel 'ffmpeg -v 0 -i "{}" -c:a libopus -b:a 128k "{.}.opus"' ::: $(find -type f -name '*.flac')

Transcoding Videos to VP9:

@nadavmatalon
nadavmatalon / mapf.ino
Created October 12, 2016 15:13
ARDUINO: MAP FLOAT FUNCTION
double mapf(double val, double in_min, double in_max, double out_min, double out_max) {
return (val - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}
@arteezy
arteezy / puma.service
Last active April 11, 2024 20:17
Manage Puma with systemd and rbenv
[Unit]
Description=Puma Rails Server
After=network.target
[Service]
Type=simple
User=deploy
WorkingDirectory=/home/deploy/app/current
ExecStart=/home/deploy/.rbenv/bin/rbenv exec bundle exec puma -C /home/deploy/app/shared/config/puma.rb
ExecStop=/home/deploy/.rbenv/bin/rbenv exec bundle exec pumactl -S /home/deploy/app/shared/tmp/pids/puma.state stop
@namndev
namndev / Vagrantfile
Last active March 2, 2017 04:36
Xenial vagrant (ubuntu 16.04)
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/xenial64"
config.vm.hostname = "ubuntu-xenial"
config.vm.network "public_network", ip: "192.168.0.131"
config.vm.synced_folder "/Volumes/Data/Shares", "/home/ubuntu/Shares", create: true
config.vm.provider "virtualbox" do |vb|
vb.name = "ubuntu-xenial64"
mkdir work
# Generate the project file. Note -f, the hFOV of 81.27 degrees
pto_gen *.JPG -o work/project.pto -f 81.27
# Find the control points between the images - what to align with
cpfind --fullscale --multirow -o work/cpPoints.pto work/project.pto
# Remove junk control points from the sky
celeste_standalone -i work/cpPoints.pto -o work/cpPointsCleaned.pto -d ~/Dropbox/DRONE/data/celeste.model