服务器A无公网IP但能访问外网,服务器B有公网IP。目标:通过 SSH 到服务器B的 2222 端口即可访问服务器A,同时限制服务器A只能建立反向隧道,不能执行任何命令。
You are an expert Git commit message generator, specializing in creating concise and informative commit messages based on Git diffs. Your purpose is to provide clear, actionable commit messages.
- Start the commit message with an uppercase letter.
- Write a single, concise sentence for the commit message.
- Keep the commit message under 60 characters if possible.
- Use present tense in the message.
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
| func appendStringsIfMissing(slice []string, elements ...string) (out []string) { | |
| out = slice | |
| outer: | |
| for _, element := range elements { | |
| for _, e := range slice { | |
| if e == element { | |
| continue outer | |
| } | |
| } | |
| out = append(out, element) |
# install parallel if you don't have one
brew install parallel
chmod +x convert.sh
./convert.sh
# delete opus files
find . -type f -name '*.opus' -delete
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
| require 'http' | |
| require 'openssl' | |
| require 'digest/md5' | |
| module WxPay | |
| class << self | |
| attr_accessor :appid, :mch_id, :key, :appsecret | |
| attr_reader :apiclient_cert, :apiclient_key | |
| def apiclient_cert=(cert) |
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
| module github.com/caiguanhao/fake-req | |
| go 1.14 | |
| require github.com/google/uuid v1.1.1 |
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
| host = 'host' | |
| user = 'user' | |
| options = { | |
| keys_only: true, | |
| keys: [], | |
| key_data: [ server_ssh_private_key ], | |
| user_known_hosts_file: [], | |
| known_hosts: Class.new do | |
| def self.search_for(host, options={}) | |
| fingerprint = server_ssh_fingerprint.split(/\s+/).last |
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
| const { RawSource } = require('webpack-sources') | |
| class WebpackAssetsManifest { | |
| apply (compiler) { | |
| compiler.hooks.emit.tapAsync('WebpackAssetsManifest', (compilation, callback) => { | |
| let entrypoints = compilation.entrypoints | |
| for (const [name, entrypoint] of entrypoints) { | |
| const js = [] | |
| const css = [] | |
| entrypoint.getFiles().forEach(file => { |
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
| # gem 'http' | |
| def send_tencent!(country_code, cellphone, code) | |
| number = "+#{country_code}#{cellphone}" | |
| json = { | |
| PhoneNumberSet: [ number ], | |
| TemplateID: '<YOUR TEMPLATE ID>', | |
| TemplateParamSet: [ code.to_s ], | |
| SmsSdkAppid: Rails.application.credentials.tencent_cloud_sms_app_id, | |
| }.to_json |
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
| let style = document.createElement('style') | |
| document.head.appendChild(style) | |
| document.addEventListener('scroll', () => { | |
| let table = document.querySelector('.table') | |
| if (!table) return | |
| let navbar = document.querySelector('.navbar') | |
| if (!navbar) return | |
| let offset = table.getBoundingClientRect().top + window.scrollY - navbar.offsetHeight | |
| let second = document.querySelector('.table > thead > tr:nth-child(2) > th') | |
| let secondOffset = 0 |
NewerOlder