Friday, December 30, 2022

Thursday, December 29, 2022

Kingstone SSD Asus X515 Windows clean install

 ++


https://www.howtogeek.com/855298/gogs-is-the-easiest-way-to-run-a-local-git-server-how-to-set-it-up/


Do you need encouragement while typing the best code ever?

Try this:




ПСАЛАМ 91.

Који живи у заклону Вишњега у сјену свемогућега почива.

Говори Господу: ти си уточиште моје и бранич мој, Бог мој, у којега се уздам.

Он ће те избавити из замке птичареве, и од љутога помора;

Перјем својим осјениће те, и под крилима његовијем заклонићеш се; истина је његова штит и ограда.

Не ћеш се бојати страхоте ноћне, стријеле, која лети дању,

Помора, који иде по мраку, болести, која у подне мори.

Пашће поред тебе тисућа и десет тисућа с десне стране теби, а тебе се не ће дотаћи.

Само ћеш гледати очима својима, и видјећеш плату безбожницима.

Јер си ти, Господе, поуздање моје. Вишњега си изабрао себи за уточиште.

Неће те зло задесити, и ударац не ће досегнути до колибе твоје.

Јер анђелима својим заповиједа за тебе да те чувају по свијем путовима твојим.

На руке ће те узети да гдје не запнеш за камен ногом својом.

На лава и на аспиду наступаћеш и газићеш лавића и змаја.

Кад ме љуби, избавићу га; заклонићу га, кад је познао име моје.

Зазваће ме , и услишићу га; с њим ћу бити у невољи, избавићу га и прославићу га,

Дуга живота наситићу га, и показаћу му спасење своје.

ПСАЛМИ ДАВИДОВИ, превео Ђуро Даничић, у Београду, Издање британског и иностраног библијског друштва 1937.

Wednesday, December 28, 2022

RDP tunneling Lazarus-ide



 {$mode objfpc}{$H+}


uses
  Classes, SysUtils, IdGlobal, IdTCPServer, IdContext, IdTCPClient, IdThread;

type
  TRDPTunnel = class(TIdTCPServer)
  private
    FTargetHost: string;
    FTargetPort: Integer;
    procedure Execute(AContext: TIdContext);
  public
    constructor Create(AOwner: TComponent); override;
  end;

  TRDPTunnelThread = class(TIdThread)
  private
    FClient: TIdTCPClient;
    FServer: TRDPTunnel;
    procedure ForwardData;
  public
    constructor Create(AClient: TIdTCPClient; AServer: TRDPTunnel);
  end;

constructor TRDPTunnel.Create(AOwner: TComponent);
begin
  inherited Create(AOwner);
  OnExecute := @Execute;
end;

procedure TRDPTunnel.Execute(AContext: TIdContext);
var
  Client: TIdTCPClient;
begin
  Client := TIdTCPClient.Create(nil);
  try
    Client.Connect(FTargetHost, FTargetPort);
    TRDPTunnelThread.Create(AContext.Connection, Client, Self);
  except
    on E: Exception do
    begin
      AContext.Connection.Disconnect;
      Client.Disconnect;
      raise;
    end;
  end;
end;

constructor TRDPTunnelThread.Create(AServer: TIdTCPConnection; AClient: TIdTCPClient; AServer: TRDPTunnel);
begin
  inherited Create(True);
  FClient := AClient;
  FServer := AServer;
  FreeOnTerminate := True;
  Start;
end;

procedure TRDPTunnelThread.ForwardData;
var
  Buffer: TIdBytes;
begin
  SetLength(Buffer, 1024);
  while not Terminated do
  begin
    if FServer.Connection.Connected and FClient.Connected then
    begin
      FServer.Connection.ReadBytes(Buffer, Length(Buffer));
      FClient.Write(Buffer);
    end
    else
      Break;
  end;
end;

var
  Tunnel: TRDPTunnel;

begin
  Tunnel := TRDPTunnel.Create(nil);
  try
    Tunnel.DefaultPort := 13000;
    Tunnel.FTargetHost := '127.0.0.1';
    Tunnel.FTargetPort := 3389;
    Tunnel.Active := True;
    WriteLn('RDP tunnel started, press Enter to stop.');
    ReadLn;

RDP tunneling C#

 using System;

using System.Net;
using System.Net.Sockets;
using System.Threading;

namespace RDPTunnel
{
    class Program
    {
        static void Main(string[] args)
        {
            // Parse command line arguments
            string targetHost = args[0];
            int targetPort = int.Parse(args[1]);
            int listenPort = int.Parse(args[2]);

            // Create a TcpListener to listen for incoming connections
            TcpListener listener = new TcpListener(IPAddress.Any, listenPort);
            listener.Start();

            Console.WriteLine($"Listening for incoming connections on port {listenPort}...");

            while (true)
            {
                // Accept an incoming connection
                TcpClient client = listener.AcceptTcpClient();

                Console.WriteLine("Incoming connection accepted!");

                // Create a new thread to handle the connection
                Thread thread = new Thread(() => HandleConnection(client, targetHost, targetPort));
                thread.Start();
            }
        }

        static void HandleConnection(TcpClient client, string targetHost, int targetPort)
        {
            // Connect to the target host
            TcpClient targetClient = new TcpClient(targetHost, targetPort);

            // Create two NetworkStreams, one for each direction of the connection
            NetworkStream clientStream = client.GetStream();
            NetworkStream targetStream = targetClient.GetStream();

            // Create a byte array to store incoming data
            byte[] buffer = new byte[1024];

            // Continuously read data from the client and write it to the target host
            while (true)
            {
                int bytesRead = clientStream.Read(buffer, 0, buffer.Length);
                if (bytesRead == 0) break;
                targetStream.Write(buffer, 0, bytesRead);
            }

            // Close the streams and the client sockets
            clientStream.Close();
            targetStream.Close();
            client.Close();
            targetClient.Close();
        }
    }
}


************************



Remote Desktop Protocol (RDP) is a proprietary protocol developed by Microsoft that allows users to remotely connect to and control another computer over a network connection. Tunneling RDP involves creating an encrypted tunnel through which RDP traffic can be transmitted, usually to bypass network restrictions or to protect RDP traffic from being intercepted.

Here is an example of a C# program that uses the .NET Framework's TcpClient and NetworkStream classes to create a simple RDP tunnel:

This program listens for incoming connections on a specified port and forwards all data received from the client to a target host. To use the program, you would start the server and then connect to it using an RDP client, specifying the listening port as the destination. The server would then forward all RDP traffic to the target host, effectively creating a tunnel for the RDP connection. Keep in mind that this is just a basic example and there are many different ways you can implement a RDP tunnel. For example, you might want to add encryption to the tunnel to protect the RDP traffic, or you might want to add additional functionality to the server, such as support for multiple connections or a way to control the target host. I hope this helps!

Client Server C#

 using System;

using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading;

namespace Server
{
    class Program
    {
        static void Main(string[] args)
        {
            // Create a new server socket
            Socket serverSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);

            // Bind the socket to a local endpoint
            IPEndPoint localEndPoint = new IPEndPoint(IPAddress.Any, 13000);
            serverSocket.Bind(localEndPoint);

            // Start listening for incoming connections
            serverSocket.Listen(10);

            Console.WriteLine("Waiting for a connection...");

            // Accept incoming connections
            Socket clientSocket = serverSocket.Accept();

            Console.WriteLine("Connected!");

            // Receive data from the client
            byte[] buffer = new byte[1024];
            int bytesReceived = clientSocket.Receive(buffer);
            string data = Encoding.ASCII.GetString(buffer, 0, bytesReceived);
            Console.WriteLine("Received: " + data);

            // Send a response back to the client
            string response = "Thank you for connecting!";
            byte[] responseBuffer = Encoding.ASCII.GetBytes(response);
            clientSocket.Send(responseBuffer);

            // Close the socket
            clientSocket.Shutdown(SocketShutdown.Both);
            clientSocket.Close();
        }
    }
}


********************

using System;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading;

namespace Client
{
    class Program
    {
        static void Main(string[] args)
        {
            // Create a new client socket
            Socket clientSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);

            // Connect to the server
            IPEndPoint serverEndPoint = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 13000);
            clientSocket.Connect(serverEndPoint);

            Console.WriteLine("Connected to server!");

            // Send a message to the server
            string message = "Hello from the client!";
            byte[] buffer = Encoding.ASCII.GetBytes(message);
            clientSocket.Send(buffer);

            // Receive a response from the server
            buffer = new byte[1024];
            int bytesReceived = clientSocket.Receive(buffer);
            string response = Encoding.ASCII.GetString(buffer, 0, bytesReceived);
            Console.WriteLine("Received: " + response);

            // Close the socket
            clientSocket.Shutdown(SocketShutdown.Both);
            clientSocket.Close();
        }
    }
}

Monday, December 26, 2022

Back to Windows 10 from bad Windows 11

 https://support.lenovo.com/cr/th/solutions/ht512969-how-to-downgrade-from-windows-11-to-windows-10


Downgrade within 10 days



Open Settings.
Select System.
Select the Recovery page on the right side.
Recovery
Under the Recovery options section, in the Previous version of Windows settings, select the Go back button.
Go back
Select an available reason.
Select the Next button.
Select the No, thanks button.
No thanks
Select the Next button.
Select the Next button again.
Select the Go back to earlier build button.
Go back
After the steps are complete, the setup process will revert the system back to the previous version of the operating system.



MORE TIPS in C#:



Lazarus-ide:

function tiCreateGUIDString: string;
{$IFDEF FPC}
var
  lGUID: TGUID;
{$ENDIF}
begin
{$IFDEF FPC}
  CreateGUID(lGUID);
  Result := GUIDToString(lGUID);
{$ELSE}
  Result := tiWin32CoCreateGUID;
{$ENDIF}
end;      

procedure TForm1.Button1Click(Sender: TObject);
begin
  Showmessage(tiCreateGUIDString);
end;   





My own server client C#

 using System.Net.Sockets;


// Connect to the server
TcpClient client = new TcpClient("server_address", 8080);

// Send a request to the server
NetworkStream stream = client.GetStream();
byte[] request = Encoding.UTF8.GetBytes("Hello from the client!");
stream.Write(request, 0, request.Length);

// Receive a response from the server
byte[] response = new byte[1024];
int bytesReceived = stream.Read(response, 0, response.Length);
String responseString = Encoding.UTF8.GetString(response, 0, bytesReceived);
Console.WriteLine("Response from server: " + responseString);

******************


 

using System.Net.Sockets;

// Set up the server
TcpListener server = new TcpListener(8080);
server.Start();

// Wait for a client to connect
TcpClient client = server.AcceptTcpClient();

// Read the request from the client
NetworkStream stream = client.GetStream();
byte[] request = new byte[1024];
int bytesReceived = stream.Read(request, 0, request.Length);
String requestString = Encoding.UTF8.GetString(request, 0, bytesReceived);
console.WriteLine("Request from client: " + requestString);

// Send a response to the client
byte[] response = Encoding.UTF8.GetBytes("Hello from the server!");
stream.Write(response, 0, response.Length);

My own server client PHP

<?php
// Set up the server
$server = stream_socket_server("tcp://0.0.0.0:8080", $errno, $errorMessage);
if ($server === false) {
    throw new Exception($errorMessage);
}

// Wait for a client to connect
$client = stream_socket_accept($server);

// Read the request from the client
$request = fread($client, 1024);
echo "Request from client: " . $request . "\n";

// Send a response to the client
$response = "Hello from the server!";
fwrite($client, $response);

// Close the connection
fclose($client);

***********


//Set up the client

<button onclick="sendRequest()">Send request</button>
<script>
function sendRequest() {
    var xhttp = new XMLHttpRequest();
    xhttp.onreadystatechange = function() {
        if (this.readyState == 4 && this.status == 200) {
            alert(this.responseText);
        }
    };
    xhttp.open("POST", "server.php", true);
    xhttp.send("Hello from the client!");
}
</script>

Friday, December 23, 2022

Printer Share

 

Firewalls

This help document describes the ports that CUPS uses so that firewall administrators can allow traffic used for printing.

Ports Used for Printer Sharing

Table 1 lists the ports that are used for IPP printer sharing via CUPS.

Table 1: Ports Used for IPP Printer Sharing
(Destination) PortTCP/UDPDirectionDescription
53 (DNS)TCP/UDPOUTDomain Name System lookups and service registrations.
631 (IPP/IPPS)TCPINInternet Printing Protocol requests and responses (print jobs, status monitoring, etc.)
5353 (mDNS)UDPIN+OUTMulticast DNS lookups and service registrations.

Table 2 lists the ports that are used for SMB (Windows) printer sharing, typically via the Samba software.

Table 2: Ports Used for SMB Printer Sharing
(Destination) Port(s)TCP/UDPDirectionDescription
137 (WINS)UDPIN+OUTWindows Internet Naming Service (name lookup for SMB printing).
139 (SMB)TCPINWindows SMB printing.
445 (SMBDS)TCPIN+OUTWindows SMB Domain Server (authenticated SMB printing).

Ports Used for Network Printers

Table 3 lists the ports for outgoing network traffic that are used for network printers.

Notes:
  1. DNS and mDNS are used for all printing protocols except SMB.
  2. SNMP is used to provide status and supply level information for AppSocket and LPD printers.
Table 3: Outgoing Ports Used for Network Printers
(Destination) Port(s)TCP/UDPDescription
53 (DNS)TCP/UDPDomain Name System lookups.
137 (WINS)UDPWindows Internet Naming Service (name lookup for SMB printing).
139 (SMB)TCPWindows SMB printing.
161 (SNMP)UDPSNMP browsing (broadcast) and status monitoring (directed to printer IP address).
443 (IPPS)TCPInternet Printing Protocol requests and responses (print jobs, status monitoring, etc.)
445 (SMBDS)TCPWindows SMB Domain Server (authenticated SMB printing).
515 (LPD)TCPLine Printer Daemon (LPD/lpr) print job submission and status monitoring.
631 (IPP/IPPS)TCPInternet Printing Protocol requests and responses (print jobs, status monitoring, etc.)
5353 (mDNS)UDPMulticast DNS lookups.
9100-9102TCPRaw print data stream (AppSocket/JetDirect).





+ +



++

Smartcard on UBUNTU, HOW TO SHARE FOLDER AND PRINER ON UBUNTU & ZorinOSLite

Super safe server for peanuts:

1)

 https://ubuntu.com/server/docs/security-smart-cards

https://www.ca.posta.rs/preuzimanje_softvera.htm

2)

HOW TO SHARE FOLDER AND PRINER ON UBUNTU & ZorinOSLite:

https://phoenixnap.com/kb/ubuntu-samba

https://wiki.samba.org/index.php/Setting_up_Samba_as_a_Print_Server

https://www.makeuseof.com/set-up-network-shared-folder-ubuntu-with-samba/

https://fedoraforum.org/forum/printthread.php?t=113307&pp=80


Next, we have to make sure CUPS is OK with the sharing. Open up Firefox or your other favourite browser and browse to:

http://localhost:631/printers


Now, browse to:

http://localhost:631/admin


. Make sure that 'Share published printers connected to this system' is checked (enabled).


Note: You need to have administrative privileges to edit the configuration file.

sudo vim /etc/samba/smb.conf

Add the following lines to the bottom of the config file.

[sambashare]
comment= Network Shared Folder by Samba Server on Ubuntu
path = /home/your_username/sambashare
force user = smbuser
force group = smbgroup
create mask = 0664
force create mode = 0664
directory mask = 0775
force directory mode = 0775
public = yes
read only = no

Remember to update the path parameter with your username. You can get your username by running the following command:

echo $USER

To exit the Vim editor after making your changes, simply type :wq and press the Enter key.


https://chat.openai.com/auth/login

https://openai.com/blog/chatgpt/

IDS / IPS :

https://openwips-ng.org/

https://www.fail2ban.org/wiki/index.php/Main_Page

https://zeek.org/

https://www.itprc.com/intrusion-prevention-detection-tools/

Do you need encouragement while typing the best code ever?

Try this:


https://www.tp-link.com/us/support/faq/744/

https://www.tp-link.com/us/support/faq/1497/

https://www.tp-link.com/us/support/faq/1529/

Tuesday, December 20, 2022

Do This After Installing Windows 11

 ++


Do This After Installing Windows 11 In this video I show you how to tweak Windows 11 settings and do the best optimizations for Windows 11 for gaming and performance. This should lower system resources. These optimizations can help gain a little FPS, lower latency and give the pc higher stability by lower utilization of windows. Use the program at your own risk. If this program gets flagged as malware it's a false positive. github.com/xemulat/XToolbox


MORE TIPS FOR PROGRAMMERS:


https://www.howtogeek.com/851425/git-rename-branch/


method 1:

++

method2:

https://youtu.be/H9vJBx2PoD0

https://pegasun.com/system-utilities

Lynis is a battle-tested security tool for systems running Linux, macOS, or Unix-based operating system. It performs an extensive health scan of your systems to support system hardening and compliance testing.

https://cisofy.com/lynis/


Tripwire Integrity Management
Detect and neutralize threats on-site and in the cloud
with superior security and continuous compliance.

https://www.tripwire.com/


Do you need encouragement while typing the best code ever?

Try this:


TIP OF THE DAY !

DOT. NET 3.5 WINDOWS 10 INSTALL...

Thursday, December 15, 2022

Nir Launcher

 https://www.majorgeeks.com/files/details/nirlauncher.html



MORE TIPS=

Otvaranje naloga za subjekte privatnog sektora na Sistemu eFaktura

Sistem e-faktura: Prijava na sistem

Sistem e-faktura: Uputstvo za korisnike


https://www.biljanatrifunovicifa.com/2021/08/knjizno-odobrenje/

https://besplatniobrasci.com/knjizno-zaduzenje/

Yes, You can delete:

C:\Windows\SoftwareDistribution\Download\

if you have any issues with windows update or slowdown of your computer.

The Software Distribution folder is a vital component for Windows Update, which temporarily stores files needed to install new updates. It's safe to clear the content of the said folder because Windows 10 will always re-download and re-created all the necessary file and components, if removed. We always did this as a troubleshooting method if we're having trouble with Windows update.

MORE TO DO:

https://www.ubackup.com/windows-11/windows-11-keeps-freezing.html

DISM.exe /Online /Cleanup-image /Restorehealth

sfc /scannow

chkdsk c: /f /r

appwiz.cpl

Uninstall Sonic Studio 3

https://www.howtogeek.com/805550/the-7-best-registry-hacks-for-windows-11/

https://www.makeuseof.com/common-windows-11-problems

https://www.makeuseof.com/best-coding-apps-for-android

Install Guides (WINE, DXVK, Lutris, etc) linuxconfig.org/improve-your-wine-gaming-on-linux-with-dxvk linuxhint.com/install-lutris-linux




Wednesday, December 14, 2022

An interesting distros

 Big Linux : biglinux.com.br

Modicia OS : modiciaos.cloud
Makulu Linux : makululinux.com

https://downloads-global.3cx.com/downloads/debian10iso/debian-amd64-netinst-3cx.iso






Paradajz
Kelj
Paprika
Brokoli
Pasulj
Riba
Lubenica
Crvene bobice
Citrus voće
Jetra
Kikiriki
Crni i beli luk
Nar
Pileće meso
Sojino mleko
Karfiol
Maline
------------//////nono=
Crveno meso
Rafinisani šećer i brašno
Kofein i alkoholna pića
Mlečne proizvode
Natrijum

++


Do you need encouragement while typing the best code ever?

Try this:


Brezobrazni Winblows folder koji usporava Winblows:
C:/Windows/SoftwareDistribution/Download/

Besplatna zabava za novogodisnje praznike:

https://store.steampowered.com/app/1286830/STAR_WARS_The_Old_Republic/