Skip to content

Instantly share code, notes, and snippets.

Avatar

Wenxuan breeswish

View GitHub Profile
@Justsoos
Justsoos / p.sh
Last active Nov 3, 2020
proxychains CLI wrapper (updated)
View p.sh
#!/bin/sh
# proxychains wrapper
# Choose pre-supposed profile with -1,-2,-3 OR appoint by -n proxy(Node)_ip(hostname):port and -p proxy_protocol and -q as quiet mode
# Default profile
proxy_hostname=127.0.0.1
proxy_port=1080
protocol=socks5
# profile 1
proxy_hostname_1=127.0.0.1
@svet-b
svet-b / bigdashboard_output.pdf
Last active Apr 25, 2021
PDF export of Grafana dashboard using puppeteer
View bigdashboard_output.pdf
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View ELF-symbol-resolution.md

ELF

ELF Header

The first portion of any ELF file is the ELF header. This generally provides offsets to other headers (program headers and section headers) within an ELF.

typedef struct {
  unsigned char e_ident[EI_NIDENT];
  uint16_t e_type;
@karimnaaji
karimnaaji / valgrind.md
Last active Sep 21, 2020
Valgrind steps to get cache misses
View valgrind.md
@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active May 10, 2021
How to add a collapsible section in markdown.
View markdown-details-collapsible.md

A collapsible section containing markdown

Click to expand!

Heading

  1. A numbered
  2. list
    • With some
    • Sub bullets
View shadowbroker
.
├── matree
├── swift
│   ├── 00503_0_254.242_2013mar02
│   ├── 00546_0_ensbdasa-09aug2013
│   ├── 00553_0_ensbdpix3-09aug2013
│   ├── 00554_0_ensbdpix4-09aug2013
│   ├── 00555_0_ensbdrtr1-2013aug09
│   ├── 00557_0_ENSBDVPN1-02AUG2013
│   ├── 00558_0_ENSBDVPN2-02AUG2013
View main.rs
extern crate futures;
extern crate futures_cpupool;
extern crate rand;
use futures::{Future, Sink, Stream};
/// Sleep for a random time between 0 and 1 second.
fn sleep_random() {
let sleep_time_ms = rand::random::<u8>() as f64 / 255.0 * 1000.0;
std::thread::sleep(std::time::Duration::from_millis(sleep_time_ms as u64));
@KodrAus
KodrAus / Profile Rust on Linux.md
Last active Apr 29, 2021
Profiling Rust Applications
View Profile Rust on Linux.md

Profiling performance

Using perf:

$ perf record -g binary
$ perf script | stackcollapse-perf.pl | rust-unmangle | flamegraph.pl > flame.svg

NOTE: See @GabrielMajeri's comments below about the -g option.

@renchap
renchap / README.md
Last active Jan 1, 2021
One-line certificate generation/renews with Letsencrypt and nginx
View README.md

Prerequisites : the letsencrypt CLI tool

This method allows your to generate and renew your Lets Encrypt certificates with 1 command. This is easily automatable to renew each 60 days, as advised.

You need nginx to answer on port 80 on all the domains you want a certificate for. Then you need to serve the challenge used by letsencrypt on /.well-known/acme-challenge. Then we invoke the letsencrypt command, telling the tool to write the challenge files in the directory we used as a root in the nginx configuration.

I redirect all HTTP requests on HTTPS, so my nginx config looks like :

server {