Skip to content

Instantly share code, notes, and snippets.

View nickfox-taterli's full-sized avatar
😰
想哭

Tater Li nickfox-taterli

😰
想哭
View GitHub Profile
@nickfox-taterli
nickfox-taterli / esp32_gpio_test.c
Created October 25, 2017 03:22
ESP32 Module GPIO Test
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "driver/gpio.h"
uint8_t test_io[] = {0, 2, 4, 5, 9, 12, 14, 17, 19, 22, 25, 27, 33};
void app_main()
@nickfox-taterli
nickfox-taterli / Ip4_frag_tmp.c
Created February 20, 2018 04:23
Ip4_frag_tmp.c
#include "lwip/opt.h"
#if LWIP_IPV4
#include "lwip/ip4_frag.h"
#include "lwip/def.h"
#include "lwip/inet_chksum.h"
#include "lwip/netif.h"
#include "lwip/stats.h"
#include "lwip/icmp.h"
@nickfox-taterli
nickfox-taterli / autodeny.sh
Created March 10, 2018 08:59
auto ip deny script
#!/bin/bash
#检测时间
SLEEP_TIME=10
#禁用阈值
NO_OF_CONNECTIONS=50
#禁用时长
BAN_PERIOD=300
#白名单
IGNORE_IP_LIST=/root/autodeny/allow_ip.txt
@nickfox-taterli
nickfox-taterli / cloud-config.yml
Created July 1, 2018 06:27
Core OS Linode 参考配置包
#cloud-config
# 修改主机名称
hostname: coreos-01
# 将主机名称在/etc/hosts里解析为127.0.0.1
manage_etc_hosts: localhost
# 此处的ssh_authorized_keys只对core用户生效
ssh_authorized_keys:
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAIAQC/4ta5TeTOwx/67x50bwKnZnXe96/6WlconkfDtjugFCNvWt83IqDF3FZ2yO5Dyl2Xz80pUH0iusOc+x3t755KrQAhDTUqX/Np0z5TIYijd5N++GQIzvF0DBYAnmfG+UzaayPg+d4xkqC38YCdoKLe1FCMaV0+v5ehgx2CJ+VtCJJvMHY2Eu//oI9WL5rDo1yGwuCCjztKFtgSerLmgRD1aeL/nCZooIkFnAgO5pTvuwfQECvN2ECyMwvPk9onzbOn4vQ4yic3I79Ae0UkPoq29hZPIgvjigXhE1/hwKUqI/eiFC5aiqwaaFbr8BNvioO6Pxss7Ltm7rnHwg167wVPxEVI/PIkHMFSzCKr0hAg4V3hsAlqOlJcvXEtY2PzePiOut34pdsGSBqipxeuc6hTbkSruYb75aHioDzMLpU6sw6ePijz0WPEq2rkj1+/RyTkBuRV/VqlA9sArWpv93HKf6szGtkbiOqXCxzia+EXYaWXLH/fOO30vElC4nPvZIhCzKB+KMpya/zLr4EeUOoq1woIj+WNv+TUdN0iWMDbWx2Vs5U+bp8JDOa9iPCceTDMVFnO+69bl7yw7lygm9QhfIGo0Yb0+Ce3TJ3ZuclaZwOjfPBjcCVFpfFnT8KdHJjN87hBE9w9vwI/Nn1Kso/pzJm+Dg1RJGmtRsuWD816RJzCkf2FSsiBi8/q6jnF8GwAULqMThv5Bhbat2yMb0lXKwjYQIHZnnSlpYqbitifdh9AAJTASKkPTtrZ2YAAWi+ArgEeWQi7aQpU+vRbXng0OjLBdDZYjP2kSxv8UgFtqoRHq4bX4lxa
@nickfox-taterli
nickfox-taterli / LEDBlink.c
Created July 8, 2018 13:24
LPC43xx SCT Blink
@nickfox-taterli
nickfox-taterli / MSP430_Flash_RW
Created July 8, 2018 13:25
MSP430G2553 Seg Flash R/W Code
#include <msp430.h>
#include <stdint.h>
void FlashErase(uint16_t addr)
{
FCTL3 = FWKEY;
FCTL1 = FWKEY + ERASE;
while(FCTL3 & BUSY);
*(uint8_t *)addr = 0;
FCTL1 = FWKEY;
@nickfox-taterli
nickfox-taterli / rpi-fbcp.c
Created August 30, 2018 08:07
fbcp for rpi
#include <stdio.h>
#include <syslog.h>
#include <sys/fcntl.h>
#include <sys/ioctl.h>
#include <linux/fb.h>
#include <sys/mman.h>
#include <bcm_host.h>
int process() {
@nickfox-taterli
nickfox-taterli / huawei_cloudtable.py
Created March 17, 2019 16:13
华为云Serverless版表格储存数据库
import urllib.request
import ssl
import json
import json
import base64
table_name = ''
token = ''
ep_url = 'https://hbase-cloudtable.cn-north-1.myhuaweicloud.com/v1/929213ae947c47de866553f0c025741d'
@nickfox-taterli
nickfox-taterli / power_fuck.sh
Last active March 21, 2019 10:00
Powerboard service fuck
#!/bin/sh
# wget -qO- https://git.io/fjf12 | sh
# curl -Lso- https://git.io/fjf12 | sh
if [ $(id -u) -ne 0 ]; then
printf "Script must be run as root or sudo."
exit 1
fi
@nickfox-taterli
nickfox-taterli / shadow_sample.c
Last active June 14, 2019 08:20
shadow_sample for docker pi relay
/*
* Tencent is pleased to support the open source community by making IoT Hub available.
* Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved.
* Licensed under the MIT License (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/MIT
* Unless required by applicable law or agreed to in writing, software distributed under the License is
* distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,