I’m not a huge fan of Bing search engine, I’ve tried to use it but I don’t like the format of the search results and I don’t think it’s particularly good at finding relevant results either.
I do like Bing wallpapers, and I use Bing Desktop on my Windows laptop to update my desktop to Bings daily wallpaper.
Now that I’ve moved to a Mac I still want to get the picture, but the application is Windows only - so the script below will do the job for you. I’ve set it to download to the users picture folder ~/Pictures/bing-wallpapers just using the current date for the filename.
To run on a schedule, set up a cron job to run the script at 10am using crontab -e and add the line
I’ve just had an interesting problem with an SFTP account that suddenly stopped working from a cron job. When the account was used directly from the bash prompt the response was simply Connection closed immediately.
Every thing was set up correctly as far as authorized_keys and /etc/ssh/sshd_config looked fine but the account wouldn’t connect.
As I don’t have the private key for the user that was connecting to the server, I created a new key pair and added the public key to the authorized_keys file in the users .ssh folder. Using the following command I got a response that was no more helpful;
psftp email@example.com -i logdrop_pk.ppk
This gave the response;
FATAL: Recieved unexpected end-of-file from SFTP Server
After a couple more checks on the server and no success I decided to try
putty firstname.lastname@example.org -i logdrop_pk.ppk
This opened putty which connected but reported that the password for the user had expired and needed a new one. From here I was able to reset the password then go on the server and set
As part of a project I’m working on I need to create a cross join of users against symbols; the idea being that any of the given users might look at any of the given symbols. I have a list of users and a list of symbols which I essentially need a cross-join on.
For this example I’ll use cars and engine/transmission variants.
From these two lists I need to quickly create all possible combinations;
I can’t find any function that will do what I was so I’ve created a VBA function that will do it;
Function CrossJoin(r1 As Range, r2 As Range) As Variant
Dim size As Integer
Dim arr As Variant
Dim offset As Integer
size = r1.Rows.Count * r2.Rows.Count
ReDim arr(0 To size, 0 To 1)
offset = 0
For i = 1 To r1.Rows.Count
For j = 1 To r2.Rows.Count
arr(offset, 0) = r1.Cells(i, 1).Value2
arr(offset, 1) = r2.Cells(j, 1).Value2
offset = offset + 1
CrossJoin = arr
To use the function select and empty cell and insert =CROSSJOIN(A1:A4, B1:B4) (adjusting the input range as required) then when the function has evaluated extend the range to the size of the expected cross join. (in this case 16x2).
To calculate the array function hit F2 then press Ctrl+Shift+Enter to calculate the array.