Skip to content

Instantly share code, notes, and snippets.

View nicr9's full-sized avatar

Nic Roland nicr9

View GitHub Profile
@nicr9
nicr9 / .block
Last active April 7, 2018 12:16
d3mind
license: mit
@nicr9
nicr9 / lp2kp.py
Created December 12, 2016 09:29
Lastpass to KeePassX converter
from sys import argv
from collections import defaultdict
import xml.etree.ElementTree as ET
import csv
import datetime
if __name__ == "__main__":
src = argv[1]
dest = argv[1] + ".kp.xml"
current_time = datetime.datetime.now().strftime("%Y-%m-%dT%H:%M")
@nicr9
nicr9 / install_vim.sh
Created August 18, 2016 11:49
Notes on installing vim from source (RedHat)
sudo yum groupinstall 'Development tools'
sudo yum install ncurses ncurses-devel
mkdir -p ~/src/github.com/vim
cd !$
git clone https://github.com/vim/vim.git
cd vim
./configure --prefix=/usr --with-features=huge --enable-pythoninterp --with-compiledby='@nicr9_'
make

Keybase proof

I hereby claim:

  • I am nicr9 on github.
  • I am nicr9 (https://keybase.io/nicr9) on keybase.
  • I have a public key whose fingerprint is 4C6E AE36 AC6C 945F A2B8 1EED 287C AD67 3FAA A6AC

To claim this, I am signing this object:

@nicr9
nicr9 / yubikey_gpg.sh
Created June 22, 2016 20:54
Enabling YubiKey's PGP applet
# Plugin yubikey first!
# Check yubikey connection
ykinfo -a
# Change yubikey mode
ykpersonalize -m82
# Plug yubikey out/in again now!
@nicr9
nicr9 / Makefile.ex1
Last active June 5, 2018 19:45
Example Makefile for docker project
# Admin commands
all: build up
build:
docker-compose build
up:
docker-compose up -d
@nicr9
nicr9 / yubikey_personalization.sh
Last active June 22, 2016 20:46
Setting up yubikey personalization CLI
mkdir -p ~/src/github.com/Yubico
cd !$
# dependancies
sudo apt-get install -y libusb-1.0-0-dev libusb-dev autoconf libtool asciidoc
# Build libyubikey-dev from source
git clone https://github.com/Yubico/yubico-c.git
cd yubico-c
autoreconf --install
@nicr9
nicr9 / content_disposition.py
Last active December 24, 2023 07:32
Add `Content-Disposition` header to SimpleHttpServer
#!/usr/bin/env python
from SimpleHTTPServer import SimpleHTTPRequestHandler, test
class CustomRequestHandler(SimpleHTTPRequestHandler):
def end_headers(self):
self.add_content_disposition()
SimpleHTTPRequestHandler.end_headers(self)
def add_content_disposition(self):
self.send_header("Content-Disposition", 'filename="content_disposition.py"')
@nicr9
nicr9 / i3_install_centos7.sh
Last active October 4, 2018 22:53 — forked from douglascodes/i3-wm_4.10.2_install
Installing i3-wm from source on CentOS 7
yum update
#Install for compiling and configuring needs
yum install nano bzip2 gcc git pkgconfig autoconf automake libtool gperf byacc libxslt bison flex
#Install needed and available development libraries
yum install libxcb-devel libXcursor-devel pango-devel pcre-devel perl-Data-Dumper perl-Pod-Parser startup-notification-devel xcb-util-keysyms-devel xcb-util-devel xcb-util-wm-devel yajl-devel check-devel gettext-devel xterm
yum install xorg-x11-xkb-extras xorg-x11-xkb-utils-devel libxkbfile-devel libev-devel
#Add the following lines to a new file at the below location
@nicr9
nicr9 / mdserver.sh
Created April 10, 2016 15:35
Using mdserver
docker pull nicr9/mdserver
docker run -dp 4000:4000 -v /home/$USER/notes:/opt/notes nicr9/mdserver