Skip to content

Instantly share code, notes, and snippets.

View xiaoruiguo's full-sized avatar

xiaoruiguo xiaoruiguo

View GitHub Profile
@xiaoruiguo
xiaoruiguo / ssl.go
Created June 11, 2021 08:29 — forked from MrSuicideParrot/ssl.go
Example of parsing TLS packets using gopacket library with tcpassembly
package main
import (
"bufio"
"encoding/binary"
"fmt"
"github.com/google/gopacket"
"github.com/google/gopacket/layers"
"github.com/google/gopacket/pcap"
"github.com/google/gopacket/tcpassembly"
package main
import (
"bytes"
"fmt"
"log"
"github.com/google/gopacket"
"github.com/google/gopacket/pcap"
)
@xiaoruiguo
xiaoruiguo / Event_Loop.md
Created June 3, 2021 06:01 — forked from kassane/Event_Loop.md
Explain Event Loop

Event Loop

In computer science, the event loop, message dispatcher, message loop, message pump, or run loop is a programming construct that waits for and dispatches events or messages in a program.

It works by making a request to some internal or external "event provider" (that generally blocks the request until an event has arrived), and then it calls the relevant event handler ("dispatches the event").

The event-loop may be used in conjunction with a reactor, if the event provider follows the file interface, which can be selected or 'polled' (the Unix system call, not actual polling).

The event loop almost always operates asynchronously with the message originator.

@xiaoruiguo
xiaoruiguo / wget
Created June 1, 2021 09:04 — forked from ssaadh/wget
Wget examples
#Spider Websites with Wget – 20 Practical Examples
Wget is extremely powerful, but like with most other command line programs, the plethora of options it supports can be intimidating to new users. Thus what we have here are a collection of wget commands that you can use to accomplish common tasks from downloading single files to mirroring entire websites. It will help if you can read through the wget manual but for the busy souls, these commands are ready to execute.
1. Download a single file from the Internet
wget http://example.com/file.iso
2. Download a file but save it locally under a different name
wget ‐‐output-document=filename.html example.com
@xiaoruiguo
xiaoruiguo / # Vuex 4 -> Vue3 & TS.md
Created May 20, 2021 01:44 — forked from luna-koury/# Vuex 4 -> Vue3 & TS.md
Vuex 4 - Boilerplate Typescript

Vuex 4 boilerplate using Vue3 and typed modules with TypeScript

With Modules

📦src
 ┣ 📂store
 ┃ ┣ 📂modules
 ┃ ┃ ┗ 📂generic_module
 ┃ ┃ ┃ ┣ 📜actions.ts
 ┃ ┃ ┃ ┣ 📜getters.ts
 ┃ ┃ ┃ ┣ 📜index.ts
@xiaoruiguo
xiaoruiguo / README.md
Created May 4, 2021 07:56 — forked from danielepolencic/README.md
Create 3 nodes Kubernetes cluster locally with Vagrant

3 Virtual Machines Kubernetes cluster

Dependencies

You should install VirtualBox and Vagrant before you start.

Creating the cluster

You should create a Vagrantfile in an empty directory with the following content:

@xiaoruiguo
xiaoruiguo / git_newrepo
Created March 24, 2021 02:06 — forked from c0ldlimit/git_newrepo
Git: Push a new or existing repo to Github
# Create a new repository on the command line
touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/c0ldlimit/vimcolors.git
git push -u origin master
# Push an existing repository from the command line
.
├── docker/ # Contains docker image in which all the CI jobs will run
├── hack/ # Contains small hack scripts used in a wide range of jobs
├── hello.go
├── hello_test.go
├── Dockerfile
├── Makefile
├── prow
│ ├── cluster/ # Install prow on k8s cluster
│ ├── jobs/ # CI jobs config
presubmits:
kubernetes/community:
- name: pull-community-verify # convention: (job type)-(repo name)-(suite name)
branches:
- master
decorate: true
always_run: true
spec:
containers:
- image: golang:1.12.5
@xiaoruiguo
xiaoruiguo / config.yaml
Created February 23, 2021 21:50 — forked from Devops-continens/config.yaml
Prow Config
periodics:
- interval: 10m
  name: echo-test
  decorate: true
  spec:
    containers:
    - image: alpine
      command: ["/bin/date"]
presubmits:
  Devops-continens/Prow-tutorial: