Skip to content

Instantly share code, notes, and snippets.

View summer20100514's full-sized avatar
🎯
Focusing

summerxu summer20100514

🎯
Focusing
View GitHub Profile
@summer20100514
summer20100514 / check_con.sh
Created June 6, 2023 02:22 — forked from ankel/check_con.sh
Cron job that runs once every 10m and reset wlan0 if no internet connection is detected
#!/bin/bash
ping -c 1 google.com > /dev/null & wait $!
if [ $? != 0 ]; then
echo "$(date) Wifi down, resetting" >> /var/log/wifi.log
sudo ifdown wlan0 & wait $!
sudo ifup wlan0 & wait $!
else echo "$(date) Wifi up" >> /var/log/wifi.log
fi
@summer20100514
summer20100514 / Makefile
Created November 24, 2020 08:32 — forked from isaacs/Makefile
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@summer20100514
summer20100514 / win-ss
Created June 22, 2020 13:10 — forked from dreamlu/win-ss
windows终端翻墙,简易方式
环境:shadowsocks、windows
本地ss端口设置(这里1080)
cmd命令行:(不用socks5)(临时设置)(也可放置环境变量)
set http_proxy=http://127.0.0.1:1080
set https_proxy=http://127.0.0.1:1080
ps:一定要用cmd命令行,千万别用powershell !!!
简易测试命令:curl https://www.google.com(别用ping)
@summer20100514
summer20100514 / Ninebot_BMS_Emulator.ino
Created March 3, 2020 09:34 — forked from nopbxlr/Ninebot_BMS_Emulator.ino
Ninebot_BMS_Emulator (STILL WIP)
#define BAUDRATE 115200
#define PRE_MSB 0x5A
#define PRE_LSB 0xA5
#define CMD_READ 0x01
#define CMD_WRITE 0x02
#define CMD_REPLY 0x04
#define CMD_WR_REPLY 0x05
#define c_MIN_BATT_V 3500
#define c_MAX_BATT_V 4200
#define c_BATT_CAP 15300
@summer20100514
summer20100514 / configure_muliple_gcc.sh
Created March 3, 2020 06:26 — forked from SunnyRaj/configure_muliple_gcc.sh
Configure multiple GCC versions on ubuntu
#!/usr/bin/env bash
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt update
sudo update-alternatives --remove-all gcc
sudo update-alternatives --remove-all g++
sudo apt-get install -y gcc-4.8 g++-4.8 gcc-4.9 g++-4.9 gcc-5 g++-5 gcc-6 g++-6 gcc-7 g++-7
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 10
@summer20100514
summer20100514 / m3u8.md
Created May 3, 2019 15:15 — forked from primaryobjects/m3u8.md
How to download m3u8 and ts video movie streams.

m3u8 Downloading

  1. Open Chrome Developer tools and click the Network tab.
  2. Navigate to the page with the video and get it to start playing.
  3. Filter the list of files to "m3u8".
  4. Find master.m3u8 or index.m3u8 and click on it.
  5. Save the file to disk and look inside it.
  6. If the file contains a single m3u8 master url, copy that one instead.
  7. Run the program m3u8x.
  8. Paste the same m3u8 url in both textboxes (URL and Quality URL) and click "Headers" and set the referral url and user-agent from the request as found in Chrome.
#coding=utf-8
string = "{\"results\":[{\"location\":{\"id\":\"WX4FBXXFKE4F\",\"name\":\"北京\",\"country\":\"CN\",\"path\":\"北京,北京,中国\",\"timezone\":\"Asia/Shanghai\",\"timezone_offset\":\"+08:00\"},\"now\":{\"text\":\"晴\",\"code\":\"0\",\"temperature\":\"0\"},\"last_update\":\"2016-12-16T10:00:00+08:00\"}]}"
string2 = "{\"results\":[{\"location\":{\"id\":\"WX4FBXXFKE4F\",\"name\":\"Beijing\",\"country\":\"CN\",\"path\":\"Beijing,Beijing,China\",\"timezone\":\"Asia/Shanghai\",\"timezone_offset\":\"+08:00\"},\"now\":{\"text\":\"Sunny\",\"code\":\"0\",\"temperature\":\"1\"},\"last_update\":\"2016-12-16T10:10:00+08:00\"}]}"
print string
print len(string)
print ' '
print string2
@summer20100514
summer20100514 / hash.c
Created November 21, 2015 05:27 — forked from tonious/hash.c
A quick hashtable implementation in c.
#define _XOPEN_SOURCE 500 /* Enable certain library functions (strdup) on linux. See feature_test_macros(7) */
#include <stdlib.h>
#include <stdio.h>
#include <limits.h>
#include <string.h>
struct entry_s {
char *key;
char *value;
#!/usr/bin/env python
# coding=utf8
# author=evi1m0
# website=linux.im
'''
12306 Captcha Picture:
author: Evi1m0@20150316
1. Download Captcha
2. Pic Conver Text