Skip to content

Instantly share code, notes, and snippets.

View vdparikh's full-sized avatar

Vishal Parikh vdparikh

View GitHub Profile
Slack script to call ChatGPT and participate in conversations when mentioned, summarize long threads, and query a sqlite database containing an organizational knowledge-base
@vdparikh
vdparikh / README.md
Last active April 30, 2023 22:04
Nitro Enclave

What is Nitro Enclave

https://aws.amazon.com/ec2/nitro/nitro-enclaves/#:~:text=AWS%20Nitro%20Enclaves%20enables%20customers,within%20their%20Amazon%20EC2%20instances.

AWS Nitro Enclaves are isolated compute environments that provide additional security for highly sensitive data processing workloads. Nitro Enclaves are based on Nitro System, a combination of dedicated hardware and lightweight hypervisor, that isolates and protects resources like CPU, memory, and storage from the underlying infrastructure and other workloads.

Nitro Enclaves allow customers to securely process highly sensitive data without exposing the data to the underlying host, reducing the risk of data exfiltration and enabling compliance with strict security requirements.

Nitro Enclaves can run applications that require a secure and isolated environment, such as cryptographic key generation and storage, data processing in financial services, and code signing. Nitro Enclaves are integrated with AWS Key Management Service (KMS), AWS S

@vdparikh
vdparikh / openai.go
Last active April 25, 2023 17:42
OpenAI API for completion
package main
import (
"fmt"
"net/http"
"bytes"
"io/ioutil"
)
func main() {
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;
import "forge-std/Test.sol";
contract InvariantBreaker {
bool public flag0 = true;
bool public flag1 = true;
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.6;
import "forge-std/Test.sol";
// This contract is designed to act as a time vault.
// User can deposit into this contract but cannot withdraw for atleast a week.
// User can also extend the wait time beyond the 1 week waiting period.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
/*
EtherStore is a contract where you can deposit and withdraw ETH.
This contract is vulnerable to re-entrancy attack.
Let's see why.
1. Deploy EtherStore
2. Deposit 1 Ether each from Account 1 (Alice) and Account 2 (Bob) into EtherStore
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.11;
contract Onwership {
address public owner;
modifier onlyOwner {
require(owner == msg.sender, "You are not the owner");
_;

Keybase proof

I hereby claim:

  • I am vdparikh on github.
  • I am vdparikh (https://keybase.io/vdparikh) on keybase.
  • I have a public key ASAm3OrRRVJm7KdGibPALFoBpoNPX6iIeT9GRj84DKe4Cwo

To claim this, I am signing this object:

import stebo
@vdparikh
vdparikh / worksheet.sql
Created February 23, 2020 16:51
Create Read Only Snowflake Group and User
# CREATE A READ ONLY GROUP
create role read_only_svc_rl comment = 'This role is limited to querying tables';
grant role read_only_svc_rl to role sysadmin;
# GRANT USAGE ON DATABASE
grant usage on database databots_prod to role read_only_svc_rl;
# GRANT USAGE ON CURRENT SCHEMAS AND FUTURE SCHEMAS
grant usage on all schemas in database databots_prod to role read_only_svc_rl;
grant usage on future schemas in database databots_prod to role read_only_svc_rl;