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
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
# Author: David Manouchehri <manouchehri@protonmail.com> | |
# This script will always echo back data on the UDP port of your choice. | |
# Useful if you want nmap to report a UDP port as "open" instead of "open|filtered" on a standard scan. | |
# Works with both Python 2 & 3. | |
import socket |
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
ipset list | tail -n +9 - | xargs -I X vppctl glx overlay route add table 1024 X/32 acc tunnel1 1 |
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 | |
logger -t "dnsmasqlivecheck" "dnsmasq live check run" | |
if [[ ! -f /run/dnsmasq/dnsmasq.pid ]]; then | |
logger -t "dnsmasqlivecheck" "dnsmasq pid not present, restart" | |
systemctl restart dnsmasq | |
exit 1 | |
fi |
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
比如: | |
定义一个单链表,链表上一共有10个节点,每个节点是对应的数字编号(1到10),要求实现从链表尾部打印编号的程序,也即打出的结果是10到1。 | |
要求: |
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
rrdtool create latency_db.rrd \ | |
--step 180 \ | |
DS:pl:GAUGE:540:0:100 \ | |
DS:rtt:GAUGE:540:0:10000000 \ | |
RRA:MAX:0.5:1:500\ | |
#!/bin/bash | |
# | |
### set the paths | |
command="/bin/ping -q -n -c 3" |
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
version: '3' | |
services: | |
elasticsearch: | |
image: docker.elastic.co/elasticsearch/elasticsearch:7.13.1 | |
restart: unless-stopped | |
hostname: NODE_NAME | |
ulimits: | |
memlock: | |
soft: -1 | |
hard: -1 |
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
# ns0 | |
ip netns del natns0 | |
ip netns add natns0 | |
ip netns exec natns0 ip link set lo up | |
ip link add natp0 type veth peer name natp0p | |
ip link set natp0 netns natns0 | |
ip link set natp0p up | |
ip netns exec natns0 ip link set natp0 up | |
ip netns exec natns0 ip link set natp0 address 80:88:88:88:88:88 | |
ip netns exec natns0 ip addr add 10.1.1.1/24 dev natp0 |
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 sys | |
# choose() is the same as computing the number of combinations. Normally this is | |
# equal to: | |
# | |
# factorial(N) / (factorial(m) * factorial(N - m)) | |
# | |
# but this is very slow to run and requires a deep stack (without tail | |
# recursion). | |
# |
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
-----BEGIN RSA PRIVATE KEY----- | |
MIIEogIBAAKCAQEAyANWv5g2/AyV28I+l4Tfk5tnCVdCJt6RMTjMPo7CO3cymvTS | |
a4IClFR7+ArdpcWHLaNBSZYBn7dOmGKwCdOO8y7/i3P83h4mc+y67BMPsKm7+TKs | |
Klck/Ssy7cm8mCUs9Y5OuMiX7FDWEf0uzRzwN3OXbb2pU3/iMeD6j48PgTwwVlEu | |
lgr21GwjvLlBU00iKDH8fwq7NYxLJdhuXc0sbkTEZZcA6kRwfSwq4Q9iY5DGeMkJ | |
TT1L53XCAax0yUCsX0K3I5vP33RJ/M9GxpWBKYohk6lnHtf4n/Nst+EN7XkL8baf | |
7g1zTwXkt9FrqJgmyBmCQ1gTKBbjGPy0v2TniwIDAQABAoIBAGlUoM17SpGHyy+U | |
5sOCfP9N2oAnzLWNhibGw4C6S31nc2X5QgrNx6/3oeVpS3puQJb/H3WyIp7KuQA1 | |
EIHMQL6+ZGM7LNKITDXGWFXUX/HoIQ7F6bbOd7M/ma1yDPiOs1OJotlbAe64T1Pf | |
4lKwR6zcGcX4GIDZmvQrh6gsbbzfV1v/sVkSUJAWUXs5O7NMTj8UqMDZGx0bv9DX |
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
#!/usr/bin/env bash | |
# Step 1: Fill in EMAIL, TOKEN, DOMAIN and SUBDOMAIN. Your API token is here: https://www.cloudflare.com/a/account/my-account | |
# Make sure the token is the Global token, or has these permissions: #zone:read, #dns_record:read, #dns_records:edit | |
# Step 2: Create an A record on Cloudflare with the subdomain you chose | |
# Step 3: Run "./ddns.sh -l" to get the zone_id and rec_id of the record you created. | |
# Fill in ZONE_ID and REC_ID below | |
# This step is optional, but will save you 2 requests every time you this script | |
# Step 4: Run "./ddns.sh". It should tell you that record was updated or that it didn't need updating. | |
# Step 5: Run it every hour with cron. Use the '-s' flag to silence normal output |
NewerOlder