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
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
@notsobad
notsobad / fetch.js
Created Jul 22, 2018
Page parser using headless chrome.
View fetch.js
const puppeteer = require('puppeteer');
const url = process.argv[2];
//console.log(url);
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto(url, {waitUntil: 'networkidle0'});
await page.waitFor(1500);
@notsobad
notsobad / egpu.md
Last active Apr 8, 2018
install cude on nuc with AORUS gtx 1070 gaming box
View egpu.md

My setup:

  • NUC
  • AORUS gtx 1070 gaming box

It took me several days to install cuda, I have to reinstall nvidia driver、cuda、even  os serveral times. So I have some tips:

  • Read nvidia's cuda installation guide, Do not miss anything
  • Do not use the deb version of cude, Just use run file.
  • Install nvidia-390 driver first, then install cude by run file, it will ask you to install driver, say NO
You can’t perform that action at this time.