This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get update | |
sudo apt-get install -y ca-certificates curl gnupg | |
sudo install -m 0755 -d /etc/apt/keyrings | |
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg | |
sudo chmod a+r /etc/apt/keyrings/docker.gpg | |
echo \ | |
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \ | |
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ | |
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null | |
sudo apt-get update |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yourdomain.com { | |
tls email@abc.com | |
root * /srv/www | |
file_server | |
handle_errors { | |
@404 { | |
expression int({http.error.status_code}) == 404 | |
} | |
respond @404 "This is 404 error message" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:18.04 AS builder | |
WORKDIR /app/ | |
RUN apt-get update | |
RUN apt-get install -y build-essential libpoppler-private-dev libleptonica-dev pkg-config git | |
RUN git clone https://github.com/allenai/pdffigures.git | |
WORKDIR pdffigures | |
RUN make DEBUG=0 | |
RUN ldd ./pdffigures | tr -s '[:blank:]' '\n' | grep '^/' | xargs -I % sh -c 'mkdir -p $(dirname deps%); cp % deps%;' | |
FROM ubuntu:18.04 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
sudo dpkg --remove docker docker-engine docker.io | |
sudo apt-get update | |
sudo apt-get install -y \ | |
apt-transport-https \ | |
ca-certificates \ | |
curl \ | |
gnupg2 \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
DESC="Java Service" | |
NAME=java-service | |
PIDFILE=/tmp/$NAME.pid | |
PATH_TO_JAR=~/java-service.jar | |
PATH_TO_JAVA=/usr/local/jdk1.8.0_131/bin/java | |
SERVICE_CONFIG='-Dserver.port=8080 -DLOG_PATH=/var/log' | |
COMMAND="$PATH_TO_JAVA -- $SERVICE_CONFIG -jar $PATH_TO_JAR" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static String getClientIP(HttpServletRequest request) | |
{ | |
String ip = request.getHeader("X-Real-IP"); | |
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) | |
ip = request.getHeader("X-Forwarded-For"); | |
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) | |
ip = request.getHeader("Proxy-Client-IP"); | |
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) | |
ip = request.getHeader("WL-Proxy-Client-IP"); | |
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) |