Skip to content

Instantly share code, notes, and snippets.

@prashcr
prashcr / git-crypt-unlock
Created January 3, 2020 07:46
Work around a bug in git-crypt
#!/bin/sh
#
# git-crypt-unlock - Work around a bug in git-crypt.
umask 077
for FILE in `find .git-crypt/keys/**/* -type f`; do
if gpg -q --decrypt < $FILE > git-crypt-symmetric-key 2> /dev/null; then
git-crypt unlock git-crypt-symmetric-key
rm -f git-crypt-symmetric-key
echo 'unlocked'
@prashcr
prashcr / error.txt
Created August 9, 2019 03:15
PulseAudio error on Ubuntu 18.04 when automatically connecting to Sony WH-1000XM2
Aug 09 11:08:25 CB-199 pulseaudio[3493]: [pulseaudio] module-bluez5-device.c: Profile a2dp_sink has no transport
Aug 09 11:11:05 CB-199 pulseaudio[3493]: [pulseaudio] module-bluez5-device.c: Refused to switch profile to a2dp_sink: Not connected
Aug 09 11:11:41 CB-199 pulseaudio[3493]: [pulseaudio] module-bluez5-device.c: Refused to switch profile to a2dp_sink: Not connected
@prashcr
prashcr / .ideavimrc
Created July 31, 2019 05:24
IdeaVim configuration
set surround
set clipboard+=unnamed
set hlsearch
set incsearch
@prashcr
prashcr / .bashrc
Last active May 8, 2019 08:36
bash options, aliases, completions
shopt -s autocd
shopt -s cdspell
shopt -s dirspell
export EDITOR="vim"
export PROMPT_COMMAND="history -a; history -c; history -r;$PROMPT_COMMAND"
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
let blacklists = [
"*://mail.google.com/*",
"*://workflowy.com/*",
]
@prashcr
prashcr / sVimcss.css
Created November 25, 2018 16:57 — forked from eproxus/sVimcss.css
sVim Settings with Vimium Hint Styles
@-webkit-keyframes fadein {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
#sVim-command {
@prashcr
prashcr / .pam_environment
Last active May 9, 2019 10:29
Linux gpg-agent config with agent forwarding and ssh support (remember to disable ssh-agent with systemctl --user disable ssh-agent)
SSH_AGENT_PID DEFAULT=
SSH_AUTH_SOCK DEFAULT="${XDG_RUNTIME_DIR}/gnupg/S.gpg-agent.ssh"
@prashcr
prashcr / ubuntu-ansible-bootstrap.sh
Created April 15, 2018 10:04
Script that installs ansible on an Ubuntu instance
#! /bin/bash
apt-get update
apt-get install software-properties-common
apt-add-repository ppa:ansible/ansible
apt-get update
apt-get install ansible
call plug#begin()
Plug 'w0rp/ale'
Plug 'tpope/vim-fugitive'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
Plug 'chriskempson/base16-vim'
Plug 'Valloric/YouCompleteMe', { 'do': './install.py', 'for': ['c', 'cpp'] }
Plug 'janko-m/vim-test'
Plug 'tpope/vim-dispatch'
Plug 'skywind3000/asyncrun.vim'
@prashcr
prashcr / firefox-moment.css
Created May 10, 2017 12:53
My custom CSS for the Moment Firefox addon
body {
background:url(https://unsplash.it/1920/1080/?random) center top !important;
background-size:cover !important; }
* {
color:white !important;
text-shadow: 1px 1px 10px #000; }