Skip to content

Instantly share code, notes, and snippets.

@d68fbe50
d68fbe50 / docker-compose-logging.yml
Created January 7, 2022 04:05 — forked from yolabingo/docker-compose-logging.yml
docker-compose log file max size
   logging:
     driver: "json-file"
     options:
         max-file: "20"
         max-size: "100m"
@d68fbe50
d68fbe50 / parse_json.sh
Created October 8, 2021 08:44 — forked from elliptic-shiho/parse_json.sh
JSON Parser for POSIX Shell Script
#!/bin/sh
cat -| awk '
{
gsub(/&lt;/, "<")
gsub(/&gt;/, ">")
gsub(/&amp;/, "&")
gsub(/&quot;/, "\"")
gsub(/\{/, "{\n")
gsub(/\}/, "\n}")
@d68fbe50
d68fbe50 / Docker Best Practices.md
Created September 22, 2021 03:27 — forked from StevenACoffman/Docker Best Practices.md
Docker Best Practices

Mistakes to Avoid: Docker Antipatterns

Whichever route you take to implementing containers, you’ll want to steer clear of common pitfalls that can undermine the efficiency of your Docker stack.

Don’t run too many processes inside a single container

The beauty of containers—and an advantage of containers over virtual machines—is that it is easy to make multiple containers interact with one another in order to compose a complete application. There is no need to run a full application inside a single container. Instead, break your application down as much as possible into discrete services, and distribute services across multiple containers. This maximizes flexibility and reliability.

Don’t install operating systems inside Docker containers

It is possible to install a complete Linux operating system inside a container. In most cases, however, this is not necessary. If your goal is to host just a single application or part of an application in the container, you need to install only the essential

@d68fbe50
d68fbe50 / .Cloud.md
Created August 18, 2021 01:11 — forked from imba-tjd/.Cloud.md
☁️ 一些免费的云资源

IaaS指提供系统(可以自己选)或者储存空间之类的硬件,软件要自己手动装;PaaS提供语言环境和框架(可以自己选);SaaS只能使用开发好的软件(卖软件本身);BaaS一般类似于非关系数据库,但各家不通用,有时还有一些其它东西。

其他人的集合

@d68fbe50
d68fbe50 / .gitignore
Created August 2, 2021 07:02 — forked from jmsaavedra/.gitignore
gitignore template
###################################
# general ignore patterns
###################################
build/
obj/
*.o
Debug*/
Release*/
*.mode*
@d68fbe50
d68fbe50 / android-backup-apk-and-datas.md
Created July 8, 2021 10:42 — forked from AnatomicJC/android-backup-apk-and-datas.md
Backup android app, data included, no root needed, with adb

Backup android app, data included, no root needed, with adb

adb is the Android CLI tool with which you can interact with your android device, from your PC

You must enable developer mode (tap 7 times on the build version in parameters) and install adb on your PC.

Fetch application APK

To get the list of your installed applications:

@d68fbe50
d68fbe50 / php7.4-fpm-alpine
Created June 7, 2021 03:09 — forked from jpswade/php7.4-fpm-alpine
PHP 7.4 PHP-FPM Alpine with core extensions gd
FROM php:7.4-fpm-alpine
# @see https://hub.docker.com/r/jpswade/php7.4-fpm-alpine
MAINTAINER Agent Software <dev@agentsoftware.net>
# Install gd, iconv, mbstring, mysql, soap, sockets, zip, and zlib extensions
# see example at https://hub.docker.com/_/php/
RUN apk add --update \
$PHPIZE_DEPS \
freetype-dev \
git \

Screen Quick Reference

Basic

Description Command
Start a new session with session name screen -S <session_name>
List running sessions / screens screen -ls
Attach to a running session screen -x
Attach to a running session with name screen -r

In redhat, if you need build container from base image, for example, registry.access.redhat.com/rhel7/rhel:7.3-53 (free download from https://access.redhat.com/containers) You have to build this image on a red hat server with subscription managed registered.

Here is the way to bypass the check and you can build docker image on any redhat 7 server.

make sure the package has been installed

yum install rh-amazon-rhui-client

list the package files