Solved: How to Map a Drive from Windows 10 to OS X 10.10.5 Yosemite Server

local-security-policyWe have an increasing number of Windows 10 machines in our office, and realized that we couldn’t get them to connect to shares on our OS X 10.10.5 (Yosemite) server.  We have a bunch of Local Network Users, and had no problem connecting as them from Windows 7 machines.  But Windows 10 machines would just pop up the authentication dialog again with the message “The specified network password is not correct”.

I tried all of the Local Security Policy changes that people have mentioned on the ‘net, and nothing worked.  I finally came across somebody mentioning that you have to put the server NetBIOS Name in ALL CAPS when you authenticate.  So, in our case, we needed to make one Local Security Policy change on the Windows 10 clients and put the server name in all caps when authenticating.

Details below:
Continue reading

Google Updates PHP API Client

new-improvedYesterday I updated my example PHP code for manipulating Google Spreadsheets with the Google-provided PHP API client.  If you tried getting it to work recently and were frustrated, take another look.  Google made major changes to the client that required changing my code.

Very soon I hope to figure out and demonstrate Google’s new Execution API, which lets you write Google Apps Script (javascript) which is called by your web apps.  This would allow for much more power manipulation of Google Sheets (and other docs) from web code.

Create a Video DVD with DVD Flick

Every once in a while I need to create a video DVD that will work in a standard DVD player.  With Windows 10, Microsoft no longer provides Windows DVD Maker, so I needed to find a replacement.

DVD Flick does the job quickly and easily.  It’s simple to add titles (individual videos), add regularly spaced chapters (so you can skip forward and back a few minutes at a time), and burn a DVD with a simple menu.

Here’s a 2-minute demonstration:

[youtube width=”420″ height=”315″]https://youtu.be/02hCQv2arco[/youtube]

Solved: Vostro 3550 black screen with Windows 10

vostro-3550A friend brought over his Dell Vostro 3550 that he’d just upgraded to Windows 10.

After the upgrade, the machine would show the spinning dots of the Windows 10 boot, but then go to a black screen before the login screen showed up.  External displays worked fine, but some exploration with an external display showed that Windows 10 didn’t think there was any other display besides the external monitor.

It turns out that Dell fixed something in a recent BIOS update.  This machine was on A09, and Dell has A12 on their support site.

I had also updated the Intel HD 3000 video driver from Intel’s site, so that might also be required.  But I suspect that I didn’t need to do that.

Sheets API access with PHP part 2: Editing Rows

row-xml-previewMy previous Sheets API post demonstrated how to add rows to Google Sheets with PHP.  Some readers were interested in editing or deleting rows.

Google has a very informative reference here that describes the list-based feed for manipulating sheets.  All of my scripts have been using this method, which requires the sheet to have a single header row (I’d been lucky to use that format without knowing the requirement).  I use the example HTTP code from Google’s reference pages to give me guidance for my PHP.

I’ve added a file to the gist demonstrating how to edit a row.  Here’s what you need to know:

  1. When you get the sheet list feed (Section 3 of the first file in the gist), you need to add a header (“GData-Version” => “3.0”) to the GET request so that the Etag is returned for each line.
  2. Once you have a list of entries and find the one that you want to edit, you need to grab its Etag, Id, and the edit URL (see lines 1, 2, and 9 in the image above, and click on the image to see the whole entry).
  3. Now you just need to issue a PUT request to the edit URL and include the XML with the Etag, Id, and updated sheet data.

Hope this helps a few people!

Dreaded Google Apps error: “We’re sorry, a server error occurred. Please wait a bit and try again.”

a-server-error-occurredPeople who use my Insert and Delete Cell Add-on for Google Sheets have been reporting this error.  I was unable to recreate the error until someone shared a spreadsheet with me and I found the culprit: merged cells.

What’s going on?

merged-cellsWhen you insert cells and shift the existing contents down, my Add-on selects the range of cells from your selection to the bottom of the sheet and moves it down.  But if there are merged cells below your selection, the new range doesn’t make sense and an error is generated.  The same thing happens if you try to delete and shift up, or if you try to shift left or right with merged cells to the right of your selection.

Why not catch the error and generate a friendly error message?

I’ve been trying, but this error isn’t triggering the try – catch section of my code.  There also isn’t a way to detect merged cells without trying some strange tricks that would take a lot more time than I have.  I’ve opened a bug report with Google about this.

This error seems to be Google’s version of “We’re not sure what happened, and hope that if the customer tries again it might go away”.

Google Sheets API access with PHP

api-test

Note on 8 February 2017: Google has released the Sheets API v4 and is now providing PHP sample code and improved PHP support for Sheets in the PHP API client.  My series of articles is now largely obsolete.  See https://developers.google.com/sheets/api/quickstart/php

==========================

Google has been sending out messages saying that several of their APIs are going to be discontinued (for example, the Document List API).  As a result, I tried to modify my custom Google Spreadsheet-populating PHP script to use the new Drive API.  After way too much wasted time, I discovered that the Drive API can create sheets and read their metadata, but can’t add rows — for that we can keep using the Spreadsheets API.

I was successful at converting the authentication portion of my script from the old ClientLogin to OAuth with a Service Account (the script runs behind the scenes of a web site and populates a Google spreadsheet that the web site user has no knowledge of).

It wasn’t as simple as I’d hoped because the Google-provided PHP client for the Drive API doesn’t know about the Spreadsheets API.  I had to dig around the PHP libraries to piece together authentication codes and Google_Http_Requests.  Then Google changed the PHP client to use Guzzle, so I recently made that change.

So, if anyone else out there is interested in the combination of PHP, the Spreadsheets API, and OAuth with Service Accounts, this could save you some time.

The code is available in a public Gist at https://gist.github.com/karlkranich/de225928665dc6b83667

Here are the step-by-step instructions to get this to work:

Continue reading

Solved: “ORA-28001: the password has expired” on Windows 8.1

odbc-errorWhile working with the development version of a document library that uses Oracle for storage on a Windows 8.1 laptop, we ran into the error “ODBC error: [Oracle][ODBC][Ora]ORA-28001: the password has expired”.

It turns out that up until Oracle 10, the default password policy was no password expiration.  Starting with Oracle 11, there is a default password lifetime of 180 days.

Here are the steps we took to fix it:

1. Get DBA privileges

Assuming you’re logged into Windows as “joe”, check if you’re in the “ora_dba” group by running cmd.exe and issuing the command “net user joe”.  You’ll see a list of local groups that you belong to near the end of the output.  If you don’t know who you’re logged in as, try “whoami”.

If you’re not in the ora_dba group, you can add yourself with the Local Users and Groups tool in Computer Management.  Except that tool is gone in Windows 8.1.  Very frustrating!  In that case, issue the command “net localgroup ora_dba joe /add”.

2. Set the password lifetime to unlimited

Now you can change the password lifetime with this series of commands:

sqlplus /nolog
connect / as sysdba
ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;

3. Change Oracle user passwords

You may or may not need to change the password of Oracle users on your system.

From the sqlplus prompt, use the following command (use double quotes around the new password and replace the username “system” as needed):

ALTER USER system IDENTIFIED BY “new_password”;

Hope this helps some people!

How to Insert and Delete Cells from Google Spreadsheets

[update on 9/24/2014:  This has now been published as a Google Add-on.  Please see this page.  To install the Add-on, just search for “insert cells” when browsing for Add-ons from Google Sheets]

I haven’t been able to find a way in Google Spreadsheets to insert a cell (or cells) in the middle of a spreadsheet and tell the existing content to shift down or to the right.  Similarly, I’d like to be able to select cells to delete, and have them fill in by content shifting up or from the right.

So, I created a Google Apps script to add “Insert Cells” and “Delete Cells” menus to Google Spreadsheets.  Right now, you need to copy the code from github and paste it into the Script Editor in Google Spreadsheets (see the Tools menu).  Hopefully I’ll get the code cleaned up enough to have Google approve it as an Add-on soon!

Watch the video for a demonstration.

[youtube]https://www.youtube.com/watch?v=g5oTm3BeTCk[/youtube]