Skip to content

Instantly share code, notes, and snippets.

View izquiratops's full-sized avatar
🐀
Lost in the sauce

Jordi izquiratops

🐀
Lost in the sauce
  • Barcelona - Spain
  • 23:09 (UTC -12:00)
View GitHub Profile
@izquiratops
izquiratops / idea.sh
Last active May 16, 2022 10:07 — forked from agoncal/idea
Open IntelliJ Idea from bash
#!/bin/sh
# check for where the latest version of IDEA is installed
IDEA=`ls -1d /Applications/IntelliJ\ * | tail -n1`
wd=`pwd`
# were we given a directory?
if [ -d "$1" ]; then
# echo "checking for things in the working dir given"
wd=`ls -1d "$1" | head -n1`
@izquiratops
izquiratops / jwt-expiration.md
Created December 4, 2020 13:58 — 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:

@izquiratops
izquiratops / Install_OpenCV4_CUDA10.md
Created September 5, 2019 09:04 — forked from raulqf/Install_OpenCV4_CUDA12.6_CUDNN8.9.md
How to install OpenCV 4.1 with CUDA 10.0 in Ubuntu 18.04

How to install OpenCV 4.1.0 with CUDA 10.0 in Ubuntu distro 18.04

First of all install update and upgrade your system:

    $ sudo apt update
    $ sudo apt upgrade

Then, install required libraries:

@izquiratops
izquiratops / gpu_stat.py
Created August 27, 2019 07:25 — forked from matpalm/gpu_stat.py
json formatting of nvidia-settings
#!/usr/bin/env python
# gpu_stat.py [DELAY [COUNT]]
# dump some gpu stats as a line of json
# {"util":{"PCIe":"0", "memory":"11", "video":"0", "graphics":"13"}, "used_mem":"161"}
import json, socket, subprocess, sys, time
try:
delay = int(sys.argv[1])
except:
delay = 1