This file contains 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/bash | |
# | |
# Backup a Postgresql database into a daily file. | |
# | |
BACKUP_DIR=/pg_backup | |
DAYS_TO_KEEP=14 | |
FILE_SUFFIX=_pg_backup.sql | |
DATABASE= | |
USER=postgres |
This file contains 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
# syntax=docker/dockerfile:experimental | |
# Build staticly linked version of redis | |
FROM alpine:3.18.4 as redis-builds | |
ADD https://download.redis.io/redis-stable.tar.gz . | |
ADD https://liquidtelecom.dl.sourceforge.net/project/tcl/Tcl/8.6.13/tcl8.6.13-src.tar.gz . | |
RUN set -ex && \ | |
apk add --no-cache make && \ | |
apk add --no-cache gcc musl-dev | |
RUN tar -xzf redis-stable.tar.gz \ |
This file contains 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
(function umd(root, factory) { | |
root.httpStatus = factory(); | |
})(this, function () { | |
class StatusEvaluator { | |
constructor(code) { | |
this.code = code; | |
this.map = {}; | |
this.ow = null; | |
} |
This file contains 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
for ID in $(sudo docker images --format "{{.ID}}" --filter "dangling=true") | |
do | |
echo "forcefully delete image $ID" | |
sudo docker rmi -f $ID | |
done | |
sudo docker images |
This file contains 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
import java.net.MalformedURLException; | |
import java.net.URL; | |
import java.util.*; | |
public class UrlUtil { | |
private final URL url; | |
private final Map<String, List<String>> parameters; | |
public UrlUtil(String url) throws MalformedURLException { | |
this.url = new URL(url); |
This file contains 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
import java.io.Closeable; | |
import java.net.InetSocketAddress; | |
import java.nio.channels.SelectionKey; | |
import java.nio.channels.Selector; | |
import java.nio.channels.ServerSocketChannel; | |
import java.nio.channels.SocketChannel; | |
import java.util.Iterator; | |
import java.util.Set; | |
public final class HttpsRedirector { |