Sharing Windows folders on the local network without username and password

I needed to access my files from my Windows PC on my iPhone on my local home network. I was using an app which searches for SMB/CIFS shares. I wanted seamless read access without the need to enter any username & password.

Surprisingly, it takes quite a convoluted setup to achieve such a simple task.

A. Disable Password Protected Sharing:

  1. In Windows 10 search bar, type “Network and Sharing Center”.
  2. Click on “All Networks” dropdown
  3. Look for the option “Password protected sharing”.
  4. Tick the option “Turn off password protected sharing” and click on “Save changes”

B. Setting Individual Folder Permissions:

Right click on a folder and goto:

  1. Properties > Sharing > Share
    Make sure the user “Everyone” is added in the list, if not add it.
  2. Properties > Sharing > Advanced Sharing
    Enable the “Share this folder” option.

Click on “Permissions”.
Make sure the user “Everyone” is added in the list, if not add it.
Click “Allow” for the user to have read permissions.
Click “Ok” and save all settings.

The folder should now be accessible over network share without the need to enter
any username or password.

Repeat step B for all required folders to be shared.

To view currently shared folders:

In Windows command prompt or Powershell,
type “net share”

It’ll display a list with names of the currently shared folders
along with their system paths.

Why is Gaming on Windows still stuck with the problems on the 90s?

I tried playing CoD BO 3 today on Windows 10 with my bluetooth headset. I get sound at game startup, till it says “connecting to online service”. After that, the sound gets cut-off (I could hear some ambient noise as if the mic has been turned on).

After a lot of head scratching and trying to find solutions online, I found one that works:

Right-click on the speaker icon in the tray and goto “Sound Settings > Manage Sound Devices”.

Here, you should see the bluetooth device connected in stereo mode. If you see another device like “Hands-free AG audio”, you have to disable that.

Once that’s done, restart the game and the sound should work with bluetooth headphones!

But seriously, we shouldn’t have to do these things in 2020! Whose fault is it – Microsoft’s? Activision’s? Treyarch’s? As a consumer, I shouldn’t have to deal with these things.

What Google Maps should do in India

To improve usability:

  1. Classify roads – size, safety, infrastructure. avoid bad roads even if it saves time or is unsafe. Why take me through a small “galli” just to save a few minutes when I could take a better main road even though it may be a few minutes longer?
  2. Dropoff at a stop close-by, and switch to walk – will save a lot of time in areas like ORR in Bangalore.
  3. Not fully rely on traffic data all the time – major junctions and roads should be permanently marked as congested esp. at peak hours, based on annual data. In my experience, the live traffic data is wrong on many important congested junctions.

Current state of HTTPS on ESP8266

This is the output from howsmyssl:

{
	"given_cipher_suites": [
		"TLS_RSA_WITH_AES_128_CBC_SHA",
		"TLS_RSA_WITH_AES_256_CBC_SHA"
	],
	"ephemeral_keys_supported": false,
	"session_ticket_supported": false,
	"tls_compression_supported": false,
	"unknown_cipher_suite_supported": false,
	"beast_vuln": false,
	"able_to_detect_n_minus_one_splitting": false,
	"insecure_cipher_suites": {},
	"tls_version": "TLS 1.1",
	"rating": "Improvable"
}

Only upto TLS 1.1 😦
This was tested using ESP-01. I’ll be performing tests with ESP32 next month, once I get around to drag-soldering it 🙂
Continue reading

Microsoft – get your error checking act together

So the world is in a disarray, thanks to you Microsoft and your never ending buffer overflow vulnerabilities. Makes you wonder why you cannot write good tools to test for this internally, with 100% coverage. Surely it can’t be an impossible task.

Nevertheless, why do you insist on having cryptic error messages, for things that are not even an error in Windows or MS Office? Let’s take the example of Powerpoint.

For the past few weeks, I’ve been getting this error everytime I open some .pptx file. “Powerpoint found a problem with the content blah blah. Click to repair…”.

ppt-perms1

Now it doesn’t repair when I tell it to (because turns out there’s nothing to repair).

ppt-perms2.JPG

The problem was finally traced to incompatible security settings for downloaded files. If you have downloaded a MS Office file, it is automatically set to “unsafe” by Windows explorer, and hence blocked from being opened. You have to manually unblock it.

ppt-perms3.JPG

Well now Microsoft – you have written Windows and MS Office – can you not detect this and give the relevant message. Better yet, give the option with Powerpoint itself to unblock? Why should your customers have to jump through so many hoops for something so simple? Make no mistake – giving an incorrect error message is a “bug”, nothing less.

My 🐈 Spotty could do better debugging than you, Microsoft.

Play audio from 2 bluetooth headsets simultaneously on the Macbook Pro

Previously, I’d written about how to play audio simultaneously through a bluetooth headset and wired earphones on your Macbook Pro.

However, now we have a new problem. We just got a new 🐈 Spot, who’s the cutest cat my wife has ever seen. And he loves to pull on all kinds of threads and wires, including… earphones wire!

So I wondered, can we connect 2 bluetooth headsets to the Macbook Pro and have music play from them simultaneously (without any significant lag).

Turns out, it’s definitely possible and not hard to set up. This is what you do:

  • You need to open up the secret audio device manager within MacOS called “Audio Midi”. Use Spotlight to find it.
  • Open it up and click on the “+” sign in the bottom-left and select “Create a multi-output” device. (You need to have the latest MacOS installed. This is how it should look: Multi-output Device MacOS
  • Make sure you tick only the 2 bluetooth devices and untick and others in the list. Also tick the boxes for drift correction and make sure sampling frequency is set to 44.1kHz (or else the sound will be horrible 😦 )
  • Once this is done, right click (or double-tap) on the multi-output device option on the left and select the option “Use this device for sound output”. You should hear the audio through both the bluetooth speakers 🎉.
  • Sometimes, it doesn’t work on the first try. Just delete the multi-output device and retry. Also, the bluetooth pairing order matters, for some reason that I don’t know. For my setup, I had to pair my Bose Soundlink headset before the Mpow headset, or else the Bose would disconnect.

Enjoy!

(Cat photo credit: fastcompany)

HTTPSRedirect V2: Communicate directly with Google Services

Almost a year ago, I launched a project called HTTPSRedirect. HTTPSRedirect allows you to read/write directly into Google Sheets, get info from Google Calendar services and much more, without the need for any 3rd party service. This means no more middlemen like IFTTT, pushingbox, Temboo, etc.

Google requires all communication to it’s cloud services to use SSL over HTTP. This forces the use of HTTPS. Secondly, the Google redirects your request to fetch the response data from another domain. Hence, if we need a proper channel to communicate with these services, there is a need for the HTTPS library to perform “follow-redirects”. HTTPSRedirect performs all this seamlessly. All the user needs to do is use simple GET/POST requests and HTTPSRedirect will handle all the messy stuff in the background.

In the example posted on the Github link above, I demonstrate how we can use ESP8266 to read and write into a cell of Google Sheets. Then we fetch Google calendar data and then keep writing device information into Google Sheets.

With HTTSPRedirect V2, most of the library code base has been re-written. You can check out the detailed Readme on github. But to cut a long story short:

V2 has been made fully generic – you can communicate with Google or any other cloud service. The code base has been rewritten to include a complete HTTP client which correctly parses data send and received from the remote server.

It can now perform GET and POST requests following HTTP/1.1 spec accurately. Both bulk and chunked encoding supported.

I’ve tried to keep the API easy to understand. I’ll also be writing a new library for more support functions to communicate easily with Google Sheets API. Coming soon… 🙂

Please send me your feedback. Happy Gudi Padwa to all!

Linux Bash type and aliases

Something I learnt today about aliases in Linux Bash shell. I use plenty of aliases in bash. Sometimes I forget what a particular alias stands for. Apparently the which command doesn’t work for this purpose. As explained here: bash-aliases, you can certainly do alias <alias-name> to check what it does. However, this doesn’t work for any custom functions we define in bash. The command type works in all cases and is the best utility to use for this purpose.

type <alias/function> will list out the exact command in all cases.

 

Handy Linux tricks with find

I often find the need to delete files of a particular size. Instead of viewing files in a graphical interface, arranging by size and then picking the ones to delete, there is an easier way. This is taken from the following SE posts:

http://unix.stackexchange.com/questions/37627/delete-files-of-certain-size-range

As mentioned there, the + or - prefixes are neither documented in the man pages nor within info. So in order to find files greater than 10MB but less than 100MB, use this:

find  .  -size +10M -size -100M  -exec rm -f  -- {} \;

The syntax of why the backslash and semi-colon is required is described here: semi-colon within find. The double-dash (--) tells the getopt interpreter that rm uses to ignore anymore options, and so allow deletion of filenames that begin with a dash(-). (Why would anyone have filenames like those👺: rm with special characters)

Alternatively, you could use xargs for the deletion.

find  .  -print0  -size +10M -size -100M  |  xargs  -0 rm -f  --

The arguments “-print0” and “-0” are required to interpret files with spaces in the names correctly. (find and xargs).

If you want to list all files based on their modification times, use this:

find  .  -type f  -mtime 0

will show all files in your current directory modified (or created) within the past 24 hours. If you’d like find to count from the beginning of today (rather than 24 hours ago), use the option “-daystart” before any time options.

The same + or - prefixes can be used here to limit the search to strictly greater/less than conditions.

ps: David Wheeler has written an excellent article on the ridiculous use of certain characters in POSIX filenames: No Sharp Corners