Skip to content

Instantly share code, notes, and snippets.

View yaobinwen's full-sized avatar

Yaobin Wen yaobinwen

View GitHub Profile
@yaobinwen
yaobinwen / README.md
Created November 25, 2023 15:45 — forked from erkal/README.md
Random Graph Generator

Random Graph Generator

Click anywhere to generate a new random graph.

  • The nodes are colored by the number of their neighbors.
  • Nodes with higher number of neighbours are bigger.
@yaobinwen
yaobinwen / github_load_all_diffs.js
Created November 29, 2022 21:41 — forked from juanca/github_load_all_diffs.js
Github PR bookmarklet: Load all file diffs
javascript:
document.querySelectorAll('.load-diff-button').forEach(node => node.click())
@yaobinwen
yaobinwen / postgres-cheatsheet.md
Created September 26, 2022 15:26 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@yaobinwen
yaobinwen / test_sudo_and_variables.yml
Created August 12, 2021 14:37 — forked from ramondelafuente/test_sudo_and_variables.yml
Testing ansible "ansible_ssh_user" and "ansible_user_id" variables with sudo
- name: Testing variables with SUDO=NO
hosts: "*"
sudo: no
tasks:
- name: "PLAYBOOK SUDO=NO, TASK SUDO=NO"
command: whoami
register: whoami_output
sudo: no
- debug: var=whoami_output.stdout
@yaobinwen
yaobinwen / jenkins.md
Created May 24, 2021 14:02
Everything about Jenkins
JAVA_OPTS:
  -Dproperty=value
  -Duser.timezone=Europe/Paris
  -Djenkins.model.Jenkins.logStartupPerformance=true
  -Djava.util.logging.config.file=/var/jenkins_home/log.properties
  -Xms8192M
  -Xmx8192M
  -XX:+AlwaysPreTouch
  -XX:+HeapDumpOnOutOfMemoryError
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDrLz1SlXWIbItYpNRiCD9aX0OBLs3glYvE4vi1ZUrom48tFGb4UvdQJpiZKrva9PwjoEs+UgpZwwmrDKyC0JEZBbZFaI7Ll81qULN7b1uutMT4Xwlol4K3vlGTdsr0kkij536yBPUoELroPhkQJchcdtPSlG4H8z70P8MUb/JDRKt/LgKyWW22mmT+t2FUwULJO3Qo4kQreuUNK2sdbqS6ISpK2PNhKMOwoNFJHd11qZG+7/CAoqL5K5Tff0gB4LXo/MAo2MB/KZklSV/T7TfhyavrqAka3p2UCqqcedK83hjer0K1BWf9OcI+DgJhD3P/womWTy1PcD8c6QaVvd9Fv9Z8/w6HWdBVWc3TWhdxD0Bm8VQDmPxf18oNY0FhXZZAO9kQ3s4aWMqigK6tcopDCWq3You7Nxs5lG9W69qnev6ZnnEUr83x5Xs01tgxcHztmcO1TfjoUpMKUn7/gpFx09EZFiPWpeQquWOCXsGHNkGHuypJqGdDA+/nkvgQu9p6J+uUDxgEY9XNfjrHvOJ6li8T11lZsMjFIgte0qPSKdeGuAeMsQxaGLh2wj8q7cEpjc1eJv+54qirfIS5fbY6DQ9rrK0hDYcK7tBAkAyTzzZ0PbujGIjWqA8zQgQsezqhp1RSm6m1HVYuD71h78W3vVVDjSKvyYWmKR6wZvSMzw== GitHub:yaobinwen/work-env
@yaobinwen
yaobinwen / hacker-howto.md
Created February 14, 2021 21:58 — forked from zer4tul/hacker-howto.md
Simplified Chinese edition of ESR's How To Become A Hacker
@yaobinwen
yaobinwen / learning-computer-security.md
Last active December 21, 2020 11:30 — forked from nfarrar/learning-computer-security.md
Learning Computer Security

Learning Computer Security

About This Guide

This is an opinionated guide to learning about computer security (independently of a university or training program), starting with the absolute basics (suitable for someone without any exposure to or knowledge of computer security) and moving into progressively more difficult subject matter.

It seems that most people don't realize how much information is actually available on the internet. People love to share (especially geeks) and everything you need to become well versed in computer security is already available to you (and mostly for free). However, sometimes knowing where to start is the hardest part - which is the problem that this guide is intended to address. Therefore, this guide can accuratley be described as a 'guide to guides', with additional recommendations on effective learning and execises, based on my own experiences.

Many of the free resources are the best resources and this guide focuses on them. It is intended to provided a comprehensive

@yaobinwen
yaobinwen / gist:7ecf765e9600e4886b547724b47c65f4
Created May 31, 2020 01:00 — forked from afair/gist:2402068
Perl References for Kittens

Perl References

Simple Perl variables are called scalars. Examples of scalar values are

   $number      = 123;
   $string      = "String";
   $file_handle = open "<filename";
   $null_value  = undef;
 $instance = MyClass-&gt;new;
@yaobinwen
yaobinwen / Install NVIDIA Driver and CUDA.md
Created August 17, 2018 17:21 — forked from wangruohui/Install NVIDIA Driver and CUDA.md
Install NVIDIA Driver and CUDA on Ubuntu / CentOS / Fedora Linux OS