Skip to content

Instantly share code, notes, and snippets.

Avatar
🐢
I may be slow to respond.

Graham G. grahamg

🐢
I may be slow to respond.
View GitHub Profile
@grahamg
grahamg / Dockerfile
Last active May 10, 2020
Dockerfile for local development environment.
View Dockerfile
#
# mkdir DockerLocalDevelopmentEnvironment
# curl -o Dockerfile <this file>
# docker build -t dev-env .
# docker run -it -d dev-env:latest /bin/bash
# docker ps
# docker attach <randomly assigned instance name>
#
FROM phusion/baseimage:latest
View init.vim
" Use Vim settings rather than Vi settings
" Required to be at the beginning of file
set nocompatible
" Required
filetype off
" Turn on syntax highlighting
syntax on
@grahamg
grahamg / docker_devlounge_pt2.txt
Last active Jun 19, 2018
Docker DevLounge Notes (6/18/18)
View docker_devlounge_pt2.txt
*Dockerfile*
FROM php:7.0.17-apache
RUN apt-get update
RUN apt-get install -y apt-utils vim curl sqlite3
RUN pecl install xdebug
ADD ./db/test.db /test.db
ADD ./php.ini /usr/local/etc/php
@grahamg
grahamg / The Technical Interview Cheat Sheet.md
Created May 8, 2018 — forked from TSiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.
View The Technical Interview Cheat Sheet.md

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
View tmux_cheatsheet.markdown

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@grahamg
grahamg / .vimrc
Last active Jun 26, 2019 — forked from anonymous/.vimrc
For use at job
View .vimrc
" Use Vim settings rather than Vi settings
" Required to be at the beginning of file
set nocompatible
" Required
filetype off
" Turn on syntax highlighting
syntax on
@grahamg
grahamg / .tmux.conf
Created Aug 25, 2016
Tmux Configuration
View .tmux.conf
# Ring the bell if any background window rang a bell
set -g bell-action any
# Default termtype. If the rcfile sets $TERM, that overrides this value.
set -g default-terminal screen-256color
# Keep your finger on ctrl, or don't
bind-key ^D detach-client
# Split panes using | and -
@grahamg
grahamg / .vimrc
Last active Oct 14, 2016
Vim Configuration
View .vimrc
" Use Vim settings rather than Vi settings
" Required to be at the beginning of file
set nocompatible
" Required
filetype off
" Turn on syntax highlighting
syntax on
View djangix.py
#!/usr/bin/python
import os, pwd, grp, subprocess
#Base directory of your django sites
wwwroot = "/var/www/"
#Create list of directories inside wwwroot
dirs = os.listdir(wwwroot)
#Default django project directory
@grahamg
grahamg / maldet_automate.sh
Created Feb 1, 2012
Check the progress of a currently running maldet malware session, if not start one up in the background
View maldet_automate.sh
#!/bin/bash
download_location=http://www.rfxn.com/downloads/maldetect-current.tar.gz
scan_location=/home?/?
maldet=/usr/local/sbin/maldet
dump_file='/root/maldet_$(pidof -x $maldet)_$(date +"%m-%d-%Y-%T").dump'
hash maldet 2>&- || {
echo >&2 "Maldetect not installed. Installing...";
wget --progress=dot $download_location -O /root/maldetect-current.tar.gz