Skip to content

Instantly share code, notes, and snippets.

View manhnct's full-sized avatar
💭
Whatever you seek is seeking you

Nguyen Chu Tien Manh manhnct

💭
Whatever you seek is seeking you
  • VinSmart
  • Ha noi, Viet nam
View GitHub Profile
@manhnct
manhnct / backup_gitea.sh
Created April 25, 2024 07:34 — forked from sinbad/backup_gitea.sh
My Gitea Backup & Restore Scripts
#!/bin/bash
# `gitea dump` doesn't currently back up LFS data as well, only git repos
# It primarily backs up the SQL DB, and also the config / logs
# We'll backup like this:
# * "gitea dump" to backup the DB and config etc
# * tar / bzip all the repos since they will be skipped
# * Not rotated because git data is immutable (normally) so has all data
# * rsync LFS data directly from /volume/docker/gitea/git/lfs
# * No need for rotation since all files are immutable
@manhnct
manhnct / AuthTokenRefreshInterceptor.java
Created June 11, 2019 07:08 — forked from CarolusX74/AuthTokenRefreshInterceptor.java
How I automatically refresh OAuth "access token" with okhttp interceptors using "refresh token". All requests will wait until token refresh finished, and then will continue with the new token. - EN (By Carlos Torres)
package com.cjtp.android.api.interceptors;
import android.util.Log;
import com.google.gson.JsonObject;
import com.inviteez.android.core.Session;
import com.inviteez.android.utils.Constant;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.IOException;