Independent C library or function (on Linux) to programmatically generate a self-signed certificate [closed]

Is there a simple C library or function to programmatically generate a self-signed certificate in C on Ubuntu? Of course, one can execute a simple system("....") call to execute a CLI. I am looking for a native, small, stand-alone library just for this purpose with possibly added functionality but not with the full-weight of TLS implementations such as openssl, boringssl, mbedTls, etc.

Programmatically create a trigger within abnormally shaped room

So I’m trying to create a trigger in each of my rooms. These rooms can be created by players. Basically, I need to know all the objects in a room. These rooms can be shaped in weird and wonderful ways. I’m struggling to figure out how to “fill” an area? The other problem is that some walls are curved.

My current thinking is:

  • Loop over all the walls in a scene. Do 4 raycasts from each side of the wall and see if we hit other walls. If we do, we are likely in a room.

  • From the offset, literally check each node adjacent to that until we fill the room. Once I have this though, Im not sure what to do with it.

How do I create bounds that I can check for collisions with this data?

Get WooCommerce shipping methods programmatically

How can I retrieve the shipping methods in my WooCommerce shop? I have this on my checkout page:

my checkout page

And inside my admin it looks like this:

shipping methods in wp admin

I have tried doing:


But it does not return GLS or Click and collect text / price. It returns this data:

How do I determine whether I have just woken up, programmatically?

Let me explain the situation:

Every time I wake up, I shower, start up my PC, go make coffee and sit down at the physical desktop. I then manually double-click a shortcut to a .bat file on the virtual desktop, which starts up my “life loop”. (I don’t start it automatically because it first has to connect to the VPN and it gets generally messy for complicated reasons.)

The “life loop” is basically a “while (1) { … }” script which performs all kinds of “jobs” all day. Before the loop, it runs the following code:

"Is it less than 10 minutes since the computer was booted?" "Have we not registered the last wake time within the last 20 hours?" 

If both of these conditions are met, my script then registers the approximate “last wake time” as “the current time minus 30 minutes” (in order to account for the time it takes me to get up from the bed, shower, turn on the PC, etc.).

Normally, and for the longest time, this works perfectly. However, as I have been fearing, today, it did not register, because it had apparently been less than 20 hours (or is it more?) since the last time it registered this.

This may be dead simple to all of you, but I’ve actually been thinking about this and fine-tuning it for a long time now. However, it seems like it will never be perfect, even though I try to have a pretty rigid “sleep/wake scheme”. It seems like no matter what number of hours I choose for the second condition, it will never match for every day. It’s either too long or too short.

An obvious solution would of course be to have a separate shortcut called “start life loop and I have just woken up”, to manually tell it that yes, this is definitely when I’ve waken up. However, this doesn’t seem “clean” and it bothers me that I would have to have two separate shortcuts to start my “life loop”. It doesn’t seem as beautiful as simply running a single shortcut (or even starting it automatically on boot, which I’ll likely want sooner or later).

Also, it often happens that I’m forced to reboot the computer (or shut it down and later turn it on again) during the day, without me having any intention to go to bed/sleep. It also happens oftentimes that I have to kill the life loop temporarily without restarting the machine, for debugging and testing purposes. For this reason, I can’t just always register the “wake time” whenever I start the life loop.

It feels like there is some obvious solution to this which I just haven’t thought of, but I sure can’t figure it out. Maybe the only sane way is to have a separate shortcut for when I really have woken up, and this just cannot be reliably determined by the script’s logic?

PS: Maybe I should clarify that I have no hardware in my bed which would be able to determine when I really wake up by analyzing my brain waves or something crazy like that.

How to create thumbnails programmatically?

I’ve migrated content from a CMS (not WP) to WordPress, through a nodejs script that uses the package wpapi ( The main image is set as a featured image in WordPress. The image is created, assigned to the post id, but unfortunately, thumbnails are not generated (there are no other available sizes). Instead, if I upload an image view the WordPress UI, feature image feature, the thumbnails are generated or different file sizes are available.

For this reason, I’d like to know if there is an endpoint to do this programmatically, to generate thumbnails and assign to a post or featured image using the WordPress rest API?

Pivot not updating programmatically

I have a canvas. It has an empty game object as a child. That object has a RectTransform component. The RectTransform pivot value is set to 0.4, 0.5 (x, y). In some code I wanted to update the pivot value using the following:

Debug.Log(((RectTransform)transform).pivot);  // logs: (0.4, 0.5) ((RectTransform)transform).pivot.Set(0.3f, 0.8f); Debug.Log(((RectTransform)transform).pivot);  // logs: (0.4, 0.5) 

I don’t know why the set command is not working. The tooltip for Set is: “Set x and y components of an existing Vector2”

SSOM – How to set a custom property value when add webpart programmatically

I want to set a custom property value when add web part programmatically.

Who is the property of System.Web.UI.WebControls.WebParts.WebPart object ?

This is my code for add web part in page:

            using (SPLimitedWebPartManager manager = oWeb.GetLimitedWebPartManager(newPage.Url, PersonalizationScope.Shared))             {                 try                 {                     string wPartURL = oWeb.Site.Url + "/_catalogs/wp/ClientViewProjects.webpart";                     XmlTextReader reader = new XmlTextReader(new StringReader(oWeb.GetFileAsString(wPartURL)));                      string err = null;                     System.Web.UI.WebControls.WebParts.WebPart wp = (System.Web.UI.WebControls.WebParts.WebPart)manager.ImportWebPart(reader, out err);                     wp.ChromeType = PartChromeType.None;                     manager.AddWebPart(wp, "Header", 0); //See the description below for how to determine Zone                     manager.SaveChanges(wp);                 }                 catch (Exception ex)                 {                     LOG_STRING += string.Format("В сайт с URL:{0}{1} {2}", oWeb.ServerRelativeUrl, ex.ToString(), Environment.NewLine);                 }                 finally                 {                     manager.Web.Dispose();                 }                  newPage.CheckIn("Checked in by Code");                 newPage.ListItem.File.Publish("Publishing major version");             } 

Create user profile programmatically

I want to overwrite the existing user profile that are in sp with my own one.

public string AccountName { get; set; }  public string WorkPhone { get; set; }  public string Department { get; set; }  public string Title { get; set; }  public string DistinguishedName { get; set; }  public string WorkEmail { get; set; }  public string Office { get; set; }            protected void Page_Load(object sender, EventArgs e)         {         }          public void Create()         {              string socialDataStatsSite = SPContext.Current.Site.Url;              using (SPSite siteColl = new SPSite(socialDataStatsSite))             {                  SPServiceContext serviceContext = SPServiceContext.GetContext(siteColl);                  UserProfileManager userProfileManager = new UserProfileManager(serviceContext);                  UserProfile newProfile = userProfileManager.CreateUserProfile(AccountName, AccountName);                  newProfile[PropertyConstants.WorkPhone].Add(WorkPhone);                  newProfile[PropertyConstants.Department].Add(Department);                  newProfile[PropertyConstants.Title].Add(Title);                  newProfile[PropertyConstants.DistinguishedName].Add(AccountName);                  newProfile[PropertyConstants.Office].Add(Office);                  newProfile.Commit();              }         } 

i have put this code in visual studio and deployed it.

Were do i find it in sharepoint to activate it?

Programmatically Upload Image to Media & CDN

I’m trying to create a feature that allows my website to:

  1. Crawl through a CSV file and programmatically create a post
  2. Upload a featured image based off a URL from the CSV file to the Media Library (which is using a S3 Bucket – CDN)

Where I’m stuck is in point two, I’m not sure how to add the image to the media library and trigger the upload to the CDN, then set it as the featured image.

I’m using W3 Cache plugin to connect it to the S3 Bucket.