Skip to content

Instantly share code, notes, and snippets.

View saderi's full-sized avatar
🦇

Payam Saderi saderi

🦇
View GitHub Profile
@BretFisher
BretFisher / Dockerfile
Last active June 14, 2024 04:22
Multi-stage Dockerfile example of installing dependencies with COPY --from
# any images you use later, add them here first to create aliases
# I like keeping all my versions at the top
FROM node:14.3-slim as node
FROM php:7.2.1-fpm-slim as php
FROM nginx:1.17 as nginx
# The real base image to start from
FROM ubuntu:focal-20210827 as base
# install apt stuff
#!/bin/bash
# This script is meant for quick & easy install via:
# Tested on Debian 9, Debian 10, Ubuntu 18.04 / 20.04 / 22.04
#
# wget -q -O - "https://gist.github.com/saderi/4a0af3e424d3429648553f319348ccb0/raw" | bash -
# OR
# curl -fsSL https://gist.github.com/saderi/4a0af3e424d3429648553f319348ccb0/raw | bash -
# Update , upgrade OS and install vim, make and git
#!/bin/sh
# init. the projects informations
PROJECT=PROJECT_NAME
FILE=$PROJECT.`jdate +%Y-%m-%d`.sql
DBSERVER=DATABASE_SERVER
DATABASE=DBNAME
USER=DBUSER
PASS=dbpassword
#in case you run this more than once a day, remove the previous version of the file
@carlodaniele
carlodaniele / custom-queries.php
Last active January 23, 2024 01:35
An example plugin showing how to add custom query vars, rewrite tags and rewrite rules to WordPress
<?php
/**
* @package Custom_queries
* @version 1.0
*/
/*
Plugin Name: Custom queries
Plugin URI: http://wordpress.org/extend/plugins/#
Description: This is an example plugin
Author: Carlo Daniele
@haisum
haisum / script.sh
Created September 1, 2015 06:10
comment and uncomment lines in bash script via sed
sed -i '/<pattern>/s/^/#/g' file #comment
sed -i '/<pattern>/s/^#//g' file #uncomment
@gsong
gsong / gist:6321633
Last active February 4, 2022 12:06
Bash script to generate SSL csr/key/crt
#!/bin/bash
# Usage:
#
# ssl_setup [--self] <name> <csr_config>
#
# This script is used to generate key and CSR for use HTTPS in Nginx.
#
# --self Generate self-signed certificate in addition to key and CSR.
# name Output files will be named as <name>.key and <name>.csr.