Skip to content

Instantly share code, notes, and snippets.

View 1Conan's full-sized avatar

Conan 1Conan

View GitHub Profile
typedef struct { /*!< (@ 0x4001C000) SN_SPIn Structure */
union { /*!< (@ 0x00000000) Offset:0x00 SPIn Control register 0 */
__IOM uint32_t raw; /* raw access to CTRL0 register */
struct {
__IOM uint32_t SPIEN : 1; /* SPI enable bit */
__IOM uint32_t LOOPBACK : 1; /* Loopback mode enable bit */
__IOM uint32_t SDODIS : 1; /* Slave data output disable bit */
__IOM uint32_t MS : 1; /* Master/Slave selection bit */
__IOM uint32_t FORMAT : 1; /* Interface format */
__IM uint32_t : 1; /* Reserved */
@1Conan
1Conan / libirecovery.patch
Created November 23, 2020 01:10
Patch to disable tools build and fix --with-dummy
diff --git a/Makefile.am b/Makefile.am
index 4a61e83..48c4811 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,6 @@
AUTOMAKE_OPTIONS = foreign
ACLOCAL_AMFLAGS = -I m4
-SUBDIRS = src include tools udev
+SUBDIRS = src include udev
@1Conan
1Conan / pallas.sh
Created July 8, 2020 14:28 — forked from Siguza/pallas.sh
newstyle OTA
#!/bin/zsh
set -e;
dir="$(mktemp -d)";
echo "$dir" >&2;
iOS_device=();
iOS_model=();
@1Conan
1Conan / snowflake-id.sql
Created June 13, 2020 12:35 — forked from beginor/snowflake-id.sql
Twitter Snowflake ID for PostgreSQL
CREATE SEQUENCE public.global_id_seq;
ALTER SEQUENCE public.global_id_seq OWNER TO postgres;
CREATE OR REPLACE FUNCTION public.id_generator()
RETURNS bigint
LANGUAGE 'plpgsql'
AS $BODY$
DECLARE
our_epoch bigint := 1314220021721;
seq_id bigint;

Keybase proof

I hereby claim:

  • I am 1conan on github.
  • I am 1conan (https://keybase.io/1conan) on keybase.
  • I have a public key ASBrfczMT1wsih8G0hsKH3b-Nk_1oy85xdvGT6nbBq-ttgo

To claim this, I am signing this object:

const fetch = require('node-fetch');
// Config
const authToken = '';
const userId = '';
const guildId = '';
const headers = {
Authorization: authToken
};
@1Conan
1Conan / delete-all-messages.js
Created March 9, 2019 16:12 — forked from IMcPwn/delete-all-messages.js
Delete all messages in a Discord channel
// Turn on Developer Mode under User Settings > Appearance > Developer Mode (at the bottom)
// Then open the channel you wish to delete all of the messages (could be a DM) and click the three dots on the far right.
// Click "Copy ID" and paste that instead of LAST_MESSAGE_ID.
// Copy / paste the below script into the JavaScript console.
// If you're in a DM you will receive a 403 error for every message the other user sent (you don't have permission to delete their messages).
var before = 'LAST_MESSAGE_ID';
clearMessages = function(){
const authToken = document.body.appendChild(document.createElement`iframe`).contentWindow.localStorage.token.replace(/"/g, "");
const channel = window.location.href.split('/').pop();
const isHex = require('is-hex')
const converter = require('hex2dec')
module.exports = (ecid, ecidType) => {
if(ecidType == 'dec')
return validateDecEcid(ecid)
else if(ecidType == 'hex')
return validateHexEcid(ecid)
else
return false
}
@1Conan
1Conan / generator.js
Last active February 13, 2019 09:38
Generator/Apnonce generation script
/**
* genap
* 1Conan
*/
const crypto = require('crypto');
const reverse = require('buffer-reverse');
const hash = crypto.createHash('sha1');
//Data
const random = crypto.randomBytes(8);
@1Conan
1Conan / discordClient.html
Created April 22, 2017 18:54
Just a simple toy client to speak as a bot.
<html>
<head>
<script src='discord.11.0.0.js'></script>
</head>
<body>
<div id='msgDiv' style='display:none'>
<ul id='msgs' style="overflow:scroll; height:400px;">
</ul>
<input type="text" id="message" placeholder="message here">
</div>