Skip to content

Instantly share code, notes, and snippets.

notsobad notsobad

Block or report user

Report or block notsobad

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@notsobad
notsobad / filter-tls-1.0.sh
Created Nov 22, 2019
过滤tls1.0的client hello数据包
View filter-tls-1.0.sh
# 过滤tls1.0的client hello数据包,参考https://www.netmeister.org/blog/tcpdump-ssl-and-tls.html
tcpdump -ni eth0 '((tcp[((tcp[12] & 0xf0) >>2)] = 0x16) && (tcp[((tcp[12] & 0xf0) >> 2)+1] = 0x03) && (tcp[((tcp[12] & 0xf0) >> 2)+9] = 0x03) && (tcp[((tcp[12] & 0xf0) >> 2)+10] = 0x01))'
View fizz-buzz.py
for i in range(100):
n = i + 1
out = []
if n % 3 == 0:
out.append('fizz')
if n % 5 == 0:
out.append('buzz')
if not out:
@notsobad
notsobad / wx.py
Last active Nov 19, 2019
企业微信群机器人消息,python wx.py `now is date`
View wx.py
import sys
import json
import requests
API_URL = 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=XXXXXXXXXX'
def send_msg(msg):
obj = {
"msgtype": "text",
View vagrant-init.sh
#!/bin/bash
cat <<EOF > /etc/apt/sources.list
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
View test-cdn.sh
#!/bin/bash
url=$1
argc=$#
argv=($@)
host=`echo $url | awk -F[/:] '{print $4}'`
for ((i=1; i<argc; i++)); do
ip=${argv[i]}
final_url=`echo $url | sed "s/$host/$ip/"`
View mmdb-test.pl
#!/usr/bin/env perl
use strict;
use warnings;
use feature qw( say );
use local::lib 'local';
use MaxMind::DB::Writer::Tree;
use Net::Works::Network;
View pms7003.ino
#include <PMS.h>
#include "PMS.h"
#include <SoftwareSerial.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2); // set the LCD address to 0x27 for a 16 chars and 2 line display
//SoftwareSerial Serial1(10, 11); // RX, TX
View arduino-tips.md

关于串口(UART):

  1. 波特率表示每秒钟传输多少bit信息,如9600,则一bit约0.1ms,及100微秒左右,可以在示波器中看到
  2. 信息格式为0 + 8bit信息 + 奇偶校验位(可选),信息传输顺序为从低位到高位, 10000010 即为 01000001,即16进制的41,10进制的65,即字符A
  3. Arduino 只有一个串口Serial,想使用Serial1就要用SoftwareSerial
  4. 如果串口(0, 1)接了传感器,有可能会上传代码失败,这是把接的设备去掉即可
  5. 操作LCD设备,发现只有LiquidCrystal_I2C这个好用些,如果在循环在某一行中写数据,需要先clear,否则会重影
View gen8.md
You can’t perform that action at this time.