Skip to content

Instantly share code, notes, and snippets.

View xchehub's full-sized avatar
:octocat:

XC xchehub

:octocat:
View GitHub Profile
@JorgeAtPaladin
JorgeAtPaladin / ERC721Staking.sol
Created April 15, 2022 00:21
ERC721Staking.sol
// SPDX-License-Identifier: MIT // OK
// Creator: andreitoma8 // OK
pragma solidity ^0.8.4; // OK
import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; // OK
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; // OK
import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; // OK
import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol"; // OK
import "@openzeppelin/contracts/access/Ownable.sol"; // OK
@dabit3
dabit3 / marketplace.sol
Last active November 8, 2024 01:09
NFT Marketplace Smart Contract (V2)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "hardhat/console.sol";
contract NFTMarketplace is ERC721URIStorage {
@Neo23x0
Neo23x0 / log4j_rce_detection.md
Last active September 11, 2024 21:41
Log4j RCE CVE-2021-44228 Exploitation Detection

log4j RCE Exploitation Detection

You can use these commands and rules to search for exploitation attempts against log4j RCE vulnerability CVE-2021-44228

Grep / Zgrep

This command searches for exploitation attempts in uncompressed files in folder /var/log and all sub folders

sudo egrep -I -i -r '\$(\{|%7B)jndi:(ldap[s]?|rmi|dns|nis|iiop|corba|nds|http):/[^\n]+' /var/log
Connect & Disconnect
---
import json
def lambda_handler(event, context):
print(event)
print("****")
print(context)
@pahud
pahud / bootstrap.sh
Last active September 27, 2024 14:27
AWS SSO + Codespaces
#!/bin/bash
# video demo - https://www.youtube.com/watch?v=Y8TyE_DNds8
mkdir ~/.tmp && cd $_
# install aws-cli v2
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && \
unzip awscliv2.zip && \
sudo ./aws/install
@lizthegrey
lizthegrey / attributes.rb
Last active September 24, 2024 14:33
Hardening SSH with 2fa
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'
#-*- coding:utf-8 -*-
#!/usr/bin/env python
import requests
from bs4 import BeautifulSoup
import re
import shutil
import os
out='/home/coericnb'
@danazkari
danazkari / Smart Contracts with React (how to be the coolest kid on the block).md
Last active June 6, 2023 20:49
Smart Contracts with React (how to be the coolest kid on the block).md

Smart Contracts with React (how to be the coolest kid on the block)

Recommended snack and song:

220ml of dark roasted full bodied coffee brewed in french press accompanied by a banana while listening to [Liquid Tension Experiment]

tl;dr: You can go ahead and clone [this repo], it's got the end result of this in-depth tutorial bellow.

Here's what we will be doing for becoming smart-contract heroes! - Install the dev environment plus MetaMask. - Develop a very simple voting smart contract.

Aws Elasticsearch Service 踩雷紀錄

前言

本文是為了幫助那些想使用 Aws Elasticsearch Servcie 跟 想使用 logstash kibana 所誕生的。

為何要使用 Aws Elasticsearch Service

免費 是最重要的原因,對於一個缺錢的新創或者是工程師,免費超吸引人的。 安裝快速,擴展方便也很重要,不過都比不過 免費

@danny0838
danny0838 / .gitconfig
Last active June 23, 2020 22:57
實用的 Git 配置值
[core]
quotepath = false # 中文檔名如實顯示而不轉碼
autocrlf = false # commit 及 checkout 時不根據作業系統轉換檔案的換行字元 (避免不小心改動原 repo 的換行字元)
safecrlf = false # 檢查文字類檔案是否混合了 CRLF 及 LF 換行字元 (搭配 autocrlf,這裡一起關閉)
ignorecase = false # 檔名大小寫不同時視為相異 (更動大小寫才能 commit)
whitespace = cr-at-eol # diff 時行尾 CRLF 不顯示 ^M
fileMode = false # 忽略檔案的 x 屬性 (for Windows)
symlinks = false # 忽略符號連結 (for Windows)
editor = /usr/bin/vim # 預設的文字編輯器 (for Linux)
[alias]