Skip to content

Instantly share code, notes, and snippets.

View xchehub's full-sized avatar
:octocat:

XC xchehub

:octocat:
View GitHub Profile
@jserv
jserv / main.c
Created November 17, 2024 18:53
Object-Oriented Programming (OOP) in C: Render pixel effects using SDL2
/*
* This program demonstrates a simple Object-Oriented Programming (OOP)
* approach in C using function pointers and structures. It renders pixel
* effects onto an RGBA32 buffer using SDL2 for window management and display.
*
* Supported effects:
* - Bitwise operations pattern
* - Mandelbrot fractal visualization
*
* Key controls:
@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 January 16, 2025 21:58
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

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