This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Check your current git config | |
git config --global --list | |
git config --list | |
# Update your name and email config | |
# (email has to be one of the listed ones under your github accont | |
# https://github.com/settings/emails | |
git config --global user.name "John Doe" | |
git config --global user.email johndoe@example.com |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Title: Ssh Backdoor Log | |
# Creation date: 2020/12/21 | |
# MITRE ATT&CK Tactic: TA0006 - Credential Access - https://attack.mitre.org/tactics/TA0006/ | |
# MITRE ATT&CK Technique: T1556 - Modify Authentication Process - https://attack.mitre.org/techniques/T1556/ | |
# Source | |
# https://github.com/exein-io/pulsar/blob/main/rules/credential_access/ssh_backdoor_log.yaml | |
# Docs | |
# https://toml.io/en/v1.0.0#array-of-tables |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# By default Reload config with < shft + cmd + , > | |
# UI | |
theme = rose-pine | |
background = 1C2021 | |
background-opacity = 0.95 | |
background-blur-radius = 20 | |
font-family = JetBrainsMonoNL Nerd Font | |
font-size = 20 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use anyhow::{Context, Error}; | |
use metrics_exporter_prometheus::{Matcher, PrometheusBuilder, PrometheusHandle}; | |
pub const OP_LABEL: &str = "op"; | |
pub const METRICS_NAME: &str = "myapp_request_duration_seconds"; | |
/// Sets up the Prometheus metrics recorder. | |
pub fn setup_metrics_recorder() -> Result<PrometheusHandle, Error> { | |
const BUCKETS: &[f64] = &[ | |
0.001, 0.002, 0.003, 0.004, 0.005, 0.01, 0.015, 0.02, 0.025, 0.03, 0.035, 0.04, 0.045, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Doesn't compile > error: lifetime may not live long enough | |
fn main() { | |
println!("Hello, world!"); | |
} | |
fn two_refs(vec:&mut Vec<&str>,str: &str ){ | |
vec.push(str); | |
} | |
//Because of the lifetime elision. Compiler introduced 3 different lifetimes | |
fn two_refs<'a,'b,'c>(vec:&'a mut Vec<&'b str>,str: &'c str ){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Pads and aligns a value to the length of a cache line. | |
///Source :https://github.com/ibraheemdev/seize/blob/master/src/utils.rs | |
#[cfg_attr( | |
any( | |
target_arch = "x86_64", | |
target_arch = "aarch64", | |
target_arch = "powerpc64", | |
), | |
repr(align(128)) | |
)] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<policies> | |
<inbound> | |
<cors allow-credentials="false"> | |
<allowed-origins> | |
<origin>YOUR-DOMAIN</origin> | |
</allowed-origins> | |
<allowed-methods preflight-result-max-age="300"> | |
<method>GET</method> | |
<method>POST</method> | |
<method>PATCH</method> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<policies> | |
<inbound> | |
<base /> | |
<set-backend-service id="apim-generated-policy" backend-id="YOUR-SERVICE-ID" /> | |
<rate-limit-by-key calls="5" renewal-period="300" counter-key="@(context.Request.IpAddress)" /> | |
<set-header name="Authorization" exists-action="append"> | |
<value>Berer TOKEN-VALUE</value> | |
</set-header> | |
</inbound> | |
<backend> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<policies> | |
<inbound> | |
<base /> | |
<set-backend-service id="apim-generated-policy" backend-id="YOUR-BACKEND-SERVICE-ID" /> | |
<quota-by-key calls="1000" renewal-period="2505600" counter-key="@(context.Subscription?.Key ?? "anonymous")" increment-condition="@(context.Response.StatusCode >= 200 && context.Response.StatusCode < 300)" /> | |
<set-header name="Authorization" exists-action="append"><value>Berer TOKEN-VALUE</value></set-header> | |
</inbound> | |
<backend> | |
<base /> | |
</backend> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Builds <style> based on theme arg | |
func htmlStleBuilder() string { | |
args := os.Args | |
switch len(args) { | |
case 3: | |
if args[2] == "mid" { | |
return static.HtmlOpen + static.Root_midTheme + static.HtmlMid | |
} | |
return static.HtmlOpen + static.Root_darkTheme + static.HtmlMid | |
default: |
NewerOlder