Skip to content

Instantly share code, notes, and snippets.

View andreanidouglas's full-sized avatar
🎯
data in the morning; code in the evening

Douglas R Andreani andreanidouglas

🎯
data in the morning; code in the evening
View GitHub Profile
######
## Script to automatically compile and install opencv and opencv contrib libraries into debian-like systems
## Created by Douglas Andreani
## Created on: Sep 30th 2015
######
#!/bin/sh
if [ $(id -u) -ne 0 ]; then
echo "Please run as: sudo sh $0"
@andreanidouglas
andreanidouglas / install_opencv.md
Last active January 11, 2017 13:31
Quick guide on how to install and compile opencv 3.2 from its source

Disclaimer This guide has an intent to install the OpenCV libraries for development. Please notice that i'm no Linux expert and this can eventually break your system. Do at your own rist.

General

  • Many packages are required in order to compile the OpenCV libraries.

  • If you have a system with apt-get:

@andreanidouglas
andreanidouglas / cue_to_mp3.py
Last active October 30, 2017 11:08 — forked from bancek/cue_to_mp3.py
CUE splitter using ffmpeg (to mp3)
#!/usr/bin/python2
import os
def generate_script(cue_file, file_path, file_name):
d = open(cue_file).read().splitlines()
general = {}
tracks = []
@andreanidouglas
andreanidouglas / mpd_conf.md
Last active May 20, 2018 03:59
MPD Configuration

Setup /etc/mpd.conf

music_directory "/mnt/Media/Musics"
playlist_directory "/opt/mpd"
db_file "/opt/mpd/mpd.db"

log_file "/opt/mpd/mpd.log"
pid_file "/opt/mpd/mpd.pid"
state_file "/opt/mpd/mpdstate"
D 42.546245 1.601554 Andorra
AE 23.424076 53.847818 United Arab Emirates
AF 33.93911 67.709953 Afghanistan
AG 17.060816 -61.796428 Antigua and Barbuda
AI 18.220554 -63.068615 Anguilla
AL 41.153332 20.168331 Albania
AM 40.069099 45.038189 Armenia
AN 12.226079 -69.060087 Netherlands Antilles
AO -11.202692 17.873887 Angola
AQ -75.250973 -0.071389 Antarctica
#!/bin/sh
### This will compile a bzImage and the modules the latest version on the repository
### Required a file "config_default" to compile with
set -ex
unique=$(date +%s)
version=$(git ls-remote --refs --tags https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git | cut -d" " -f2 | cut -d'/' -f3 | sort | tail -1)
curl -4 -L --url "https://git.kernel.org/torvalds/t/linux-$version.tar.gz" -o linux-"$version"_"$unique".tar.gz
tar xvf linux-"$version"_"$unique".tar.gz
cd linux_"$version"_"$unique"
@andreanidouglas
andreanidouglas / slippi-dependencies.md
Created July 16, 2021 20:12
slippi dependencies for ubuntu 20.04
apt install -y libao-dev libasound2-dev libavcodec-dev libavformat-dev libbluetooth-dev libenet-dev libgtk2.0-dev liblzo2-dev libminiupnpc-dev libopenal-dev libpulse-dev libreadline-dev libsfml-dev libsoil-dev libsoundtouch-dev libswscale-dev libusb-1.0-0-dev libwxbase3.0-dev libwxgtk3.0-gtk3-dev libxext-dev libxrandr-dev portaudio19-dev zlib1g-dev libudev-dev libevdev-dev libmbedtls-dev libcurl4-openssl-dev libegl1-mesa-dev libpng-dev qtbase5-private-dev libxxf86vm-dev x11proto-xinerama-dev
@andreanidouglas
andreanidouglas / carbon-install.md
Created July 26, 2022 21:17
How to install Carbon Language on Ubuntu 22.04

How to install carbon language on Ubuntu 22.04

Make sure you have basic tools

sudo apt update && sudo apt -y install build-essential git curl gdb make cmake ninja-build meson

Install Go

@andreanidouglas
andreanidouglas / ffmpeg_to_x265.sh
Created August 23, 2022 13:57
Quick convert movies to x265
## This script is not totally error free. If your seas path has any spaces, it will shit itself out. Be careful
## Also, I usually run this on docker to avoid having to deal with ffmpeg dependencies on the host machine (linuxserver/ffmpeg)
#!/bin/sh
set -e
seas="/media/Videos" # place with videos
pushd "$seas"
files=$(find . -type f -name "*.mkv" | xargs -0)
@andreanidouglas
andreanidouglas / x509_lifetimes.rs
Last active September 16, 2022 23:21
Rust snippet on x509-parser treating lifetimes
use x509_parser::prelude::*;
fn main() -> anyhow::Result<()> {
print_cert()?;
print_cert_static()?;
Ok(())
}