# fix wrong driver
echo '{ "storage-driver": "devicemapper" }' | sudo tee /etc/docker/daemon.json
sudo systemctl restart docker.service
# fix aliyun buggy selinux
sudo sed -i 's/SELINUXTYPE=mcs/SELINUXTYPE=targeted/' /etc/selinux/config
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
import 'dart:async'; | |
import 'package:flutter/cupertino.dart'; | |
import 'package:flutter/material.dart'; | |
class CustomToast { | |
static OverlayEntry _overlayEntry; | |
static OverlayEntry _overlayEntry1; | |
static bool isVisible = false; | |
static Timer _timer; |
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get install postgresql-13 postgresql-13-postgis-3
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout server.key -out server.crt
f, err := ioutil.TempFile("", uuid+".*.pdf")
if err != nil {
log.Print("ioutil.TempFile(): ", err)
return
}
// Write the body to file
if _, err = io.Copy(f, buffReader); err != nil {
log.Print("io.Copy(): ", err)
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
-- turn off paging (less/more) | |
psql> \pset pager off | |
/* | |
Pager usage is off. | |
*/ | |
-- find an object name by id | |
SELECT OID, relname |
SCP Over :
scp "ProxyCommand ssh <jumphost> -W %h:%p" <src> <dest>
RSYNC Over :
rsync -azv -P -e 'ssh -o "ProxyCommand ssh -A <jumphost> -W %h:%p"' <src> <dest>
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
import 'package:intl/intl.dart'; | |
/// An utility calss that manages specific formats. | |
class DateFormats { | |
/// The [DateFormat] 'yyyy-MM-dd HH:mm:ss'. | |
static final fullDateFormat = new DateFormat('yyyy-MM-dd HH:mm:ss'); | |
/// The [DateFormat] 'yyyy/MM/dd'. | |
static final onlyDayDateFormat = new DateFormat('yyyy/MM/dd'); |
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
import 'dart:ui'; | |
import 'package:flutter/cupertino.dart'; | |
import 'package:flutter/foundation.dart'; | |
class CacheMemoryImageProvider extends ImageProvider<CacheMemoryImageProvider> { | |
final String tag; //the cache id use to get cache | |
final Uint8List img; //the bytes of image to cache | |
CacheMemoryImageProvider(this.tag, this.img); |