Skip to content

Instantly share code, notes, and snippets.

@sachadee
sachadee / aesecb.py
Last active April 26, 2024 00:00
Python AES ECB Encryption
import base64
from Crypto.Cipher import AES
from Crypto.Util.Padding import pad,unpad
#AES ECB mode without IV
data = 'I love Medium'
key = 'AAAAAAAAAAAAAAAA' #Must Be 16 char for AES128
def encrypt(raw):
@s0kil
s0kil / purple-yolk-vscode.md
Last active February 24, 2021 15:09
Setting Up VS Code purple-yolk Extension With IHP

Integrating purple-yolk With IHP

  • In your IHP project directory, create a file named .ghci-purple-yolk and copy the contents of the .ghci file
  • Add :l Main.hs to the end of the .ghci-purple-yolk file

.ghci-purple-yolk should look something like:

:set -XNoImplicitPrelude
:def source readFile
@npodonnell
npodonnell / bitcoind_ubuntu_setup.md
Last active April 23, 2024 18:56
Bitcoind Ubuntu Setup

Bitcoind Ubuntu Setup

N. P. O'Donnell, 2021

Getting Bitcoind

ARCH=x86_64
BITCOIN_VERSION=0.21.0
wget https://bitcoin.org/bin/bitcoin-core-$BITCOIN_VERSION/bitcoin-$BITCOIN_VERSION-$ARCH-linux-gnu.tar.gz
@four0four
four0four / 01-zynq-uart-exploit.md
Last active January 6, 2024 19:17
Zynq BootROM Secrets: BootROM dump exploit

Zynq BootROM Secrets: Exposing the bootROM with the UART loader

Last time I wrote about this, I lied a little - There is an interesting bug in the UART loader, and it may have been exactly why Xilinx didn't document it. In short: The UART loader writes the entire UART payload to a location in memory (nominally 0x4_0000). The ROM is architected such that when the boot mode is selected, it registers a callback that is called when the ROM wants more data from the boot device. For the UART loader, this is pretty simple - here's the whole thing:

; void uart_callback(u32 r0_offset, void* r1_dest, i32 r2_nbytes)
ROM:0000A578 PUSH            {R3,LR}
ROM:0000A57C MOV             R3, #uart_buff
ROM:0000A584 MOV             R12, #1
ROM:0000A588 LDR             R3, [R3]
@prologic
prologic / LearnGoIn5mins.md
Last active April 30, 2024 15:10
Learn Go in ~5mins
@ityonemo
ityonemo / test.md
Last active May 5, 2024 05:56
Zig in 30 minutes

A half-hour to learn Zig

This is inspired by https://fasterthanli.me/blog/2020/a-half-hour-to-learn-rust/

Basics

the command zig run my_code.zig will compile and immediately run your Zig program. Each of these cells contains a zig program that you can try to run (some of them contain compile-time errors that you can comment out to play with)

require 'capybara/apparition'
Capybara.server = :puma, { Silent: true }
Capybara.register_driver :chrome_headless do |app|
Capybara::Apparition::Driver.new(app, { headless: true, browser_options: { 'headless': '', 'no-sandbox': '' } })
end
Capybara.register_driver :chrome do |app|
options = Selenium::WebDriver::Chrome::Options.new(args: %w[no-sandbox])
@graninas
graninas / On_hiring_haskellers.md
Last active March 25, 2023 16:49
On hiring Haskellers

On hiring Haskellers

Recently I noticed the number of the same two questions being asked again and again on different Haskell resources. The questions were “How to get a Haskell job” and “Why is it so hard to find Haskellers?” Although these two are coming from the opposite sides of the hiring process, the answer is really just one. There is a single reason, a single core problem that causes difficulties of hiring and being hired in the Haskell community, and we should clearly articulate this problem if we want to increase the Haskell adoption.

We all know that there are many people wishing to get a Haskell job. And a visible increase of Haskell jobs looks like there should be a high demand for Haskellers. The Haskell community has also grown like crazy past years. But still, why is it so difficult to hire and to be hired? Why can’t companies just hire any single person who demonstrates a deep knowledge of Haskell in blog posts, in chats, on forums, and in talks? And why do Haskell companies avoid hirin

WHEN WILL BROWSERS BE COMPLETE?
A short exploration into the end game of web browsers.
This article may seem to be about bashing Google but it isn't. It's just about
reflecting on the current state and how much longer we should see ourselves
here.
So what is the Web? Well we can agree the Web is a conglomerate of standards
proposed by the W3C. So what do those standards define?
@kahole
kahole / index.html
Last active April 26, 2024 06:04
*scratch*.js
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>*scratch*</title>
<style>
body {
font-family: Hack, Menlo, Monaco, 'Droid Sans Mono', 'Courier New', monospace;
white-space: pre;