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
| fn main() { | |
| let boxed_array: Box<[u8]> = Box::new([0u8; 8192]); | |
| let slice: &'static mut [u8] = Box::leak(boxed_array); | |
| let factor = 4; | |
| assert!(factor <= 8); | |
| assert!(slice.len() % factor == 0); | |
| let len = slice.len() / factor; |
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
| #![allow(unused)] | |
| fn main() { | |
| use std::{ptr, slice}; | |
| use std::boxed::Box; | |
| let mut v1 = vec![0u8; 8]; | |
| let len = v1.len(); | |
| { | |
| let mut boxed = v1.into_boxed_slice(); | |
| let this = Box::as_mut(&mut boxed); |
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 core::alloc::Layout; | |
| use core::mem::MaybeUninit; | |
| use std::alloc::{alloc, dealloc}; | |
| #[allow(unused_imports)] | |
| use std::ptr::{addr_of_mut, copy_nonoverlapping}; | |
| #[repr(C)] | |
| #[derive(Debug, Copy, Clone)] | |
| pub struct IoVec { | |
| iov_base: *mut usize, |
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
| package k8sprivileged | |
| is_deployment { | |
| input.kind = "Deployment" | |
| } | |
| deny[msg] { | |
| is_deployment | |
| some i | |
| containers[i].securityContext.privileged |
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
| module crawler-new | |
| go 1.15 | |
| require golang.org/x/net v0.0.0-20210220033124-5f55cee0dc0d |
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
| import boto3 | |
| import botocore | |
| from collections import defaultdict | |
| import argparse | |
| import json | |
| import sys | |
| ############################################################### | |
| # Usage: supply IdentityStoreId to suit your use case # |
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
| import boto3 | |
| import botocore | |
| import argparse | |
| import sys | |
| ############################################################### | |
| # Usage: change IdentityStoreId to suit your use case # | |
| # change the Attribute Value to a list of all users # | |
| # change InstanceArn to suit your usecase # |
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
| import boto3 | |
| import botocore | |
| from botocore.exceptions import ClientError | |
| ACCOUNT = '' | |
| ## Check security groups for any egress or ingress rules that have a CIDR range of 0.0.0.0/0 for any protocol | |
| ## Have included all protocols, as filter match is logical OR and wouldn't filter all |
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
| import boto3 | |
| from boto3.s3.transfer import S3Transfer | |
| from boto3.s3.transfer import TransferConfig | |
| from concurrent.futures import ThreadPoolExecutor | |
| from concurrent import futures | |
| import logging | |
| from datetime import datetime, timedelta | |
| boto3.set_stream_logger('boto3.resources', logging.INFO) |
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
| package main | |
| import ( | |
| "fmt" | |
| "os" | |
| "sync" | |
| "time" | |
| "github.com/aws/aws-sdk-go/aws" | |
| "github.com/aws/aws-sdk-go/aws/endpoints" |
NewerOlder