top of page

I was working on a project where I needed to download a file from a remote SFTP server, and upload it to Databricks. There are multiple ways to achieve this such as netmiko, pysftp, and paramiko scp. Python has several libraries for interacting with SFTP servers, but the solution that I ended up using is a python script with paramiko client.


What is SFTP?

SFTP (SSH File Transfer Protocol) is a secure file transfer protocol that operates over the SSH (Secure Shell) protocol. It enables users to access, transfer, and manage files securely over a network, and can be accessed via free tools such as Cyberduck, FileZilla, and WinSCP. While newer protocols like HTTP/3 and WebDAV have come out, SFTP continues to be a relevant tool for secure file transfers.


What is paramiko?

According to paramiko.org documentation, paramiko is a python implementation of SSHv2. It provides both client and server-side functionality. To connect to the remover server and transfer the file or perform any operations, we need to create a paramiko client as shown below.

SSH_Client= Paramiko.SSHClient()

Connecting to the Remote Server

Once we have created a paramiko client, we can then use the username and password for authentication to connect to the server.

ssh_client = paramiko.SSHClient()
ssh_client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh_client.connect(hostname=host,port=port,username=username,password=password)

The best practice is to store your login credentials in an encrypted format, such as in Azure Key Vault, rather than hardcoding them. This not only enhances security, but also eliminates the need to update credentials across multiple code files whenever the username or password changes.


Transferring Files

To transfer files, we need to first create an SFTP session between the client and the server, using the SSHClient that we have created earlier.

ftp = ssh_client.open_sftp()

Then, do the API call to import the file from SFTP to DBFS or another local system.

dbfs_file_path = "/dbfs/xxxyyy.csv" # update
ftp_file_path = "/Import/xxxyyy.csv" # update
files = ftp.get(ftp_csv_path, dbfs_file_path)

If you need to import a file from local system to SFTP, use the function ftp.put

files = ftp.put(dbfs_file_path, ftp_csv_path)

Once the file transfer is done, close the session by calling close() function.

ftp.close()
ssh_client.close()

For more on SSH sessions with paramiko, check out this tutorial video by DevOps Journey, which also covers additional settings such as look_for_keys and AutoAddPolicy.


It’s been over 3 years since I even updated my last post about Google Ads, How to Audit a Google Search Ads Account. Google Ads has seen significant changes over the past few years, such as privacy-focused updates, additional options for ad customization, demand gen and performance max campaigns. In this post, I will deep-dive into the state of performance max campaigns on Google Ads in 2025.


What are Performance Max (PMax) Campaigns?

Performance Max, or “PMax” campaigns take the historical conversion data in your Google Ads account, then uses smart bidding to optimize ad performance. Google's algorithm shows your ads to similar audiences across all of Google’s advertising networks (YouTube, Display, Search, Discover, Gmail, etc.) to get you new conversions. 


PMax can be highly effective if you have enough historical conversion data, but if your Google Ads account is brand new, don’t go for PMax in the beginning. With PMax, you only have the option for smart bidding, so you’ll have to pick either maximize conversions or maximize conversion value right away. On top of that, you can specify the target ROAS or target CPA.


Performance Max Settings

Once your account is ready to add PMax on top of your existing campaigns such as Search or Shopping, make sure to have these two settings in place: exclude your own brand, and target new customers only. Otherwise, the PMax campaign will just target branded traffic and high intent search traffic, which would have converted anyway through your existing campaigns.


Another final warning about PMax is that you can’t target specific audiences. You can and should feed in as much audience signals as possible -- remarketing lists, customer match, competitor websites, keywords they search for, brands they're interested in, every little detail you can think of for your buyer personals. But at the end of the day, those are mere “signals”, not limitations. Google will surpass your signals and target audiences outside of your signals as its algorithm sees fit. 


Performance Max vs Demand Gen Campaigns

Demand gen campaigns, first launched in mid-2023, are intended for increasing awareness of your brand. Contrary to PMax, demand gen gives you full control over audiences and ad placement within the YouTube and Display networks. I highly recommend setting up custom audiences and exclusions for demand gen campaigns, instead of relying on Google’s optimized targeting. In 2024, Google lowered the required minimum list size for lookalike segments from 1,000 to 100, so smaller businesses can also take advantage of this feature.


Recent Updates to Performance Max

PMax didn’t provide much data or insights when it was first launched, but Google has come up with frequent updates over the past 1-2 years to improve this. Now, the insights section provides data on which assets are performing best, how your budget is pacing, which audience segments are performing well, and whether you’re losing impression share to competitors on search and shopping.


In 2025, Google has continued rolling out major updates to PMax in 2025. To kick off this year, Google announced campaign-level negative keywords rolling out to all advertisers. Most recently, on April 30, Google announced channel performance and additional reporting coming to PMax. More to come at Google Marketing Live next week, after which I heard that everybody will get access.

SEO in Mainland China is an entirely different game than SEO on Google for other markets. If you’re looking to increase organic traffic from Chinese users, it’s essential to understand the local players, users’ search behaviours, and unique ranking factors for Chinese SEO. In this post, I will share the best practices to rank pages on Baidu, the “Chinese Google”, and address additional factors that may influence a website’s ranking. 


What is Baidu?

The Great Firewall policy regulates the websites that users in China can access. Instead of Google, you’ll need to optimize your pages for local search engines such as Baidu, Sogou, and Shenma. The most popular is Baidu, with over 676 million daily active users in 2024, and 3.3 billion daily internet queries. 

Baidu homepage

Keyword Ranking Tools for Baidu SEO

Third-party tools such as 5118, Ciku5, and Chinaz are available for Chinese keyword research. These are similar to the well-loved English SEO keyword tools such as ahrefs and SEMrush. 


Similar to Google, Baidu also has built-in digital marketing tools that you can leverage for keyword research.

  • Baidu keyword planner, accessible through a Baidu PPC (Phoenix Nest manager) account, provides keywords and their search volumes, similar to Google’s keyword planner in Google Ads. 

  • Baidu Index, Baidu’s Google Trend equivalent, helps you visualize keyword relevancy and popularity over time, often providing useful insights for SEO and keyword research. 


In addition, these Baidu tools will be useful for your overall SEO strategy.

  • Baidu webmaster tools can be used to track indexing issues and site performance, similar to Google Search Console.

  • Baidu Tongji (Analytics), similar to Google Analytics, provides data on user behavior, traffic sources, and keyword effectiveness.

  • Baidu Zhidao is China’s largest Q&A forum, similar to Quora in English. As Baidu Zhidao often ranks high for search queries, it should be part of your Chinese digital marketing strategy. 


Website Localization for Baidu SEO

Chinese search engines do not favor non-Chinese websites or content that is irrelevant to the local market. When localizing an English website for the Chinese market, note that Baidu is predominantly available in simplified Chinese, which is typically used in mainland China, Singapore, and Malaysia. Traditional Chinese, used in Taiwan, Hong Kong, and Macau, is supported on Baidu, but the platform is programmed for simplified Chinese, and often converts traditional to simplified Chinese. 


Chinese Hosting Server

Baidu is first and foremost a Chinese search engine, so it makes sense that its algorithm massively favours Chinese localization – whether it’s server location, top-level domain (.cn), business address, content language, or citations. Hosting your website locally will help Baidu index your content faster. Also, getting a domain name from a Chinese registar will increase the credibility of your pages, as seen by Baidu. 


Note that you are required to obtain an Internet Content Publishing (ICP) license before hosting your domain in China. This is a required authorization for international brands to operate a website legally in the Chinese market. Not only is it a legal requirement, but it also helps to build trust with local users.


There are some rumors that Baidu ranks sites with visible ICP licenses higher in rankings, but this has yet to be proven. Still, if you do get an ICP license, it can only be a potential benefit to display it on the footer of your site. 


---

Looking to unlock the potential of China's vast online market? As a freelancer supporting many global brands, I can help you to find the best keywords to increase organic traffic and reach your target audience on Baidu. Feel free to contact me for Chinese SEO services.

bottom of page