注意:本文内容适用于 Tmux 2.3 及以上的版本,但是绝大部分的特性低版本也都适用,鼠标支持、VI 模式、插件管理在低版本可能会与本文不兼容。
启动新会话:
tmux [new -s 会话名 -n 窗口名]
恢复会话:
#!/bin/bash | |
# Used to create a Anaconda virtual environment for CUDA and TensorFlow. | |
# If you want to use this shell script, please read the blog. | |
# https://bluesmilery.github.io/blogs/a687003b/ | |
echo "" | |
echo "This script is used to create a Anaconda virtual environment for CUDA and TensorFlow." | |
echo "" | |
read -p "Enter the name of Anaconda virtual environment: " ENV_NAME |
If you cannot install Intel VTune Amplifier on Manjaro/Arch Linux (or other non-supported OS), because this shit cannot find installed libraries via ldconfig -p
, you can use this script.
Unpack vtune_amplifier_2019_update3.tar.gz
, then go to vtune_amplifier_2019_update3
, then copy and paste following:
shopt -s globstar
for i in **/sysreq.cab; do
echo "processing ${i}"
perl -pi -e 's/(\W*)RESULT=255(.*)/\1RESULT=1 \2/' "${i}" # COMPARE_VERSIONS() never returns 255
perl -pi -e 's/(\W*)LI_(.+)=unsupp(.*)/\1LI_\2=ok \3/' "${i}"
// This gist is a reminder to myself about the differences between throttling and debouncing, inspired by | |
// https://redd.one/blog/debounce-vs-throttle | |
// | |
// A runnable example is available here: https://play.golang.org/p/sADDu829fRa | |
package main | |
import ( | |
"fmt" | |
"time" | |
) |
import hashlib | |
import struct | |
import sqlite3 | |
def md5hash(buf): | |
return hashlib.md5(buf.encode("utf-16")[2:]).digest() | |
def md5cmp(buf, postfix, a1, a2, a3, a4): | |
if len(buf) < postfix: | |
return False |
/** | |
*Submitted for verification at Etherscan.io on 2021-09-05 | |
*/ | |
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.0; | |
/// [MIT License] | |
/// @title Base64 |
pragma solidity 0.8.0; | |
import "@openzeppelin/contracts/utils/Strings.sol"; | |
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; | |
import "@openzeppelin/contracts/utils/Counters.sol"; | |
import "hardhat/console.sol"; | |
// We need to import the helper functions from the contract that we copy/pasted. | |
import { Base64 } from "./libraries/Base64.sol"; |
// This is a basic uniswap frontrunning MEV bot | |
// Made by Merunas follow me on youtube to see how to use it and edit it: https://www.youtube.com/channel/UCJInIwgW1duAEnMHHxDK7XQ | |
// 1. Setup ethers, required variables, contracts and start function | |
const { Wallet, ethers } = require('ethers') | |
const { FlashbotsBundleProvider, FlashbotsBundleResolution } = require('@flashbots/ethers-provider-bundle') | |
// 1.1 Setup ABIs and Bytecodes | |
const UniswapAbi = [{"inputs":[{"internalType":"address","name":"_factory","type":"address"},{"internalType":"address","name":"_WETH","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"uint256","name":"amountADesired","type":"uint256"},{"internalType":"uint256","name":"amountBDesire |