Microsoft Azure Windows Server Open Port

Categories: Development Notes December 5th, 2015 11:20

Requirement:  open a given port so that it can be accessed from internet. 

Solution: 

1. login to the windows server:
Windows file wall setting:  Windows Firewall with advanced setting > Inbound Rules > Add new rule

2. Enable the port mapping/forwarding:
Azure dashboard: Setting > Endpoints > Add Endport

 

Getting all videos by user name using youtube data API V3

Categories: Development Notes; Tagged with: ; @ November 12th, 2015 22:32

I managed to retrieve all videos by user name using v2:

https://gdata.youtube.com/feeds/api/users/GoogleDevelopers/uploads?alt=json&start-index=1&max-results=50&v=2

I haven’t find an API to get all videos directly, however it can be done by two steps (thanks to http://stackoverflow.com/questions/22613903/youtube-api-v3-get-list-of-users-videos) :

Step 1: get the user’s relatedPlaylist (uploads) id by:

GET https://www.googleapis.com/youtube/v3/channels?part=contentDetails&forUsername=GoogleDevelopers&key={YOUR_API_KEY}

Step 2: get all videos by the id retrieved in step 1:

GET https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&playlistId=UU_x5XG1OV2P6uZZ5FSM9Ttw&key={YOUR_API_KEY}

One line to share the current folder via HTTP

Categories: Python; Tagged with: ; @ November 7th, 2015 18:23
>python -m SimpleHTTPServer $PORT

Connecting to Azure Windows virtual machine from Mac

Categories: Development Notes; Tagged with: ; @ October 31st, 2015 17:00

Issue

“Cannot verify the identity of the computer that you want to connect to” when I trying to remote login to my Azure virtual machine using ‘Microsoft Remote Desktop Connection Client for Mac 2.1.1’

Solution
You may try another client –  Microsoft Remote Desktop’ from iTunes 

 

Dropbox Python SDK 2.2.0 bug: commit_chunked_upload ?

Categories: Development NotesPython; Tagged with: ; @ August 2nd, 2015 23:04

Issue:  dropbox keep ignoring the first folder when committing a chunked upload:

After chunked uploading completed, commit the file by:

response = self.dropbox_client.commit_chunked_upload('/backup/docs.zip', upload_id, False)
remote_path = response['path']

My understanding was remote_path in the response should be same as the full_path I passed: ‘/backup/docs.zip’, however, the remote_path is: ‘docs.zip’. form client.py /commit_chunked_upload:

The full path to which the chunks are uploaded, *including the file name*.
If the destination folder does not yet exist, it will be created.

full path with filename, and it’ll be used by:

url, params, headers = self.request("/commit_chunked_upload/%s" % full_path,
                                    params, content_server=True)

a http request to : /commit_chunked_upload//backup/docs.zip will be sent. however, the actual server url is:

https://api-content.dropbox.com/1/commit_chunked_upload/auto/<path>

https://www.dropbox.com/developers/core/docs#commit-chunked-upload

Solution / workaround

1. fix the SDK :
Following CheckedUpload class,  the commit url can be generated by:

path = “/commit_chunked_upload/%s%s” % (self.client.session.root, format_path(path))

2. add ‘auto’ in the front of the remote path:

response = self.dropbox_client.commit_chunked_upload('auto/' + remote_path, upload_id, False)

Newer Posts <-> Older Posts



// Proudly powered by Apache, PHP, MySQL, WordPress, Bootstrap, etc,.