- on mysql1 (master), and mysql2 (replica)
- change server-id to 11 for mysql1, and 12 for mysql12 my.cnf
[mysqld]
default_authentication_plugin="mysql_native_password"
authentication_policy="caching_sha2_password"
slow_query_log
skip-name-resolve
-- SOURCE https://dba.stackexchange.com/questions/187446/sql-server-identifying-object-closest-to-the-end-of-a-datafile | |
SET NOCOUNT ON; | |
-- Create Temp Table to push DBCC PAGE results into | |
CREATE TABLE #dbccPage_output( | |
ID INT IDENTITY(1,1) | |
, [ParentObject] VARCHAR(255) |
https://stackoverflow.com/questions/5473/how-can-i-undo-git-reset-hard-head1 | |
```sh | |
$ git init | |
Initialized empty Git repository in .git/ | |
$ echo "testing reset" > file1 | |
$ git add file1 | |
$ git commit -m 'added file1' | |
Created initial commit 1a75c1d: added file1 |
# How to revert merge commit | |
- for keep uncommit | |
git reset --soft HEAD~1 | |
- for reverse to commit point | |
git reset --hard HEAD~1 | |
The secret is mode must be MJPG instead of default YUYV | |
```python | |
import cv2 | |
cap0 = cv2.VideoCapture('/dev/video0') | |
cap0.set(cv2.CAP_PROP_FOURCC, cv2.VideoWriter_fourcc(*'MJPG')) | |
cap0.set(cv2.CAP_PROP_FRAME_WIDTH, 1920) | |
cap0.set(cv2.CAP_PROP_FRAME_HEIGHT, 1080) |
# original from https://github.com/micropython/micropython-lib/blob/master/python-ecosys/urequests/urequests.py | |
import usocket | |
class Response: | |
def __init__(self, f, contentLength = -1, timeout=2): | |
self.raw = f | |
self.encoding = "utf-8" | |
self._cached = None |
import ujson as json | |
import uos as os | |
import usocket as socket | |
# original from https://gist.github.com/hiway/b3686a7839acca7d62e3a7234fdbb438 | |
def http_get_async(url): | |
_, _, host, path = url.split('/', 3) | |
if ':' in host: | |
host, port = host.split(':') |
function fibo(n) { | |
if (n <= 2) { | |
return 1 | |
} | |
let a = 1 | |
let b = 1 | |
for (let i = 3; i < n; i++) { | |
b = a + b | |
a = b - a |
https://github.com/felixrieseberg/windows-build-tools | |
npm --add-python-to-path --vs2017 install --global --production windows-build-tools |
DECLARE item_cursor CURSOR LOCAL FAST_FORWARD FOR | |
SELECT conversation_handle FROM dbo.DRTrueCSSAccptQ1 | |
OPEN item_cursor | |
DECLARE @conversation UNIQUEIDENTIFIER | |
FETCH NEXT FROM item_cursor INTO @conversation | |
WHILE @@FETCH_STATUS = 0 | |
BEGIN | |
END CONVERSATION @conversation WITH CLEANUP | |
FETCH NEXT FROM item_cursor INTO @conversation | |
END |