Skip to content

Instantly share code, notes, and snippets.

View alfredodeza's full-sized avatar
:octocat:

Alfredo Deza alfredodeza

:octocat:
View GitHub Profile
@alfredodeza
alfredodeza / new_repo.sh
Created April 7, 2015 16:54
new Ceph release repo
# create the new rpm directory
mkdir rpm-hammer
cd rpm-hammer
# make the directories for the distros we need for x86_64
mkdir -p el6/x86_64/
mkdir -p el7/x86_64/
mkdir -p fc20/x86_64/
mkdir -p rhel6/x86_64/
mkdir -p rhel7/x86_64/
@alfredodeza
alfredodeza / unmask.js
Created April 28, 2015 13:04
Unmask passwords
var els=document.getElementsByTagName('input'); for(var x = 0; x < els.length; x++) { if(els[x].type.toLowerCase() == 'password' ) { var test = els[x].type = 'text'; } }
@alfredodeza
alfredodeza / whisper.vim
Created May 11, 2015 14:28
map the undo to whisper balls
" I don't remember exactly how to make it not spit out the actual command you are running. Meh.
nnoremap u :call system("say -v whisper 'balls'")<CR>
@alfredodeza
alfredodeza / prepare-commit-msg
Last active October 19, 2015 20:06
prefix commit messages with branch names
#!/usr/bin/python
"""
This is a prepare-commit-msg hook that fill prefix commit messages with
[BRANCH]
Copy this file to $GITREPOSITORY/.git/hooks/prepare-commit-msg
and mark it executable.
Assumes your branch is based off of a tracker ID
"""
@alfredodeza
alfredodeza / how-to.txt
Last active February 2, 2024 18:47
pdf output from sphinx with rst2pdf
1. Install rst2pdf
- use your package manager (or)
- pip install rst2pdf (or)
- easy_install rst2pdf
2. Add rst2pdf to the list of extensions in conf.py
extensions = ['rst2pdf.pdfbuilder']
@alfredodeza
alfredodeza / unmask.js
Created December 1, 2015 13:31
Unmask **** passwords
var els = document.getElementsByTagName('input'); for(var x = 0; x < els.length; x++) { if(els[x].type.toLowerCase() == 'password' ) { var test = els[x].type = 'text'; } }
@alfredodeza
alfredodeza / .vimrc
Created March 7, 2016 13:45
Read non-plaintext file types in Vim
" requires pandoc, the newest the version the better
autocmd BufReadPost *.doc,*.docx,*.rtf,*.odp,*.odt silent %!pandoc "%" -tplain -o /dev/stdout
@alfredodeza
alfredodeza / mp4togif.sh
Created March 16, 2016 11:40
convert an mp4 to a gif
mp4=$1
DEFAULT_GIF_NAME="output.gif"
OUTPUT=${2:-$DEFAULT_GIF_NAME}
# -delay is used to control the timing between frames, the scale sets the resolution
ffmpeg -i $mp4 -vf scale=320:-1 -r 10 -f image2pipe -vcodec ppm - | convert -delay 10 -loop 0 - $OUTPUT
@alfredodeza
alfredodeza / main.yml
Created April 28, 2016 12:07
ensure that the current `hostname` is defined in `/etc/hosts`
---
# Because not everything is correct in this world, we may end up with a host that doesn't have the reported
# hostname in the hosts file.
- name: ensure that the current host is in /etc/hosts. Yes this is a thing.
sudo: true
replace:
backup: yes
dest: /etc/hosts
regexp: '^(127\.0\.1\.1(?!.*\b{{ ansible_hostname }}\b).*)$'
@alfredodeza
alfredodeza / enable_tether.rst
Created April 29, 2016 12:36
tethering enabled for Nexus 5x

Steps to enable tethering on Android 6.0 Marshmallow update

Step 1: Ensure you have the correct OEM drivers installed for your handset on the computer

Step 2: Download and install the necessary ADB drivers (v1.4.2)

Step 3: Enable USB debugging on your Android handset:

Go to Settings > About Device, and tap the build number 7 times or until you see 'You're now a developer' message. Return to Settings > Developer options and use the toggle button to turn on USB debugging. Then tap OK button to accept the warning and continue.