Skip to content

Instantly share code, notes, and snippets.

View tboydar's full-sized avatar
🎯
Focusing

Dar tboydar

🎯
Focusing
View GitHub Profile
size(200,200);
line(random(200),random(200),random(200),random(200));
line(random(200),random(200),random(200),random(200));
line(random(200),random(200),random(200),random(200));
line(random(200),random(200),random(200),random(200));
line(random(200),random(200),random(200),random(200));
line(random(200),random(200),random(200),random(200));
saveFrame("dar_0308a.jpg");
@tboydar
tboydar / README.md
Created November 18, 2020 12:38 — forked from nicejade/README.md
Generate a good README

Generate a good README

Generate a good README use `npx` commmd.

/*****************************************************************************/
// Function: Get the accelemeter of the x/y/z axis.
// Hardware: Grove - 3-Axis Analog Accelerometer
// Arduino IDE: Arduino-1.0
// Author: Frankie.Chu
// Date: Jan 11,2013
// Version: v1.0
// by www.seeedstudio.com
//
// This library is free software; you can redistribute it and/or
/*
這個程式的目標是希望可以激起程式高手願意修改我的程式的熱情。
arduino tutorial: https://www.arduino.cc/en/Tutorial/BuiltInExamples/Button
電路圖參考: https://fritzing.org/projects/digital-input-button/
*/
#define buttonPin 12
#define ledPin 13
#define digitalWrite myWrite
int a = 0; // 你是
void setup() {
pinMode(13, OUTPUT);
}
void loop() {
digitalWrite(13, HIGH);
delay(100); // 1000ms = 1s , 100ms = 0.1s
digitalWrite(13, LOW);
delay(100); // 1000ms = 1s , 100ms = 0.1s
}
int i = 0;
float r=random(255);
float g=random(255);
float b=random(255);
void setup() {
size(300, 300);
noStroke();
frameRate(1000);
}
{"dist":"0.633500"}
{"dist":"0.633667"}
{"dist":"0.633833"}
{"dist":"0.634000"}
{"dist":"0.634167"}
{"dist":"0.634333"}
{"dist":"0.634500"}
{"dist":"0.634667"}
{"dist":"0.634833"}
{"dist":"0.635000"}
# get total requests by status code
awk '{print $9}' /var/log/nginx/access.log | sort | uniq -c | sort -rn
# get top requesters by IP
awk '{print $1}' /var/log/nginx/access.log | sort | uniq -c | sort -rn | head | awk -v OFS='\t' '{"host " $2 | getline ip; print $0, ip}'
# get top requesters by user agent
awk -F'"' '{print $6}' /var/log/nginx/access.log | sort | uniq -c | sort -rn | head
# get top requests by URL
@tboydar
tboydar / _vultr-snapshot.md
Created March 29, 2019 08:12 — forked from Rhilip/_vultr-snapshot.md
Automatic snapshots using Vultr API (Python3)

Thanks to Automated Snapshots / Backups via Vultr API And this is Python3 version script used to Automatic snapshots using Vultr API


A more customizable alternative to Vultr's backup feature using Vultr API v1. Tested on Ubuntu 16.04. Run this python3 script on Anywhere to create a snapshot of VPS (which you know IP or it's subid) and rotate out the oldest snapshot(s). Use the BACKUP_TAG_PREFIX prefix field to uniquely id a set of snapshots.

Notice: You can only create 11 snapshots by default.


@tboydar
tboydar / clone-all-twitter-github-repos.sh
Created January 13, 2019 15:55 — forked from caniszczyk/clone-all-twitter-github-repos.sh
Clone all repos from a GitHub organization
curl -s https://api.github.com/orgs/twitter/repos?per_page=200 | ruby -rubygems -e 'require "json"; JSON.load(STDIN.read).each { |repo| %x[git clone #{repo["ssh_url"]} ]}'