Skip to content

Instantly share code, notes, and snippets.

@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) {
@vincent1890
vincent1890 / pzem_004t.py
Created August 25, 2023 17:55 — forked from bandaangosta/pzem_004t.py
Reading PZEM-004t power sensor (new version v3.0) through Modbus-RTU protocol over TTL UART
# Reading PZEM-004t power sensor (new version v3.0) through Modbus-RTU protocol over TTL UART
# Run as:
# python3 pzem_004t.py
# To install dependencies:
# pip install modbus-tk
# pip install pyserial
import serial
import modbus_tk.defines as cst
@vincent1890
vincent1890 / boot.config
Created September 9, 2022 10:40 — forked from kgersen/boot.config
orange ERL 3 - remplacement complet de la Livebox routeur
firewall {
all-ping enable
broadcast-ping disable
ipv6-receive-redirects disable
ipv6-src-route disable
ip-src-route disable
log-martians enable
name WAN_IN {
default-action drop
description "Packets from Internet to LAN"