Skip to content

Instantly share code, notes, and snippets.

View AndrewLaganaro's full-sized avatar
🖥️
Coding

Andrew Laganaro AndrewLaganaro

🖥️
Coding
View GitHub Profile
@fernandonm
fernandonm / powattack.md
Last active January 17, 2022 09:11
How much does it cost to destroy Bitcoin?

How much does it cost to destroy Bitcoin?

There has been a dreaded myth surrounding the so-called 51% PoW attacks against Bitcoin since inception. It is often believed that anyone able and willing to spend an amount equal to the “security budget” forever can destroy Bitcoin. That is, any evil government willing to spend about $60 million per day (matching miner’s revenue) would be able to destroy its $1.16 trillion current market capitalization. And worse, this figure may become lower and lower as halvings arrive if fee revenue is not able to take off consistently. Note that “forever” is just a credible threat, he will only need to spend that money for a period of time long enough until Bitcoin has been destroyed, which may be just a few weeks (at $420 million per week).

Here I will try to explain why the mentioned figure (currently 0.005% of bitcoin’s mcap per day) is not nearly enough to destroy Bitcoin, and show why it is unlikely that an attacker would carry such an ineffective attack for a long perio

@antlionguard
antlionguard / twitter-remove-retweets.js
Last active July 28, 2024 16:53
With this script, you can remove all retweets you are retweeted on Twitter.
const timer = ms => new Promise(res => setTimeout(res, ms));
// Unretweet normally
const unretweetTweet = async (tweet) => {
await tweet.querySelector('[data-testid="unretweet"]').click();
await timer(250);
await document.querySelector('[data-testid="unretweetConfirm"]').click();
console.log('****// Unretweeted Successfully //****')
}
@takanuva
takanuva / agt.h
Last active July 25, 2022 19:57
Simple generic print() and scan() macros
/*******************************************************************************
* Copyright 2022 Paulo Torrens *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy *
* of this software and associated documentation files (the "Software"), to *
* deal in the Software without restriction, including without limitation the *
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or *
* sell copies of the Software, and to permit persons to whom the Software is *
* furnished to do so, subject to the following conditions: *
* *
@mondaini
mondaini / Remote.md
Last active November 24, 2023 20:08
List of companies hiring for full remote positions to work with companies in the US/Europe
@atifraza
atifraza / conda-basics.md
Last active May 28, 2024 04:49
Basics of the conda package manager

Conda basics and best practices

Best practices

  • Don't install additional packages into the base environment
  • Give meaningful names to environments, e.g., PROJECT_NAME-env
  • Always specify package version numbers
  • Install all required packages in one command to reduce later conflicts
  • Install pip in each environment to avoid using the system default version
  • Always version control the environment.yml file
@wllmsash
wllmsash / assigning-static-ip-addresses-in-wsl2.md
Last active June 27, 2024 20:56
Assigning Static IP Addresses in WSL2

Assigning Static IP Addresses in WSL2

WSL2 uses Hyper-V for networking. The WSL2 network settings are ephemeral and configured on demand when any WSL2 instance is first started in a Windows session. The configuration is reset on each Windows restart and the IP addresses change each time. The Windows host creates a hidden switch named "WSL" and a network adapter named "WSL" (appears as "vEthernet (WSL)" in the "Network Connections" panel). The Ubuntu instance creates a corresponding network interface named "eth0".

Assigning static IP addresses to the network interfaces on the Windows host or the WSL2 Ubuntu instance enables support for the following scenarios:

#include <RH_RF95.h>
#define RF95_CS 10
#define RF95_INT 2
#define RF95_RST 9
#define RF95_FREQ 915.0
RH_RF95 rf95(RF95_CS, RF95_INT);
@GermaniumSystem
GermaniumSystem / pwnagotchi notes
Last active March 7, 2024 14:37
How to set up a pwnagotchi in 25* simple steps.
Preface:
I have no idea if any of this is the "right" way of doing it. This is just how I got my unit working.
Good luck.
WARNING: Do not use a V1 Waveshare display module with a stock pwnagotchi! The pwnagotchi expects a V2 module, and may irreparably damage a V1 module!
A V1 display module *can* work, but you must modify `waveshare.py` and `display.py` beforehand. For the time being, this is left as an exercise for the reader.
If you have already burnt a V1 display, try disconnecting it from the Pi and leaving it overnight. This may rejuvenate the display somewhat, but it will likely still display signs of damage.
Installation:
1. `dd` Raspbian Lite to an SD card.
@aymericbeaumet
aymericbeaumet / delete-likes-from-twitter.md
Last active July 31, 2024 14:57
[Recipe] Delete all your likes/favorites from Twitter

Ever wanted to delete all your likes/favorites from Twitter but only found broken/expensive tools? You are in the right place.

  1. Go to: https://twitter.com/{username}/likes
  2. Open the console and run the following JavaScript code:
setInterval(() => {
  for (const d of document.querySelectorAll('div[data-testid="unlike"]')) {
    d.click()
 }
@jasongrout
jasongrout / CustomizeJLabTheme.ipynb
Created June 20, 2018 19:35
JupyterLab Theme Customization
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.