Skip to content

Instantly share code, notes, and snippets.

View lopezpdvn's full-sized avatar

Pedro Ivan Lopez lopezpdvn

View GitHub Profile
lopezpdvn / zip_cs
Last active August 29, 2015 14:07
zip/unzip cs
# Zip directories
zip -r $zipf name00* name01*
# List zip file contents
unzip -l $zipf
vim $zipf
less $zipf
lopezpdvn /
Last active May 21, 2016 06:42
How to set up a debugging and development environment for Android on Linux

How to set up a debugging and development environment for Android on Linux

Republished on my blog, keeping this version here for historical reasons.

This post describes how to set up a debugging and development environment for Android based systems on an Ubuntu machine, specially for flashing custom recoveries and ROMs, but not for coding. I'm basically pulling together information from other sources across the web, be sure to check out the References and other external links for more details. You only

#!/usr/bin/env python
# coding=utf-8
'''Module docstrings title.
Don't use keywords only arguments (for functions), sphinx.ext.autodoc will
fail if you do.
When in doubt consult [PEP8]_.
lopezpdvn /
Last active May 25, 2016 19:43
wkhtmltopdf cheatsheet/examples
title="ASP.NET from Wikipedia"
wkhtmltopdf -s Letter --title "$title" -T 10 -B 10 "$src" "$dst"
lopezpdvn / html5_template_basic.html
Last active May 25, 2016 19:53
HTML5 templates
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8" />
<link rel="stylesheet" href="css/main_stylesheet.css" />
<link rel="shortcut icon" href="/favicon.ico" />
Title || URI
lopezpdvn /
Last active May 26, 2016 23:09
misc cheatsheet

Misc cheatsheet

youtube-dl to download videos and extract audio.

$ youtube-dl -x --audio-format mp3 --audio-quality 320k --embed-thumbnail -a uris.txt


lopezpdvn /
Created July 1, 2016 00:23
Compress raw video into Matroska container
date >> log.txt
echo 'Starting job' >> log.txt
sudo systemctl stop fahclient.service
sudo systemctl status --full fahclient.service
for src in *avi ; do
date >> log.txt ;
echo "Starting conversion for $src" >> log.txt ;
dst="$(echo $src | sed -e 's/\.avi$//')".mkv ;
ffmpeg -ac 2 -channel_layout stereo -i "$src" -c:v libx264 -preset slow -crf 17 -pix_fmt yuv422p -c:a pcm_s16le "$dst" ;
#!/bin/sh -
# Example values
lopezpdvn /
Created July 10, 2016 22:02
ffmpeg trim/cut video to video
from datetime import timedelta
from subprocess import Popen
Edit section *User data*, and uncomment one of the commands `cmd`
# User data
tstart = timedelta(minutes=18, seconds=20, milliseconds=0)
lopezpdvn /
Created July 29, 2016 15:21
Exiftool metadata write script
cp -av $src $dst
exiftool -u -a -All= $dst
exiftool -use MWG \
-Copyright="Image by Pedro Ivan Lopez. All rights to the respective authors." \