Skip to content

Instantly share code, notes, and snippets.

View nicr9's full-sized avatar

Nic Roland nicr9

View GitHub Profile
@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 / 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
@nicr9
nicr9 / notes.py
Created March 16, 2016 11:44
Python Cheat Sheet
# Comments use the hash symbol
# some data types are similar to VB but names are either short or different
int # Plain numbers
float # Fractional numbers with floating point (similar to Double in VB)
str # String of text
bool # Boolean value (True or False)
# Creating a variable
x = 1
FROM ubuntu:15.10
MAINTAINER Nic Roland "nicroland9@gmail.com"
RUN apt-get update && \
apt-get install -y xdotool cron && \
apt-get clean
RUN echo "20 * * * * xdotool movemouse 15 15 click 1" > mouse.cron
RUN crontab mouse.cron
FROM ubuntu:15.10
MAINTAINER Nic Roland "nicroland9@gmail.com"
RUN apt-get update && \
apt-get install -y xclip && \
apt-get clean
ENTRYPOINT xclip -o -selection clipboard
FROM ubuntu:12.04
MAINTAINER Nic Roland "nicroland9@gmail.com"
RUN apt-get update && \
apt-get install -y autoconf automake git g++ console-tools language-pack-en-base make && \
apt-get clean
RUN locale-gen en_US.UTF-8
RUN git clone https://github.com/kernc/logkeys
WORKDIR logkeys
FROM ubuntu:15.10
MAINTAINER Nic Roland "nicroland9@gmail.com"
RUN apt-get update && \
apt-get install -y xdotool cron && \
apt-get clean
RUN echo "20 * * * * xdotool key Caps_Lock" > capslock.cron
RUN crontab capslock.cron
FROM ubuntu:15.10
MAINTAINER Nic Roland "nicroland9@gmail.com"
RUN apt-get update && \
apt-get install -y imagemagick feh
ENTRYPOINT import -window root -display :0 /tmp/0.png && \
feh -. /tmp/0.png
# Build the demo dockerfile
docker build -f Dockerfile.screenshot -t xattacks:screenshot .
# Allow Docker processes to access X
xhost local:root
# Run container that takes a screenshot on the host (imagemagick) and displays it for you (feh)
docker run -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY xattacks:screenshot
@nicr9
nicr9 / class_decorators.py
Created January 20, 2016 23:17
Python decorators with classes
class WithoutParams(object):
def __init__(self, func):
"""
Constructor receives target function.
"""
self.func = func
def __call__(self, *args, **kwargs):
"""
Arguments intended for target function are passed to __call__.