Skip to content

Instantly share code, notes, and snippets.

View abhas's full-sized avatar

Abhas Abhinav abhas

View GitHub Profile
@abhas
abhas / config.h
Created August 27, 2021 18:55 — forked from ednisley/config.h
QMK files for KeyboardIO Atreus modified with layer-indicating WS2812 RGB LED
#define RGB_DI_PIN B2
#define RGBLED_NUM 1
// https://github.com/qmk/qmk_firmware/blob/master/docs/ws2812_driver.md
//#define WS2812_TRST_US 280
//#define WS2812_BYTE_ORDER WS2812_BYTE_ORDER_GRB
#define RGBLIGHT_LIMIT_VAL 63
#define RGBLIGHT_LAYERS
@abhas
abhas / notes.md
Created June 14, 2019 13:02 — forked from maxidorius/notes.md
Notes on privacy and data collection of Matrix.org

Notes on privacy and data collection of Matrix.org

DISCLAIMER: This research and investigation work is based on several years of experience within the Matrix ecosystem and validation of facts via public and private communication. Reverse engineering was used to ensure some of the statements presented as facts regarding implementations are accurate.

Nonetheless it is possible that a mistake has made its way in these notes. If that is the case, please get in touch with the author which will fix any factual mistakes in good faith. We always encourage people not to trust statements at face value and always double-check for themselves.


TL;DR: matrix.org and vector.im receive a lot of private, personal and identifiable data on a regular basis, or metadata that can be used to precisely identify and/or track users/server, their social graph, usage pattern and potential location. This is possible both by the default configuration values in synapse/Riot that do not promote privacy, and by

@abhas
abhas / keybase.md
Created February 27, 2018 19:04
keybase.md

Keybase proof

I hereby claim:

  • I am abhas on github.
  • I am abhas (https://keybase.io/abhas) on keybase.
  • I have a public key ASAD3qBzzJJaLcqTRG83ru1QU9WYd63fvbagKUm5j701Rgo

To claim this, I am signing this object:

cd /var/tmp/webroot/ || exit
python3 -m http.server --bind xx.xx.xx.xx 80 &
pid=$!
letsencrypt certonly --webroot
kill $pid
sleep 0.5
kill -0 $pid && kill -9 $pid
@abhas
abhas / Base Layer
Created July 1, 2017 07:10
MH60 Layout for tkg.io
[{a:7},"Esc",{a:5},"!\n1","@\n2","#\n3","$\n4","%\n5","^\n6","&\n7","*\n8","(\n9",")\n0","_\n-","+\n=",{a:7,w:2},"Backspace"],
[{w:1.5},"Tab","Q","W","E","R","T","Y","U","I","O","P",{a:5},"{\n[","}\n]",{w:1.5},"|\n\\"],
[{a:7,w:1.75},"Control","A","S","D","F","G","H","J","K","L",{a:5},":\n;","\"\n'",{a:7,w:2.25},"Enter"],
[{w:2.25},"Shift","Z","X","C","V","B","N","M",{a:5},"<\n,",">\n.","?\n/",{a:7,w:2.75},"Shift"],
[{w:1.25},"Fn",{w:1.25},"Win",{w:1.25},"Alt",{w:6.25},"Space",{w:1.25},"Alt",{w:1.25},"Win",{w:1.25},"Menu",{w:1.25},"Ctrl"]
@abhas
abhas / mailcounter.js
Created June 15, 2015 05:02
Simple haraka mail counter
// params = [host, ip, response, delay, port, mode, recipients]
// 0 1 2 3 4 5 6 .
var winston = require('winston');
require('winston-mongodb').MongoDB;
winston.add(winston.transports.MongoDB, { db: 'mail-logs', host: '127.0.0.1'});
exports.hook_delivered = function (next, connection, params) {
connection.loginfo("delivered params are: " + connection.uuid + params + '|' + connection.notes.rcptokat
+ '|' + connection.notes.subject, this);
@abhas
abhas / keybase.md
Created February 8, 2015 14:45
keybase.md

Keybase proof

I hereby claim:

  • I am abhas on github.
  • I am abhas (https://keybase.io/abhas) on keybase.
  • I have a public key whose fingerprint is 1F13 1D85 AB68 C4F6 7665 29C8 FDD0 D87A 61B0 D19F

To claim this, I am signing this object:

@abhas
abhas / About.md
Created December 12, 2011 11:08
Using Rmagick to process images from buffers instead of file paths

Most documentation for Rmagick that I found shows you how to read images into an Rmagick object from a file path. However, I have a situation where I had a file stored in a MongoDB database and needed to process it with Rmagick.

The from_blob method did this for me. In a single line, I was able to read the file from the database into a buffer and pass that directly to Rmagick! :)

@abhas
abhas / gist:1466484
Created December 12, 2011 10:36
How to edit nested rails forms with file attachments
= f.fields_for :attachments do |att|
= att.label :file
- if att.object.new?
= att.file_field :file
- else
= att.object.file_name