This file contains 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
import uuid | |
import json | |
import requests | |
# 测速点ID,可以自己覆盖,默认选系统最优. | |
server_id = json.loads(requests.get('https://cli.speedtest.net/api/cli/config').text)['servers'][0]['id'] | |
# 下载速度(Mbps) | |
download_speed = 1000 |
This file contains 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
<?php | |
namespace App\Payments; | |
class Payjs { | |
public function __construct($config) | |
{ | |
$this->config = $config; | |
} | |
public function form() |
This file contains 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
user daemon | |
pidfile /var/tmp/sniproxy.pid | |
error_log { | |
syslog daemon | |
priority notice | |
} | |
resolver { | |
nameserver 8.8.8.8 | |
nameserver 8.8.4.4 # local dns should be better | |
mode ipv6_first |
This file contains 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 "stm32l4xx_ll_i2c.h" | |
#include "stm32l4xx_ll_crs.h" | |
#include "stm32l4xx_ll_rcc.h" | |
#include "stm32l4xx_ll_bus.h" | |
#include "stm32l4xx_ll_system.h" | |
#include "stm32l4xx_ll_exti.h" | |
#include "stm32l4xx_ll_cortex.h" | |
#include "stm32l4xx_ll_utils.h" | |
#include "stm32l4xx_ll_pwr.h" | |
#include "stm32l4xx_ll_dma.h" |
This file contains 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 "board.h" | |
#include "mem_tests.h" | |
/***************************************************************************** | |
* Public types/enumerations/variables | |
****************************************************************************/ | |
static volatile uint8_t channelTC, dmaChannelNum; | |
uint32_t DMAbuffer[255]; | |
uint16_t dataADC; |
This file contains 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 (C) 2009-2011 Broadcom Corporation | |
* | |
* 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 | |
* |
This file contains 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 | |
cd /tmp | |
# 生成密钥 | |
wg genkey | tee privatekey | wg pubkey > publickey | |
# 服务器私钥 | |
ServerKey=`cat privatekey` | |
# 服务器公钥 | |
ServerPub=`cat publickey` |
This file contains 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
get_ip(){ | |
local IP=$( ip addr | egrep -o '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | egrep -v "^192\.168|^172\.1[6-9]\.|^172\.2[0-9]\.|^172\.3[0-2]\.|^10\.|^127\.|^255\.|^0\." | head -n 1 ) | |
[ -z ${IP} ] && IP=$( wget -qO- -t1 -T2 ipv4.icanhazip.com ) | |
[ -z ${IP} ] && IP=$( wget -qO- -t1 -T2 ipinfo.io/ip ) | |
echo ${IP} | |
} | |
install_dnsproxy(){ | |
apt -y install dnsmasq wget git autotools-dev cdbs debhelper dh-autoreconf dpkg-dev gettext libev-dev libpcre3-dev libudns-dev pkg-config fakeroot devscripts sniproxy |
This file contains 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 | |
Font_Black="\033[30m"; | |
Font_Red="\033[31m"; | |
Font_Green="\033[32m"; | |
Font_Yellow="\033[33m"; | |
Font_Blue="\033[34m"; | |
Font_Purple="\033[35m"; | |
Font_SkyBlue="\033[36m"; | |
Font_White="\033[37m"; |
This file contains 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
userdel -r admin | |
apt install smokeping | |
cat >/etc/systemd/system/smokeping.service <<EOF | |
[Unit] | |
Description=Smokeping Service, Network Latency Graphical Viewer | |
After=network.service | |
[Service] | |
Type=forking |