OpenVPN server interface sharing issues on Windows Server 2019

Let me explain my problem to you. I put OpenVPN on a Windows Server 2019. However I have a problem with the network interface sharing. When I restart the server. The sharing doesn’t work anymore. I need to disable the sharing and reactivate it and restart the OpenVPN services for it to work. Would you have a solution to offer me ?

unity – Running into memory issues during procedural generation

I’m procedurally generating a map of hex cells and creating a variety of paths along this grid. As I’m creating these paths every about 10 runs of the game, Unity is running out of memory while generating said paths. I’m new to advanced programming like this and I’m not sure how to track down where my problems are and how I can go about fixing them. Here is an image of the Unity error message:

enter image description here

The general approach for the path generation is this:

  • First create and instantiate a grid of hex cells for a certain region size.
  • Create a set of randomly distributed points within the region size using Poisson disc sampling
  • Then take these points and assign them to there corresponding cells, and convert the cells to a hex node, creating a list of “encounters”
  • I then have 2 functions for finding a horizontal path or vertical path between these encounter nodes. These functions basically just search around the starting node for the closest encounter points and adds them to list a connections, and then choices a random connected point and moves to it as long as it is valid, then repeat.

Here’s the code:

static List<HexNode> GetConnections(HexNode currentNode)
{
    List<HexCell> connections = new List<HexCell>();
    List<HexCell> conectList = new List<HexCell>();
    List<HexCell> searchList = new List<HexCell>();
    HexCell currentCell = currentNode.cell;
    int loops = Mathf.CeilToInt(radius + 1);

    searchList.Add(currentCell);

    for (int i = 0; i < loops; i++)
    {
        conectList.Clear();

        foreach (HexCell c in searchList)
        {
            foreach (HexCell n in c.neighbors)
            {
                if (n != null && n != currentCell)
                {
                    if (!connections.Contains(n))
                    {
                        connections.Add(n);
                    }
                    conectList.Add(n);
                }
            }
        }

        searchList.Clear();
        foreach (HexCell c in conectList)
        {
            searchList.Add(c);
        }
    }

    List<HexNode> connectedNodes = new List<HexNode>();
    foreach(HexNode encounter in nodes)
    {
        if (connections.Contains(encounter.cell))
        {
            connectedNodes.Add(encounter);
        }
    }

    return connectedNodes;
}

public static List<HexCell> VerticalPath(int number)
{
    List<HexNode> topNodes = new List<HexNode>();
    foreach(HexNode node in nodes)
    {
        if(node.cell.offsetCoordinates.y > regionSize.y * .9f)
        {
            if(number == 1) // Left path
            {
                if (node.cell.offsetCoordinates.x < regionSize.x * .33f)
                {
                    topNodes.Add(node);
                }
            }
            else if(number == 2) // Middle path
            {
                if (node.cell.offsetCoordinates.x > regionSize.x * .33f && node.cell.offsetCoordinates.x < regionSize.x * .66f)
                {
                    topNodes.Add(node);
                }
            }
            else if(number == 3) // Right path
            {
                if (node.cell.offsetCoordinates.x > regionSize.x * .66f)
                {
                    topNodes.Add(node);
                }
            }
        }
    }

    HexNode startNode = topNodes(Random.Range(0, topNodes.Count));
    HexNode endNode = new HexNode();

    bool searching = true;
    HexNode currentNode = startNode;
    
    while (searching)
    {
        List<HexNode> connections = GetConnections(currentNode);
        List<HexNode> validMoves = new List<HexNode>();

        foreach (HexNode node in connections)
        {
            if (node.cell.coordinates.Z < currentNode.cell.coordinates.Z)
            {
                validMoves.Add(node);
            }
        }

        if (validMoves.Count < 1)
        {
            endNode = currentNode;
            searching = false;
        }
        else
        {
            int rand = Random.Range(0, validMoves.Count);
            validMoves(rand).previousNode = currentNode;
            currentNode = validMoves(rand);
        }
    }

    return RetracePath(startNode, endNode);
}

After getting the list of encounters along the path I then use A* pathfinding to make a full path along all of the cells:

public static List<HexCell> FindPath(HexCell startCell, HexCell endCell)
{
    HexNode startNode = ConvertNode(startCell);
    HexNode endNode = ConvertNode(endCell);

    List<HexNode> openList = new List<HexNode>();
    List<HexNode> closedList = new List<HexNode>();
    openList.Add(startNode);
    startNode.gCost = 0;
    startNode.hCost = DistanceTo(startNode, endNode);

    while (openList.Count > 0)
    {
        HexNode currentNode = openList(0);

        for (int i = 1; i < openList.Count; i++)
        {
            if (openList(i).fCost < currentNode.fCost || openList(i).fCost == currentNode.fCost && openList(i).hCost < currentNode.hCost)
            {
                currentNode = openList(i);
            }
        }

        openList.Remove(currentNode);
        closedList.Add(currentNode);

        if (currentNode.position == endNode.position)
        {
            endNode = currentNode;

            return RetracePath(startNode, endNode);
        }

        foreach (HexNode neighbor in GetNeighbors(currentNode))
        {
            if (closedList.Contains(neighbor))
            {
                continue;
            }

            int newMoveCost = currentNode.gCost + DistanceTo(currentNode, neighbor);
            if (newMoveCost < neighbor.gCost || !openList.Contains(neighbor))
            {
                neighbor.gCost = newMoveCost;
                neighbor.hCost = DistanceTo(currentNode, endNode);
                neighbor.previousNode = currentNode;

                if (!openList.Contains(neighbor))
                {
                    openList.Add(neighbor);
                }
            }
        }
    }

    return null;
}

I’m not sure exactly where my issue is but I feel like I’m creating way to many lists and references.

static List<HexCell> RetracePath(HexNode startNode, HexNode endNode)
{
    List<HexCell> path = new List<HexCell>();
    HexNode currentNode = endNode;

    while (currentNode != startNode)
    {
        path.Add(currentNode.cell); // 368
        currentNode = currentNode.previousNode;
    }
    path.Add(currentNode.cell);
    path.Reverse();

    return path;
}

Unity: Alpha and color issues with opaque projector/decal shader

I have been attempting to make a simple “overwrite” version of Unity’s projector shader. I can either respect the color, or respect the transparency, but not both.

I have simplified the frag method to simply take cookie (the texture of the projection) and color tint, skipping all the fall off and fog stuff for now. I hope to eventually add those back in once I figure out what’s going wrong.

Shader "Projector/Overwrite" {
    Properties {
        _Color ("Main Color", Color) = (1,1,1,1)
        _ShadowTex ("Cookie", 2D) = "" {}
        _FalloffTex ("FallOff", 2D) = "" {}
    }
    
    Subshader {
        Tags {"Queue"="Transparent"}
        Pass {
            ZWrite Off
            ColorMask RGB
            Blend DstColor DstAlpha
            //Blend DstColor Zero
            Offset -1, -1
    
            CGPROGRAM
            #pragma vertex vert
            #pragma fragment frag
            #pragma multi_compile_fog
            #include "UnityCG.cginc"
            
            struct v2f {
                float4 uvShadow : TEXCOORD0;
                float4 uvFalloff : TEXCOORD1;
                UNITY_FOG_COORDS(2)
                float4 pos : SV_POSITION;
            };
            
            float4x4 unity_Projector;
            float4x4 unity_ProjectorClip;
            
            v2f vert (float4 vertex : POSITION)
            {
                v2f o;
                o.pos = UnityObjectToClipPos(vertex);
                o.uvShadow = mul (unity_Projector, vertex);
                o.uvFalloff = mul (unity_ProjectorClip, vertex);
                UNITY_TRANSFER_FOG(o,o.pos);
                return o;
            }
            
            fixed4 _Color;
            sampler2D _ShadowTex;
            sampler2D _FalloffTex;
            
            fixed4 frag (v2f i) : SV_Target
            {
                fixed4 texS = tex2Dproj (_ShadowTex, UNITY_PROJ_COORD(i.uvShadow));
                texS.rgb *= _Color.rgb;
                //texS.a = 1.0 - texS.a;
                return texS;

                /*texS.rgb *= _Color.rgb;
                texS.a = 1.0-texS.a;
    
                fixed4 texF = tex2Dproj (_FalloffTex, UNITY_PROJ_COORD(i.uvFalloff));
                fixed4 res = texS * texF.a;

                UNITY_APPLY_FOG_COLOR(i.fogCoord, res, fixed4(0,0,0,0));
                return res;*/
            }
            ENDCG
        }
    }
}

I am fairly certain the issue lies in the BLEND options. I can either respect the texture * color, or respect the alpha of the texture, but not both together.

Alpha is respected, but the color is no longer accurate:
Alpha is respected, but the color is no longer accurate

Alpha is ignored, but the color is accurate:
Alpha is ignored

Thanks for your guidance.

url rewriting – 404 error- issues with pages after adding custom rules for posts

I am trying to create a custom translation for my website.

Quick Story:

I am facing “404 error-Page Not Found’ issues with pages after adding custom rules in functions.php

$newrules('^th/(.*)$') = 'index.php?name=$matches(1)';
$newrules('^se/(.*)$') = 'index.php?name=$matches(1)';

with the above code, posts with /th/ slug are working perfectly fine but my pages with /th/page-name-1 … throwing 404 error-Page Not Found

So here is the complete story:

First I created a parent page “Home Thai” https://mywebsite.com/th/
and under that parent page “Home Thai”, I added the rest of the Thai language pages, so results coming like this

mywebsite.com/th/page-name-1
mywebsite.com/th/page-name-2
mywebsite.com/th/page-name-3

Now I want to set up Thai Post URL with slug (/th), and to make this, I added the below new rules in functions.php

$newrules('^th/(.*)$') = 'index.php?name=$matches(1)';
$newrules('^se/(.*)$') = 'index.php?name=$matches(1)';

with the above code, posts are working perfectly with language slug (/th/, /se/). bit my pages with /th/page-name-1 … throwing 404 error-Page Not Found

Script:

//Create a function to register a new language translation taxonomy
add_action('init','nk_add_translation_taxonomy');

function nk_add_translation_taxonomy(){
   
    global $post;
    //set the name of the taxonomy
    $taxonomy = 'nk-post-translation';
    //set the types for the taxonomy
    $object_type = array('post');

    //populate our array of names for our taxonomy
    $labels = array(
        'name'               => 'Post Translation',
        'singular_name'      => 'Post Translation',
        'search_items'       => 'Search Translation',
        'all_items'          => 'All Translation',
        'parent_item'        => 'Parent Translation',
        'parent_item_colon'  => 'Parent Translation:',
        'update_item'        => 'Update Translation',
        'edit_item'          => 'Edit Translation',
        'add_new_item'       => 'Add New Translation', 
        'new_item_name'      => 'New Translation',
        'menu_name'          => 'Post Translation',
              
    );
    
    //define arguments to be used 
    $args = array(
        'labels'            => $labels,
        'hierarchical'      => true,
        'show_ui'           => true,
        'how_in_nav_menus'  => true,
        'public'            => false,
        'show_admin_column' => true,
        'query_var'         => true,
        'rewrite'           => array('slug' => 'post-translation')
    );
    
    //call the register_taxonomy function
    register_taxonomy($taxonomy, $object_type, $args); 
}

add_filter( 'post_link', 'custom_permalink', 10, 3 ); 
add_filter( 'rewrite_rules_array','customLangaugeSlugRules');
add_filter( 'init','flushRules'); 

// creating of post permalink from taxnonmy slug
function custom_permalink( $permalink, $post, $leavename ) {
    $category = get_the_terms($post->ID,"nk-post-translation"); 

    if (  !empty($category) && $category(0)->slug == "th" )
    {
      $permalink = trailingslashit( home_url('th/' . $post->post_name ) );
    }
    elseif (  !empty($category) && $category(0)->slug == "se" )
    {
      $permalink = trailingslashit( home_url('se/' . $post->post_name ) );
    }
    else
    {
      $permalink = trailingslashit( home_url( $post->post_name ) ); 
    }
    return $permalink;
}

// using because of its flush the exixsting rules of taxnonmy slug rules
function flushRules(){
  global $wp_rewrite;
  $wp_rewrite->flush_rules();
}

// inserting new rules of taxnonmy slug
function customLangaugeSlugRules($rules)
{
    $newrules = array();

    $newrules('^se/(.*)$') = 'index.php?name=$matches(1)';
    $newrules('^th/(.*)$') = 'index.php?name=$matches(1)';

    return $newrules + $rules;
}

choice field – Simple SharePoint Flow to Send Email Issues

Christy, the problem is that your condition assumes that theNeesUpdating field is a yes/no field. However, NeesUpdating field is simply a text/choice field. So you can’t compare text to the boolean values (true and false).

So, to fix the issue, simply update your Condition to compare with Yes like on the screenshot below:

enter image description here

Remember, you don’t need any quotes or formula, you simply ned to type Yes in the condition.

port forwarding – Having issues with portfowarding on my router, out of ideas

Recently I have been trying to portfoward a minecraft server, a couple of months ago I could do it like no problem. But lately I’ve been having issues. I’m trying to port forward port 25565 (default for minecraft). I went into firewall and made some inbound and outbound rules to allow the port through. I port forward it on my HG8245W5. Here is my port mapping,

Port mapping table

Can you see if I’m doing anything wrong? Also here is my config file and firewall

Minecraft configuration
Windows firewall settings

The 192.168.100.2 is my ipv4

20.04 – How to fix issues occured after recent Ubuntu software upgrade

I have Ubuntu 20.04 LTS. Few days back, I installed software update/upgrade as recommended by Ubuntu. Which gave me some warning to install some package but completed. So I didn’t notice which package this warning was about. Now I’m having following issues that I don’t know how to resolve;

  1. Hybernet issue: When I lid down, laptop goes to hybernet issue. But Doesn’t come back to normal mode. So I need to either hold power button to shutdown or need to do proper shutdown every day.
  2. I can’t see brightness adjustment slider anymore.
  3. It doesn’t display for dual display when I connect my monitor.
  4. When I start my laptop it stuck with following message on the screen

/dev/nvme0n1p4: Clearing orphaned inode 4860675 (uid=…

/dev/nvme0n1p4: clean, 232285/7001424 files, 5575039/27951104 blocks

Now I restart my laptop in Ubuntu recovery mode and then resume, it starts normally. I need to do this everytime.

These are the changes I have noticed. I’m not sure if there are more issues.

image – How can people be expected to know about security/privacy issues that are actively silenced or never talked about?

I grew up with computers. I had no life as a kid, and none today. In many ways, I’m a stereotype. I’m now eerily rapidly approaching 40.

Yet it was only in the last 5-7 years or so that I started to understand that all kinds of image and video files, which any sane (or naive?) person would never suspect contains any additional data besides what you can see and hear, actually contain a wealth of personal information.

I’m not “just” talking about the GPS coordinates stuff (which is still so insane to me that I barely believe it), or the tons of unnecessary information that the digicams bake into the file about the camera and its settings, which are not in any way required to display the image file (and could be used to “fingerprint” and thus identify your other photos uploaded anywhere on the Internet, with nothing else connecting them).

There’s also additional layers of madness. I’ve seen Photoshop and other Adobe and non-Adobe applications bake in my PROJECT FILE OBJECT NAMES, LAYER LABELS, FULL LOCAL FILE PATHS, OS USERNAME, etc.

Once I realized this, which was a sheer coincidence, I literally fell back in my chair, thinking about all the times I have uploaded some “quick screenshot” or “doodle” to link people to in public, on IRC and elsewhere. And all those MP4 videos “exported” by Premiere Pro. Yeah… Whoever opened those and studied them could just read my full real name and inspect what I named my layers and objects and tracks and files, and where they were located on my machine. For example, I found this string in the metadata for an MP4 video which I had distributed:

J:video editingMy Full Real NameInternal Project NameFurther Personally Revealing Stringsoriginal file name which was not the same as the one I wanted to distribute.mp4

It’s not an exaggeration to say that I feel violated. No matter how “stupid” I was for not knowing about this, the fact remains that I did not. And I was supposed to be some kind of “computer nerd”. “Normal” people definitely have no idea about this. And I find it exhausting to even try to educate them about it; they just call me “tinfoil hat” or “proper mental” or similar.

And then I read some smug commentator saying things like:

Can you believe it? They didn’t even scrub their user-uploaded images from metadata! What amateurs! Hahahaha!

Of course, if I were making a service now where people could upload images, I would naturally be using some kind of command-line tool to automate the “scrubbing” of their files to protect them, most likely ExifTool (which is still far from perfect). But that’s only because I know about this. My past self, and most people, just do not. How would they?

I seriously ask you: How would they know? I’m suffocated by “noise” constantly, with 99.99% of it being utter nonsense. Finding that 0.01% of actual “real info” is a massive challenge, and you will never hear this being casually brought up. Not even among geeks. They seem to be in denial, or not want to hear about it, except for a very small number of “hackers” (lacking a better term).

troubleshooting – Having problems identifying what’s causing my connection issues

Recently I’ve been getting random high latency spikes, today I’ve been even losing my internet connection.
I have an ARRIS TM822 modem connected to a LINKSYS E1200 router via ethernet cable which is a new modem I got but I’m still getting the same issues I had with the old router. The lag spikes are most noticeable when I’m playing PS4, it is connected to the router via ethernet cable, sometimes the connection is fine for like 15 minutes then I my ping goes up to 400-700. The internet works perfectly when I connect the my PS4 or Laptop to the modem instead of the router. I tried switching the modem, switching routers, switching ethernet cables and nothing worked.