国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。Docker 官方和国内很多云服务商都提供了国内加速器服务。
Dockerized 实践 https://github.com/y0ngb1n/dockerized
Ubuntu 16.04+、Debian 8+、CentOS 7+
国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。Docker 官方和国内很多云服务商都提供了国内加速器服务。
Dockerized 实践 https://github.com/y0ngb1n/dockerized
Ubuntu 16.04+、Debian 8+、CentOS 7+
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <fcntl.h> | |
#include <linux/input.h> | |
#include <time.h> | |
#include <stdint.h> | |
int main(int argc, char* argv[]){ | |
sleep(1); |
# EDIT 10/04/2022 - This version was provided by @jayelm who fixed some bugs and made the function much more robust | |
import os | |
import subprocess | |
import time | |
def assign_free_gpus(threshold_vram_usage=1500, max_gpus=2, wait=False, sleep_time=10): | |
""" | |
Assigns free gpus to the current process via the CUDA_AVAILABLE_DEVICES env variable | |
This function should be called after all imports, |
I. Giới thiệu Git: | |
* Tóm tắt: | |
- Git dùng để quản lý phiên bản code, rất thuận lợi trong làm việc nhóm thậm chí làm 1 mình. | |
Git có nhiều trang hỗ trợ như: github.com, bitbucket.com, ... không phải git là chỉ riêng trang github, git giống như là 1 chuẩn | |
quản lý phiên bản, ngoài ra còn có SVN là 1 chuẩn khác để quản lý phiên bản (theo cách hiểu của t). | |
II. Các khái niệm trong git: | |
+ Repository (kho): là thư mục. Thư mục trên github.com gọi là remote (xa) repository (kho), còn ở máy tính là local repository. | |
+ Branch (nhánh): ví dụ t làm 1 phần trên 1 nhánh, m rẽ sang nhánh khác làm chức năng khác, sau này hộp lại (merge) | |
+ Remote (máy chủ): khỏi giải thích, lát ví dụ | |
+ add (thêm): sau khi làm gì đó thay đổi thì add (thêm) cái thay đổi đó vào |
#!/usr/bin/env bash | |
# Author Amaury Balmer - BEAPI.fr | |
# See: https://wordpress.stackexchange.com/questions/195046/relaunch-4-2-utf8mb4-databse-upgrade/244992#244992 | |
# Purpose - Convert all tables to UTF8MB4 with WP-CLI | |
# Create array of all tables | |
WPTABLES=($(wp db tables --all-tables)) | |
# loop through array and alter tables | |
for WPTABLE in ${WPTABLES[@]} |
// ==UserScript== | |
// @name noVNC Paste for Proxmox | |
// @namespace http://tampermonkey.net/ | |
// @version 0.2a | |
// @description Pastes text into a noVNC window (for use with Proxmox specifically) | |
// @author Chester Enright | |
// @match https://* | |
// @include /^.*novnc.*/ | |
// @require http://code.jquery.com/jquery-3.3.1.min.js | |
// @grant none |
When Riot Games introduces the Vanguard anti-cheat to League of Legends, you should STOP playing and you should not install the anti-cheat when you get the pop-up. Vanguard is a kernel-level anticheat and these anticheats operate at a privilege level HIGHER THAN YOUR OWN. The anti-cheat can do things that even you can't do, without asking or letting you know. It's like Riot installing a camera in every room of your house and getting a copy of every key inside.
Here is just one example of what they can do: https://www.theregister.com/2013/11/20/esea_gaming_bitcoin_fine/
1) Edit file postgresql.conf and add the next 3 lines (any where): | |
shared_preload_libraries = 'pg_stat_statements' | |
pg_stat_statements.max = 10000 | |
pg_stat_statements.track = all | |
2) Restart PostgreSQL | |
3) Execute the next command on psql, pgAdmin or similar: |