Skip to content

Instantly share code, notes, and snippets.

@ethaniel
ethaniel / sms-to-telegram.md
Last active April 9, 2024 03:44
HOWTO: Receive SMS via 4G/LTE Huawei stick on Raspberry Pi 4 and forward them via Telegram

HOWTO: Receive SMS via 4G/LTE Huawei stick on Raspberry Pi 4 and forward them via Telegram

I live abroad and have only 1 sim card slot in my phone. It holds the SIM card of the country that I am in right now. But I also have another SIM card from my home country which receives my banking SMS codes. I can't afford to lose the "home" SIM card, so I decided to keep it in my house and forward the SMS messages to my main phone and computer via Telegram (just like Whatsapp, but so much better).

I also made a choice to use a 4G/LTE stick instead of 3G, because the 3G signal in my area is getting worse in worse due to operators upgrading their equipment.

Prerequisites

  1. Raspberry Pi 4
  2. Huawei E8372 (but can be any similar)

Step 1 - Get the Huawei card to work properly with Raspberry

@pylover
pylover / a2dp.py
Last active March 11, 2024 03:06
Fixing bluetooth stereo headphone/headset problem in ubuntu 16.04, 16.10 and also debian jessie, with bluez5.
#! /usr/bin/env python3
"""Fixing bluetooth stereo headphone/headset problem in debian distros.
Workaround for bug: https://bugs.launchpad.net/ubuntu/+source/indicator-sound/+bug/1577197
Run it with python3.5 or higher after pairing/connecting the bluetooth stereo headphone.
This will be only fixes the bluez5 problem mentioned above .
Licence: Freeware
@spinxz
spinxz / vncserver@:1.service
Last active January 25, 2024 01:42
systemd service file for running a vncserver (e.g. tightvncserver)
# Vncserver service file for Debian or Ubuntu with systemd
#
# Install vncserver and tools
# e.g. apt-get install tightvncserver autocutsel gksu
#
# 1. Copy this file to /etc/systemd/system/vncserver@:1.service
# 2. Edit User=
# e.g "User=paul"
# 3. Edit the vncserver parameters appropriately in the ExecStart= line!
# e.g. the -localhost option only allows connections from localhost (or via ssh tunnels)
@chrisgillis
chrisgillis / ssl_smtp_example.go
Created April 16, 2014 14:48
Golang SSL SMTP Example
package main
import (
"fmt"
"log"
"net"
"net/mail"
"net/smtp"
"crypto/tls"
)
@Takhion
Takhion / ArcUtils.java
Last active April 11, 2022 02:29
Collection of methods to achieve better circular arc drawing, as Canvas.drawArc() is unreliable. See the related article: https://medium.com/p/9155f49166b8
/**
* ArcUtils.java
*
* Copyright (c) 2014 BioWink GmbH.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@granoeste
granoeste / EachDirectoryPath.md
Last active April 4, 2024 22:32
[Android] How to get the each directory path.

System directories

Method Result
Environment.getDataDirectory() /data
Environment.getDownloadCacheDirectory() /cache
Environment.getRootDirectory() /system

External storage directories