Skip to content

Instantly share code, notes, and snippets.

@gquere
gquere / dump_i2c_eeprom.c
Created Aug 17, 2020
dump I2C EEPROM memory from Linux device ioctl
View dump_i2c_eeprom.c
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <fcntl.h>
#include <linux/i2c-dev.h>
#define READ_SIZE (256)
#define NB_PAGES (256)
@Zibri
Zibri / crt.css
Last active Dec 1, 2019
CRT effect with flickering scanlines and RGB grid.
View crt.css
// CRT effect with flickering scanlines and RGB grid.
// By zibri@zibri.org
// <html class="crt"> </html>
@keyframes flicker {
50% {
top: -3px
}
}
View generate.c
// Uncompressed version of
// https://gist.github.com/munificent/b1bcd969063da3e6c298be070a22b604
#include <time.h> // Robert Nystrom
#include <stdio.h> // @munificentbob
#include <stdlib.h> // for Ginny
#include <stdbool.h> // 2008-2019
const int HEIGHT = 40;
const int WIDTH = 80;
@munificent
munificent / generate.c
Last active Sep 9, 2021
A random dungeon generator that fits on a business card
View generate.c
#include <time.h> // Robert Nystrom
#include <stdio.h> // @munificentbob
#include <stdlib.h> // for Ginny
#define r return // 2008-2019
#define l(a, b, c, d) for (i y=a;y\
<b; y++) for (int x = c; x < d; x++)
typedef int i;const i H=40;const i W
=80;i m[40][80];i g(i x){r rand()%x;
}void cave(i s){i w=g(10)+5;i h=g(6)
+3;i t=g(W-w-2)+1;i u=g(H-h-2)+1;l(u
@Zibri
Zibri / inlineworker.js
Created Jun 28, 2018 — forked from SunboX/inlineworker.js
Create web workers without a separate worker JS files. Source: http://jsbin.com/owogib/8/
View inlineworker.js
function worker() {
setInterval(function() {
postMessage({foo: "bar"});
}, 1000);
}
var code = worker.toString();
code = code.substring(code.indexOf("{")+1, code.lastIndexOf("}"));
var blob = new Blob([code], {type: "application/javascript"});
@kylemanna
kylemanna / gpioke.c
Created Mar 30, 2018
Read Intel PCH GPIOs and Display Interrupt Enable status
View gpioke.c
/*
* See:
* - http://lxr.free-electrons.com/source/drivers/mfd/lpc_ich.c
* - http://lxr.free-electrons.com/source/drivers/gpio/gpio-ich.c
* - Intel document 252516-001 (ICH5)
* - Intel document 330550-002 (9 Series PCH)
* - Intel documents 332690-004 and 332691-002EN (100 Series PCH)
* - Original source: https://lab.whitequark.org/notes/2017-11-08/accessing-intel-ich-pch-gpios/
*/
@Zibri
Zibri / WishSortPrice.js
Created Jan 6, 2018 — forked from LiquidSebbey/WishSortPrice.js
Sort Wish.com results by price
View WishSortPrice.js
$("<style>.overlay { position:absolute; background-color: white; top:0; left:0; width:100%; height:100%; z-index:1000; } .loader { position: fixed; top: 1em; padding: 15px; maring: 15px; border: 1px solid #000000; border-radius: 10px; background-color: #CC0000; color: #FFFFFF; right: 1em; z-index: 999999999999; }</style>").appendTo("head");
$("body").append("<div id='overlay' class='overlay'></div><div id='loader' class='loader'><b>Bezig met inladen en sorteren ...</b></div>");
maxProducts = prompt("Hoeveel producten wil je inladen? (max. 500)");
var app = setInterval(function(){
if ($(".feed-product-item").length < maxProducts){
@evil5hadow
evil5hadow / breachcompilation.txt
Created Dec 19, 2017
1.4 billion password breach compilation wordlist
View breachcompilation.txt
wordlist created from original 41G stash via:
grep -rohP '(?<=:).*$' | uniq > breachcompilation.txt
Then, compressed with:
7z a breachcompilation.txt.7z breachcompilation.txt
Size:
View bashrc_id.sh
#!/bin/bash
export CRED=root@id
SSH=$(whereis ssh | awk '{print $2}')
JQ=$(whereis jq | awk '{print $2}')
SCP=$(whereis scp | awk '{print $2}')
if [ -z "$SSH" ]; then
echo "Unable to find ssh" 1>&2
return 1
@plugnburn
plugnburn / README.md
Last active Nov 12, 2021
NokiaTool - simple interface Bash script for MediaTek-based Nokia simple phones
View README.md

NokiaTool: control MediaTek-based Nokia phones from your PC

Overview

NokiaTool is a simple Bash script (nokiatool.sh) that allows you to use an undocumented serial connection in USB-enabled MediaTek-based Nokia feature phones manufactured by Microsoft (even the most basic ones, like the new 105) in order to control them from your PC.

This project is an ongoing work and uses only some bits and pieces of information about the phone internals available to the public, so under any circumstances don't consider it stable or a replacement for official tools if any are present.