Skip to content

Instantly share code, notes, and snippets.

View Thelouras58's full-sized avatar
🎯
Focusing

Kostas Thelouras Thelouras58

🎯
Focusing
View GitHub Profile
@Thelouras58
Thelouras58 / AuthInterceptorImpl.kt
Created February 5, 2023 17:39
Android: Auth2Interceptor
class AuthInterceptorImpl @Inject constructor(
private val sessionManager: SessionManager
) : Interceptor {
override fun intercept(chain: Interceptor.Chain): Response {
val request = chain.request()
var accessToken = sessionManager.getAccessToken()
val response = chain.proceed(newRequestWithAccessToken(accessToken, request))
@Thelouras58
Thelouras58 / BasicAuthInterceptor.kt
Last active February 5, 2023 17:37
Android: Basic Auth Interceptor
class BasicAuthInterceptor(username: String, password: String): Interceptor {
private var credentials: String = Credentials.basic(username, password)
override fun intercept(chain: Interceptor.Chain): okhttp3.Response {
var request = chain.request()
request = request.newBuilder().header("Authorization", credentials).build()
return chain.proceed(request)
}
}
#Generate Random Passwords from the CMD
openssl rand -base64 8
#or
openssl rand -hex 8
#From the current dates with some hash:
date |md5 | head -c8; echo
#Or even from a ping:

Keybase proof

I hereby claim:

  • I am Thelouras58 on github.
  • I am thelouras (https://keybase.io/thelouras) on keybase.
  • I have a public key whose fingerprint is 2340 B946 55AD 6442 A8A0 0A04 53F2 6F7B F50E 6680

To claim this, I am signing this object:

@Thelouras58
Thelouras58 / Android Studio .gitignore
Created May 23, 2018 21:57 — forked from iainconnor/Android Studio .gitignore
A .gitignore for use in Android Studio
# Built application files
/*/build/
# Crashlytics configuations
com_crashlytics_export_strings.xml
# Local configuration file (sdk path, etc)
local.properties
# Gradle generated files
@Thelouras58
Thelouras58 / rsa.c
Last active February 19, 2024 10:46
RSA implementation in C
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <math.h>
#include <sys/types.h>
#include "gmp.h"
@Thelouras58
Thelouras58 / CertificateUtils.java
Created October 24, 2017 16:03
Using Bouncy Castle Library _Certificates
package StS;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.math.BigInteger;
import java.security.InvalidKeyException;
import java.security.Key;