Skip to content

Instantly share code, notes, and snippets.

Avatar

Pedro Ivan Lopez lopezpdvn

View GitHub Profile
@lopezpdvn
lopezpdvn / zip_cs
Last active Aug 29, 2015
zip/unzip cs
View zip_cs
# Zip directories
zip -r $zipf name00* name01*
# List zip file contents
unzip -l $zipf
vim $zipf
less $zipf
View html5_template_basic.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="stylesheet" href="css/main_stylesheet.css" />
<link rel="shortcut icon" href="/favicon.ico" />
<title>
Title || URI
</title>
</head>
@lopezpdvn
lopezpdvn / wkhtmltopdf_example_00.sh
Last active May 25, 2016
wkhtmltopdf cheatsheet/examples
View wkhtmltopdf_example_00.sh
title="ASP.NET from Wikipedia"
src='https://en.wikipedia.org/wiki/ASP.NET'
dst=aspnet.pdf
wkhtmltopdf -s Letter --title "$title" -T 10 -B 10 "$src" "$dst"
View python-short-template.py
#!/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
lopezpdvn / fahclient.service
Created Apr 17, 2015
Systemd service unit for FAHClient // Folding@Home Client
View fahclient.service
[Unit]
Description=Folding@Home V7 Client
Documentation=https://folding.stanford.edu/home/the-software/
[Service]
Type=simple
PIDFile=/var/run/fahclient.pid
ExecStart=/usr/local/bin/FAHClient -v start
ExecReload=/usr/local/bin/FAHClient -v restart
ExecStop=/usr/local/bin/FAHClient -v stop
@lopezpdvn
lopezpdvn / install-fahclient-linux-systemd-service-unit.md
Last active Nov 27, 2020
Install Folding@home FAHClient on Linux as a systemd service unit
View install-fahclient-linux-systemd-service-unit.md

Install Folding@home FAHClient on Linux as a systemd service unit

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

Install FAHClient as documented in the official guide. Stop the traditional init script service that was created and automatically started.

@lopezpdvn
lopezpdvn / set-up-debugging-development-environment-for-android-on-linux.md
Last active May 21, 2016
How to set up a debugging and development environment for Android on Linux
View set-up-debugging-development-environment-for-android-on-linux.md

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

View misc_cheatsheet.md

Misc cheatsheet

youtube-dl to download videos and extract audio.

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

Robocopy

View ffmpeg_quodlibet_operon.sh
for src in *flac; do
dst="$(echo $src | sed -e 's/\.flac//' -e 's/ /_/g')".mp3
ffmpeg -i "$src" -ab 320k "$dst"
operon clear -a "$dst"
operon copy "$src" "$dst"
done
@lopezpdvn
lopezpdvn / compress_raw_video.sh
Created Jul 1, 2016
Compress raw video into Matroska container
View compress_raw_video.sh
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" ;