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
| #include <atomic> | |
| #include <array> | |
| #include <vector> | |
| #include <cassert> | |
| #include <memory> | |
| #include <thread> | |
| #include <chrono> | |
| #include <cstdio> | |
| /*! |
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
| #!/bin/bash | |
| read -r -d '' data << EOF | |
| { | |
| "execution_type": "sync", | |
| "commands": [ | |
| "show lldp remote", | |
| "show running-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
| ./bootstrap.sh | |
| ./b2 tools/bcp | |
| mkdir ../extract | |
| dist/bin/bcp build chrono coroutine context log predef headers tools/boost_install ../extract | |
| ./bootstrap.sh --with-libraries=coroutine | |
| ./b2 --prefix=./dist --build-type=minimal variant=release link=static debug-symbols=on coroutine install -j 4 | |
| g++ b.cc -o b -g -Iextract/dist/include -Lextract/dist/lib/ -lboost_coroutine -lboost_context -lboost_thread |
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
| // usage: open chrome console, paste this and enter | |
| const WORD_PER_PAGE = 10; | |
| const START_PAGE = 1; | |
| const END_PAGE = 10; | |
| const BOOK_ID = 'tvbmg'; | |
| // const WORD_LIST_TYPE = 4; // 今日新词 | |
| const WORD_LIST_TYPE = 5; // 今日复习 | |
| function playItHere(e, link) { |
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
| " Copyright 2014 Google Inc. All rights reserved. | |
| " Copyright 2019 Jingrong Chen [email protected] | |
| " | |
| " Licensed under the Apache License, Version 2.0 (the "License"); | |
| " you may not use this file except in compliance with the License. | |
| " You may obtain a copy of the License at | |
| " | |
| " http://www.apache.org/licenses/LICENSE-2.0 | |
| " | |
| " Unless required by applicable law or agreed to in writing, software |
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
| [Unit] | |
| Description=Btrfs snapshot | |
| [Service] | |
| Type=oneshot | |
| ExecStart=/usr/local/bin/do-btrfs-snapshot.sh | |
| StandardOutput=journal | |
| [Install] | |
| WantedBy=multi-user.target |
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
| While a GnuPlot window is active, you can press certain keys to perform certain actions: | |
| a | |
| Auto-scale to full x and y range (based on x and y values) and replot | |
| b | |
| Toggle between thick border (2 pixels wide) and thin border (1 pixel wide) | |
| g | |
| Toggle grid lines | |
| h | |
| Display help in Davinci |
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
| #!/usr/bin/env python3 | |
| import subprocess | |
| import threading | |
| import shlex | |
| import time | |
| import argparse | |
| hosts = [ | |
| '192.168.211.2', | |
| '192.168.211.34', |
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
| # /etc/udev/rules.d/71-k380-keyboard.rules | |
| ACTION=="add", KERNEL=="hidraw[0-9]*", RUN+="/usr/bin/su cjr -c \"DISPLAY=:1 XAUTHORITY=/home/cjr/.Xauthority xset r rate 200 36\"" | |
| ACTION=="add", KERNEL=="hidraw[0-9]*", RUN+="/usr/bin/su cjr -c \"DISPLAY=:1 XAUTHORITY=/home/cjr/.Xauthority setxkbmap -option 'ctrl:nocaps'\"" |
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
| #!/bin/bash | |
| WORKDIR=$(dirname `realpath $0`) | |
| CMD=$* | |
| env ${CMD} | |
| status=$? | |
| if [ $status -eq 0 ]; then | |
| STATUS_PARAM="--success" |