Posts

Showing posts from February, 2020

How to Grant User Privileges in Google Cloud MySQL

Image
When you create a new user account in your Google Cloud MySQL database, it has the same privileges as a root user. It is, therefore, a good idea to limit the admin privileges of the new MySQL user with the REVOKE command and explicitly grant the required user privileges with the GRANT statement. You can use MySQL Workbench or Sequel Pro to connect to your Cloud SQL database with the root user. Make sure that your database has a public IP and your computer’s IP address is added as an authorized network in the Connections tab of your Database console. SHOW GRANTS FOR db_user If your MySQL user has root privileges, the statement will output the following: GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, REFERENCES, INDEX, ALTER, SHOW DATABASES, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE ON *.* TO 'db_us...

 Awesome Mac Apps and Utilities - 2020 Edition

Image
Whether you are a new Mac user or a seasoned veteran looking to do even more amazing things on your Mac, check out this updated collection of lesser-known but awesome Mac Apps of 2020. The majority of apps listed here are free and they’ll appeal to general Mac users, not just the techie crowd. The Best  Mac Apps & Utilities This collection of essential Mac Apps includes mostly lesser-known apps so the popular ones — like Evernote, Dropbox, Skype, OneNote, or Google Drive — aren’t listed here. Also, all the apps here are compatible with Yosemite and Catalina, the current version of Mac OS. Wherever possible, I have included the Mac App Store links because the store not only makes it easy for you to install apps on your Mac but, in the case of paid apps, you also have an option for requesting refunds . Let’s get started. Magnet - A perfect windows management app for Mac that lets you move and resize windows with configurable keyboard shortcuts. You can move windows bet...

How to Scrape Reddit with Google Scripts

Image
Reddit offers a fairly extensive API that any developer can use to easily pull data from subreddits. You can fetch posts, user comments, image thumbnails, votes and most other attributes that are attached to a post on Reddit. The only downside with the Reddit API is that it will not provide any historical data and your requests are capped to the 1000 most recent posts published on a subreddit. So, for instance, if your project requires you to scrape all mentions of your brand ever made on Reddit, the official API will be of little help. You have tools like wget that can quickly download entire websites for offline use but they are mostly useless for scraping Reddit data since the site doesn’t use page numbers and content of pages is constantly changing. A post can be listed on the first page of a subreddit but it could be pushed to the third page the next second as other posts are voted to the top. Download Reddit Data with Google Scripts While there exist quite a Node.js and...

How to Generate a Report of Bounced Email Addresses in Gmail

Image
Some email messages you have sent through your Gmail account may not get delivered at all. There could be a problem with the recipient’s email address, like a typo, their mailbox could be full or maybe the mail server could be specifically blocking your emails due to the content of the message. When an email message sent via Gmail is bounced or rejected, you get an automated bounce-back notice from mailer-daemon@gmail.com  and it will always contain the exact reason for the delivery failure along with the SMTP error code . For instance, an error code 550 indicates that the email address doesn’t exist while a 554 indicates that your email was classified as spam by the recipient’s mail server. How to Get a List of Email Addresses that Bounced It is important to keep track of your bounced messages and remove all undelivered email addresses from your future mailings as they may affect your sending reputation. Mail Merge for Gmail  keeps t...

How to Force Reset GSuite Users' Passwords with Apps Script

You can use Google Apps Script to automatically reset the password of users in your GSuite domain. This script can only be executed under the Suite admin account. You also need to enable the AdminDirectory Advanced Service in your Apps Script Editor. You can force reset passwords of members of a particular group in your organization or specify a list of email addresses and the Google Script will use the AdminDirectory service to change the password of specified users. const getGroupMembers_ = groupEmail => { var emails = [ ] ; var pageToken ; do { const { members = [ ] , nextPageToken } = AdminDirectory . Members . list ( groupEmail , { maxResults : 200 , pageToken : pageToken } ) ; members . forEach ( member => { if ( member . status === "ACTIVE" ) { emails . push ( member . email ) ; } } ) ; pageToken = nextPageToken ; } while ( pageToken ) ; ...

How to Install Let’s Encrypt SSL Certificate with Apache on Ubuntu

This step-by-step tutorial will show you how to install Let’s Encrypt SSL certificate for an Apache server running on Ubuntu 18.04. I’ve created a droplet on DigitalOcean for this example but the steps should be similar AWS and other environments. Install Apache 2 Login to your droplet with root (or use sudo with all the following commands). Check if any Ubuntu packages are outdated. apt update Upgrade the outdated packages to the latest version. apt upgrade Install Apache2 apt install apache2 Start the Apache Server systemctl start apache2 Check if the Apache server is running systemctl status apache2 Enable the mod_rewrite package for Apache sudo a2enmod rewrite Restart Apache systemctl restart apache2 Install PHP Install PHP and restart the Apache server. apt install php libapache2-mod-php systemctl restart apache2 php —version Install the CURL package Install Curl and restart Apache server apt install curl apt install php7.2-curl systemctl res...

A Better Way to Embed PDF Documents in Web Pages

Image
How do you embed a PDF document into your website for inline viewing? One popular option is that you upload the PDF file to an online storage service, something like Google Drive or Microsoft’s OneDrive, make the file public and then copy-paste the IFRAME code provided by these services to quickly embed the document in any website. Here’s a sample PDF embed code for Google Drive that works across all browsers. < iframe frameborder = " 0 " scrolling = " no " width = " 640 " height = " 480 " src = " https://drive.google.com/file/d/<<FILE_ID>>/preview " > </ iframe > This is the most common method for embedding PDFs - it is simple, it just works but the downside is that you have no control over how the PDF files are presented in your web pages. If you prefer to offer a more customized and immersive reading experience for PDFs in your website, check out the new Adobe View SDK . This is part o...