Skip to content

Instantly share code, notes, and snippets.

View Karklik's full-sized avatar

Karol Karklik

  • Poland
View GitHub Profile
@Karklik
Karklik / linux-bluetooth-authenticationrejected-huawei-freebuds-4i.md
Last active August 24, 2021 17:45
[FIX] Failed to pair: org.bluez.Error.AuthenticationRejected on pairing Huawei Freebuds 4i with Linux Mint 20

If you have encounter org.bluez.Error.AuthenticationRejected on pairing or connecting to buds you can try following steps

  1. Upgrade kernel to newest version e.g. 5.11.0
  2. Put buds into case but leave it open and press pairing buttion at case
  3. In terminal through bluetoothctl type devices and copy mac address of buds
[bluetooth]# devices
Device XX:XX:XX:XX:XX:XX HUAWEI FreeBuds 4i
  1. In terminal through bluetoothctl type pair <insert-copied-mac> and confirm pairing by typing yes
@Karklik
Karklik / gmail-simple-oauth2.py
Last active September 24, 2023 20:40
Python google gmail api basic oauth2 authorization
from googleapiclient.discovery import build
from oauth2client import file, client, tools
SCOPES = ['https://www.googleapis.com/auth/gmail.readonly']
# To get credentials.json see https://developers.google.com/gmail/api/quickstart/python
def get_credentials():
storage = file.Storage('storage.json')
credentials = storage.get()
if credentials is None or credentials.invalid: