Skip to content

Instantly share code, notes, and snippets.

View lenisko's full-sized avatar
🏠
Working from home

Jakub lenisko

🏠
Working from home
View GitHub Profile
@lenisko
lenisko / hack.sh
Created April 24, 2023 00:38 — forked from uson1x/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2275613/hack.sh | sh
#
@lenisko
lenisko / conf.d~auth.conf
Created October 11, 2022 02:16 — forked from Paturages/conf.d~auth.conf
Discord OAuth protected endpoints with only nginx
js_include conf.d/oauth2.js;
server {
listen 80;
server_name localhost;
root /usr/share/nginx/html;
location / {
auth_request /_auth_init;
}
@lenisko
lenisko / conf.d~auth.conf
Created October 11, 2022 02:16 — forked from Paturages/conf.d~auth.conf
Discord OAuth protected endpoints with only nginx
js_include conf.d/oauth2.js;
server {
listen 80;
server_name localhost;
root /usr/share/nginx/html;
location / {
auth_request /_auth_init;
}
@lenisko
lenisko / Sharp DR-I470 IR Remote codes.txt
Created May 11, 2022 12:19
Sharp DR-I470 IR Remote Codes
Type : Key : Value : Bits : Carrier Frequency (kHz)
0 : NEC : OK : 00F7C43B : 32 : 38
1 : NEC : Right : 00F7B847 : 32 : 38
2 : NEC : Left : 00F738C7 : 32 : 38
3 : NEC : Down : 00F7F807 : 32 : 38
4 : NEC : Up : 00F7708F : 32 : 38
5 : NEC : DIMMER : 00F7A05F : 32 : 38
6 : NEC : WPS : 00F710EF : 32 : 38
7 : NEC : 0 : 00F708F7 : 32 : 38
8 : NEC : 9 : 00F744BB : 32 : 38
// Force zIndex of Leaflet
(function(global){
var MarkerMixin = {
_updateZIndex: function (offset) {
this._icon.style.zIndex = this.options.forceZIndex ? (this.options.forceZIndex + (this.options.zIndexOffset || 0)) : (this._zIndex + offset);
},
setForceZIndex: function(forceZIndex) {
this.options.forceZIndex = forceZIndex ? forceZIndex : null;
}
};
@lenisko
lenisko / idb.sh
Created December 14, 2020 01:46 — forked from binzume/idb.sh
Command line tool to communicate with iOS device as like ADB
#!/bin/bash
#
# Command line tool to communicate with iOS device as like ADB
# This is wrapper script for libimobiledevice and ios-deploy.
#
## Usage:
## idb [-s DEVID] [-b BUNDLE_ID] COMMAND [PARAMS...]
## idb devices
## idb logcat
## idb reboot
@lenisko
lenisko / jwt-expiration.md
Created July 31, 2019 18:07 — forked from soulmachine/jwt-expiration.md
How to deal with JWT expiration?

First of all, please note that token expiration and revoking are two different things.

  1. Expiration only happens for web apps, not for native mobile apps, because native apps never expire.
  2. Revoking only happens when (1) uses click the logout button on the website or native Apps;(2) users reset their passwords; (3) users revoke their tokens explicitly in the administration panel.

1. How to hadle JWT expiration

A JWT token that never expires is dangerous if the token is stolen then someone can always access the user's data.

Quoted from JWT RFC:

@lenisko
lenisko / gist:db937642b294d651507866b1aa8c7adb
Created February 14, 2019 01:14 — forked from Ayms/gist:6451926
WebCrypto code example - Upload a file, encrypt it, calculate the hash and store the results using indexedDB

Code example using WebCrypto, File API, indexedDB, createObjectURL and Workers.

<input type="file" onsubmit="process_upload">
var workerjs=' \
  onmessage=function(evt) { \
		var encrypt=crypto.workersubtle.encrypt({name:"AES-CBC",iv:new Uint8Array(16)},evt.data[0]); \
		var buffer=evt.data[1]; \
<?xml version="1.0" encoding="utf-8" ?>
<Device_Info>
<DeviceInfoVers>0001</DeviceInfoVers>
<CommApiVers>0301</CommApiVers>
<Gen>0002</Gen>
<BrandCode>0</BrandCode>
<ProductCategory>01</ProductCategory>
<CategoryName>AV RECEIVER</CategoryName>
<ManualModelName>AVR-X1400H</ManualModelName>
<DeliveryCode>02</DeliveryCode>
@lenisko
lenisko / mumble_info.py
Created December 1, 2018 18:02
Script used to send PING to Mumble server and get data
#!/usr/bin/python
"""
Author: @lenisko
Script used to send PING to Mumble server and get data:
- server version
- ping
- users
- max users
- bandwidth
"""