Can I change the site homepage within a Site Design script?

I’ve created a site design based on a number of scripts in PowerShell (via Add-SPOSiteScript -> Add-SPOSiteDesign). This creates a design with a number of lists & views, and adds URLs to those lists to the site nav-menu.

However, I also want to add views to some of the lists to the homepage, e.g. to display recently added items from a number of the lists. Is this able to be achieved from a Site Design? Or does this need to be carried out as a manual step after I’ve created the site & applied the Site Design? I can’t see any documentation about it on any of the pages that have got me to this point:

  • https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/site-design-json-schema
  • https://docs.microsoft.com/en-us/powershell/module/sharepoint-online/

Additionally, when I create a new Communication site and choose my site design during the creation step, it sets the homepage to use the version from the Topic site design instead of the version from the Blank site design. Can this be configured in my site design script?

Thanks in advance

Jason

Shutdown ESXi 6.7 with a script via SSH without entering maintenance mode

I’m trying to write a script that ssh’s to an ESXi 6.7 and shuts down the host and also shuts down the VMs according to the current system shutdown policy.

I’m running Dell customized image ESXi 6.7 in a Dell R710 with a dual Xeon X5650 and 144GB RAM.

In fact what I want is the same that I can get with:

Shutdown via GUI

Shutdown via console

I have ssh enabled in the server.

I already tryed:

1) host_shutdown.sh (it just gets there indefinitely).

2) /bin/host_shutdown.sh (it to gets there indefinitely).

3) halt (shutdowns the server but it does not shuts down the VMs)

I also tried:

esxcli system shutdown poweroff --reason I_want_IT 

but the system must be in maintenance mode and I want to do it without entering maintenance mode

I then discovered this thread here in Server Fault, but it does not work in my server (I suppose it only runs on ESXi 5):

How do I shutdown the Host over ssh on ESXi 5 so it shuts down the guests properly?

I think I’m too dumb to discover on my own how to do it, because I presume it must be a simple thing to do.

Cumulative Sum without Script

For this question, I’ve created a Google Apps Script function, that calculates the cumulative sum of a range. Martin Hawksey on Google+ made a comment about a more efficient way of calculating the cumulative sum:

function cumulativeSum(array){   var output = [];   for (i in array){     if(i==0) {       if (array[i].length > 1) throw ("Only single column of data");       output.push([array[i][0]]);     } else {       output.push([output[i-1][0] + array[i][0]]);     }   }   return output; } 

My question is: can this be achieved with the usage of formula’s?

What should be the interval for warmup script scheduled?

There are lots of Sharepoint wake up/warm up script available. But what should be the scheduled interval? I think it is based on particular environment. It is my understanding:

  1. Set IISReset at 4am and run warmup 2 minutes after. (ref: http://weblogs.asp.net/owscott/archive/2013/04/06/why-is-the-iis-default-app-pool-recycle-set-to-1740-minutes.aspx)

  2. If number of visit is very low (close to zero), I will schedule to run every 15 minutes because application pool idle timeout is 20 min (MS default).

  3. Some people said Sharepoint crawler will do the same thing as warmup script. However I doubt “incremental crawl” will visit every site collection. Also it may spend for hours to complete.

Am I understand the IIS + Sharepoint behaviour correctly?

Mark

Script “Ctrl+A” execution

I want my Bash script to execute a “Ctrl+A” on a ‘file’ from Bash code and not keyboard. In my script it performs a: wget ‘file.pdf’, then evince ‘file.pdf’. I then have to issue a keyboard “Ctrl+A” (for Select All”, then ‘copy’; ‘paste’ (to clipboard) in order to get the text. I want to have the script issue the “CTRL+A” ??

How can I apply a script to only one specific sheet within a spreadsheet?

I have a spreadsheet with two sheets called Robin and Lucy. I’ve made/found/mangled a script to sort the data on the sheet each time I add some data to column A:

function onEdit(event){    var sheet = event.source.getActiveSheet();   var editedCell = sheet.getActiveCell();    var columnToSortBy = 1;   var tableRange = "a2:I30";     if(editedCell.getColumn() == columnToSortBy){       var range = sheet.getRange(tableRange);    range.sort( { column : columnToSortBy } );   } } 

This script works well but I only want it it be applied on the first sheet, Robin. The data in the second sheet, Lucy, isn’t the same so I’m going to create another script for a different range for that one, once I get my head around this problem.

I think I need to use the getSheetByName("Robin") but I can’t seem to get it to work.

Почему php script отправки сообщения в telegram срабатывает несколько раз?

Есть бот и php файл.
Я с telegram отправляю start.
В php скрипте ($ string_input = file_get_contents('php://input');) есть такая последовательность:

if ($  text=="start"){      sendMessage(1);      first($  connect);      sendMessage(2);      second($  connect);      sendMessage(3);      third($  connect);      sendMessage(4);  } 

И это последовательность работает неправильно. В телеграм сообщения отправляются:

       ~ start    1 2 3 4 1 3 2 4 1 3   2 1   4 . . . 

Каждая функция обрабатывается примерно по минуту. Если комментировать эти функции, то все хорошо работает. Поискал в интернете, думаю проблема в ответе, либо 200 или ok, но не помогло, или я не смог.

Помогите найти решение, а то уже несколько дней не могу понять…

Distribute bash script ‘silently’ to multiple macos machines

We want to deploy a script ‘silently’ across all mac machines in organization. We have created a bash script that will run using launchd agent. we need to deploy the launchd agent and script on all macos machines. some instructions are needed during installation:

• The bash script ‘script1’ should be added to folder “/Library”

• Read and execute permissions should be added. Manually it can be done by running the command: “sudo chmod 511 /library/script1”

• The Agent “com.script1.plist” should be added to folder “/Library/LaunchAgents”

• Permission should be updated : “sudo chmod 644 /Library/LaunchAgents/com.script1.plist”

Can you please advise how to package all of this and distribute on all machines silently?

error with automator applescript “do shell script” call (file not found) yet command line with same command works

I have a simple automator app that runs a simple script. It uses ssh to open a file on the local machine, MachineA, with an app on the remote machine, MachineB, and logs the ssh call.

on run {input, parameters}     repeat with fn in input         set fn to POSIX path of fn         set fn to "/Volumes/MachineA" & fn         set fn to "\"/usr/bin/open -a /Applications/Preview.app " & fn & "\""         set cmd to "ssh -x MachineB.local " & quoted form of fn         do shell script "echo " & cmd & " >> ~/cmd.log"         do shell script cmd     end repeat end run 

The log output is:

ssh -x MachineB.local "/usr/bin/open -a /Applications/Preview.app /Volumes/MachineA/Users/<USER>/Documents/<FOLDER>/<FILE>.pdf" 

When I use the app to open a file (drag & drop), an error is thrown.

error message

However, if I copy the output in the log file to the command line, success, the file is opened on the remote machine. Why the difference?