Skip to content

Instantly share code, notes, and snippets.

View yyolk's full-sized avatar
🍯
𝙧𝙚𝙘𝙪𝙧𝙨𝙞𝙫𝙚 𝙩𝙖𝙪𝙩𝙤𝙡𝙤𝙜𝙮

Joseph Chiocchi yyolk

🍯
𝙧𝙚𝙘𝙪𝙧𝙨𝙞𝙫𝙚 𝙩𝙖𝙪𝙩𝙤𝙡𝙤𝙜𝙮
View GitHub Profile
@willmcgugan
willmcgugan / last_lines.py
Created March 2, 2024 16:10
Get the last lines from a file
import mmap
def get_last_lines(path: str, count: int) -> list[str]:
"""Get count last lines from a file."""
with open(path, "r+b") as text_file:
text_mmap = mmap.mmap(text_file.fileno(), 0, mmap.ACCESS_READ)
position = len(text_mmap)
while count and (position := text_mmap.rfind(b"\n", 0, position)) != -1:
count -= 1
@stefanv
stefanv / install-deps
Last active November 4, 2023 21:45
Install build or other dependencies from pyproject.toml
#!/usr/bin/env python
import tomllib
import argparse
import sys
import subprocess
parser = argparse.ArgumentParser()
parser.add_argument(
Twitter ID Screen name Followers Removal observed Before After
17461978 SHAQ 15612791 2022-02-26T22:24:52Z SHAQ.ETH SHAQ.SOL
21910850 jakeowen 2119904 2022-02-26T15:45:18Z jakeowen.eth Jake Owen
7846 ijustine 1811449 2022-03-09T14:43:37Z iJustine.eth iJustineUltra
1666038950 BoredElonMusk 1752290 2022-02-17T08:05:47Z bored.eth Bored
381051960 ethRuby 1267133 2022-03-19T08:08:11Z CryptoSolis.eth Ruby
1282418324228337665 wsbmod 832406 2022-02-24T06:52:07Z wsbmod.eth wsbmod
20882981 EclecticMethod 495235 2022-02-18T04:39:30Z eclecticm.eth Eclectic Method
811350 alexisohanian 479340 2022-02-08T06:31:55Z AlexisOhanian.eth 7️⃣7️⃣6️⃣ Alexis Ohanian 7️⃣7️⃣6️⃣
22784458 Fwiz 410813 2022-03-22T08:54:42Z Ryan Wyatt - fwiz.eth 💜 Ryan Wyatt - @ GDC
@moyix
moyix / killbutmakeitlooklikeanaccident.sh
Created February 5, 2022 22:51
Script to inject an exit(0) syscall into a running process. NB: only x86_64 for now!
#!/bin/bash
gdb -p "$1" -batch -ex 'set {short}$rip = 0x050f' -ex 'set $rax=231' -ex 'set $rdi=0' -ex 'cont'
@sts10
sts10 / rust-command-line-utilities.markdown
Last active May 4, 2024 23:11
A curated list of command-line utilities written in Rust

A curated list of command-line utilities written in Rust

Note: I have moved this list to a proper repository. I'll leave this gist up, but it won't be updated. To submit an idea, open a PR on the repo.

Note that I have not tried all of these personally, and cannot and do not vouch for all of the tools listed here. In most cases, the descriptions here are copied directly from their code repos. Some may have been abandoned. Investigate before installing/using.

The ones I use regularly include: bat, dust, fd, fend, hyperfine, miniserve, ripgrep, just, cargo-audit and cargo-wipe.

  • atuin: "Magical shell history"
  • bandwhich: Terminal bandwidth utilization tool
@WietseWind
WietseWind / xApp.js
Last active September 2, 2021 23:42
XUMM SDK: xApp interaction
import {XummSdk} from 'xumm-sdk'
const main = async () => {
try {
const Sdk = new XummSdk()
// Get the xApp context data based on the UUID in the
// Query param (URL GET param) `xAppToken`.
// NOTE!!
@intelliot
intelliot / token.js
Created March 16, 2021 23:16
Code from RippleXDev Twitch episode on March 16, 2021
// Code from RippleXDev Twitch episode on March 16, 2021
//
// Code is provided "as is" and solely for informational purposes only.
// Warning: Use at your own risk.
// Install dependencies:
// npm install bignumber.js ripple-lib
//
// Milliseconds between checks for transaction validation
@WietseWind
WietseWind / 1-accountset.json
Last active December 18, 2021 15:32
Issue tokens (NFT) on the XRPL as discussed in XLS-14d - https://github.com/XRPLF/XRPL-Standards/discussions/30
{
"TransactionType": "AccountSet",
"Account": "rIssuingAccount...",
"SetFlag": 8
}
@kylemcdonald
kylemcdonald / Collect Parler Metadata.ipynb
Last active September 20, 2023 11:45
Collect video URLs and GPS data for Parler videos.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@npearce
npearce / raspberry_pi_consul_cluster.md
Last active August 27, 2023 08:03
Build a Raspberry Pi Consul Cluster

Configure Raspberry Pi Networking

It is possible to run 3 consul servers on the same IP address if you shift the various ports to unique numbers to avoid conflict, but you don't have to do that.

Instead, add interface alias's in your /etc/rc.local (just before the exit 0), e.g.:

In my case, wlan0 is a dhcp assigned interface. The following commands add three new alias interfaces, wlan0:1, etc, with their own stat IP Addresses.

ifconfig wlan0:1 inet 10.0.0.41 netmask 255.255.255.0