Skip to content

Instantly share code, notes, and snippets.

View DanNYSPD's full-sized avatar

Daniel Hernandez DanNYSPD

  • Mexico
View GitHub Profile
@DanNYSPD
DanNYSPD / Dockerfile
Last active August 16, 2020 17:59 — forked from Tazeg/Dockerfile
Dockerfile for a dev web server with PHP/Apache
#-----------------------------------------------------------------------
# To create the docker image :
# cd <this file directory>
# docker build -t apache-php-dev .
#
# Start image :
# docker run -d -p 80:80 -v /home/user/public_html:/var/www/html apache-php-dev
#
# Open browser :
# http://localhost

Modifying an Existing Docker Image

To install a custom package or modify an existing docker image we need to

  1. run a docker a container from the image we wish to modify
  2. modify the docker container
  3. commit the changes to the container as a docker image
  4. test changes made to image

1.) Running a docker container from an image

@DanNYSPD
DanNYSPD / php5.6-pgsql.Dockerfile
Created October 31, 2020 06:48 — forked from ben-albon/php5.6-pgsql.Dockerfile
Docker PHP Image with PostgreSQL Driver
FROM php:5.6-apache
RUN apt-get update && apt-get install -y libpq-dev && docker-php-ext-install pdo pdo_pgsql
COPY src/ /var/www/html
@DanNYSPD
DanNYSPD / decompile_java.md
Last active November 13, 2020 06:04
Decompile Java class or Jar container under Linux Mint / Ubuntu

Lee Benfield's Java decompiler CFR is straight forward and can even batch decompile jar container. 

  1. Download the most recent version of CFR (crf 0.1.15 at the time of writing)
cd /usr/local/bin && wget http://www.benf.org/other/cfr/cfr_0_115.jar
  1. Run decompile with output into terminal
java -jar /usr/local/bin/cfr_0_115.jar javaclasstodecompiles.class
@DanNYSPD
DanNYSPD / .tmux.conf
Created December 11, 2020 18:58 — forked from miguelgrinberg/.tmux.conf
My .tmux.conf file for working with tmux
# Set the prefix to ^A.
unbind C-b
set -g prefix ^A
bind a send-prefix
# Start windows and panes at 1, not 0
set -g base-index 1
set -g pane-base-index 1
set -g renumber-windows on
@DanNYSPD
DanNYSPD / download_ref.js
Created March 9, 2021 20:56
Gets hrefs and download via wget
//download pages that are referenced by a "a element", usefull for pages with links to documentations
Array.from(document.querySelectorAll('body > p > a')).map(x=>"wget "+x.href).join(" & ");
@DanNYSPD
DanNYSPD / gist:092f58a8f9ef86ba496db954143d27de
Created May 30, 2021 03:09 — forked from reoring/gist:3ff898c90a81073ea37b96e0fef8746b
docker-compose.yml for php and postgresql

html/index.php

<?php

phpinfo();

docker/Dockerfile

#!/bin/bash
bash -c "$(curl -fsSL https://raw.githubusercontent.com/ohmybash/oh-my-bash/master/tools/install.sh)" && sed -i 's/SH_THEME="font"/SH_THEME="bobby"/' ~/.bashrc && exec bash
@DanNYSPD
DanNYSPD / diagrams.md
Created March 31, 2022 19:09 — forked from blackcater/diagrams.md
Markdown Diagrams

Diagrams

Markdown Preview Enhanced supports rendering flow charts, sequence diagrams, mermaid, PlantUML, WaveDrom, GraphViz, Vega & Vega-lite, Ditaa diagrams. You can also render TikZ, Python Matplotlib, Plotly and all sorts of other graphs and diagrams by using Code Chunk.

Please note that some diagrams don't work well with file exports such as PDF, pandoc, etc.

Flow Charts

This feature is powered by flowchart.js.

if [[ -z "$WORKSPACE_DIR" ]]; then
if [[ -d "/var/www/html" ]]; then
WORKSPACE_DIR='/var/www/html'
fi
fi
workspaces=$(echo "$WORKSPACE_DIR" | tr ':' ' ') #in case multiple projects open fast
#project=$(find $workspaces -maxdepth 1 -type d | fzf)
if [[ "$SHELL" =~ *zsh$ ]]; then