Skip to content

Instantly share code, notes, and snippets.

@vincent1890
vincent1890 / sms-to-telegram.md
Created March 15, 2025 17:00 — forked from hogliux/sms-to-telegram.md
Notes on sms forwarding with huawei E8372h-320 on debian bullseye raspberry pi OS

These notes are based on ethaniel's excellent guide. Please read that guide first and then consult these notes on some changes/tweeks I needed to do to get this running on the newest raspberyr pi OS (January 2023) with a Huawei E8372h-320 (2020 model).

Setup SMS forwarding with gammu on debian bullseye on a rasp pi B+ with the HUAWEI E8372h-320 (2020 model)

First and foremost we need to get the huawei into the correct mode. Unfortunately, usb modeswitch did not do this out-of-the-box for me.

Ensuring that the huawei stick does not switch into an incompatible mode automatically

Blacklist cdc_ether by creating a file /etc/modprobe.d/blacklist-huawei-cdc-usb-net.conf with the following contents:

@vincent1890
vincent1890 / sms-to-telegram.md
Created March 15, 2025 17:00 — forked from ethaniel/sms-to-telegram.md
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

@vincent1890
vincent1890 / dockerizeWireguardOverWebsocket.md
Created May 30, 2024 18:08 — forked from jvdi/dockerizeWireguardOverWebsocket.md
Set Up a dockerize Wireguard VPN Server over WebSocket Tunneling

This tutorial good for Linux or Unix system at the end need to run bash script for connect
(Also it's have some technic for use in windows - Explained at client install section.)

VPS => virtual private server as wiregurd vpn server

Requirements

  • Assuming the firewall is off (Not Secure - it's just for test so in production: config firewall)
  • VPS have docker and docker-compose (for install instrucrion : docker site full explained)
  • In VPS enable net.ipv4.ip_forward=1 at /etc/sysctl.conf (or /etc/sysctl.d/99-sysctl.conf) and reboot your system
  • Have access to root user in VPS
if (!(Get-InstalledModule -Name Proxx.SNMP)) {
try {Install-Module -Name Proxx.SNMP}
catch {Write-Host "`nYou need `"Proxx.SNMP`" module. Restart with administrator rights for installation or do it manually. (Install-Module -Name Proxx.SNMP)" -BackgroundColor DarkRed; break}}
$target=Read-Host -Prompt "Enter printer ip or hostname"
$connect=Test-Connection -ComputerName $target -Count 1 -ErrorAction SilentlyContinue
$ip=$connect.IPV4Address.IPAddressToString
$items=@{Model="1.3.6.1.2.1.25.3.2.1.3.1";#"1.3.6.1.2.1.43.5.1.1.16.1";
SN="1.3.6.1.2.1.43.5.1.1.17.1"
Name="1.3.6.1.2.1.1.5.0";
function Get-XmlFileTreeAppend
{
param(
[Parameter(ParameterSetName='Path', Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)]
[string[]]
${Path},
[Parameter(ParameterSetName='LiteralPath', Mandatory=$true, ValueFromPipelineByPropertyName=$true)]
[Alias('PSPath')]
[string[]]
#define scan account
$domain = "DOMAIN"
$name = "NAME"
$scandef = "DOMAIN\NAME"
#get username
$getusername = (Get-WmiObject -Class Win32_ComputerSystem).Username
function scanacl() {
#set full access for scan
$access=New-Object System.Security.AccessControl.FileSystemAccessRule ("$scandef","FullControl","ContainerInherit,ObjectInherit","None","Allow")
$ACL = Get-Acl -Path C:\Scan
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing")
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
#[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.SystemParameters")
$bounds = [System.Windows.Forms.Screen]::PrimaryScreen
$w = $bounds.bounds.width#[System.Windows.SystemParameters]::VirtualScreenWidth
$h = $bounds.bounds.height#[System.Windows.SystemParameters]::VirtualScreenHeight
$img = New-Object System.Drawing.Bitmap($w, $h, [System.Drawing.Imaging.PixelFormat]::Format32bppArgb)
@vincent1890
vincent1890 / exchange_remote_connect.ps1
Created May 28, 2024 18:29 — forked from Santaro255/exchange_remote_connect.ps1
create\remove PSSession to Exchange server
$q=Read-Host -Prompt "connect\disconnect"
switch ($q) {
{$q -eq "connect"} {$fqdn=Read-Host -Prompt "Enter FQDN"
$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://"$fqdn"/PowerShell/ -Authentication Kerberos -Credential $UserCredential
Import-PSSession $Session -DisableNameChecking}
{$q -eq "disconnect"} {Remove-PSSession $Session}
}
New-PSDrive -PSProvider Registry -Root HKEY_CLASSES_ROOT -Name HKCR -ErrorAction SilentlyContinue
$list=@(
'.7z',
'.zip',
'.rar',
'.001',
'.cab',
'.iso',
'.xz',
'.txz',
##### edit #############
$computer = "localhost"
$printerName = "HP Color LaserJet CP2020 Series PCL 6"
$portName = "\\HOSTNAME\HP Color LaserJet CP2020 Series PCL6"
$driverPath = "\\HOSTNAME\Drivers\hp2025"
$inf_x86 = "hppcp610.inf"
$inf_x64 = "hppdp610.inf"
#########################
#platform
switch ($ver = (Get-WmiObject -Class win32_operatingsystem).OSArchitecture) {