Categories
Uncategorized

How I solved throttling issues on my Dell G5 5587

As an upgrade at work, I’ve bought a new laptop in the autumn of 2018, a Dell G5 5587 with the following specifications: Intel Core i7–8750H, 16 GB DDR4–2666 RAM, 512 GB NVMe SSD, 1 TB SATA3 SSD. NVIDIA GeForce GTX1060 Max-Q Design 6GB and 4K HDR screen.

As soon as I received it, I’ve noticed that it had horrible throttling issues — CPU would throttle to 0.8 GHz, or GPU would throttle to 0.1 GHz, or both.

I’ve investigated a lot of possibilitiesduring these two years — I’ve changed the motherboard (well actually it was changed under the warranty), I’ve reapplied the thermal paste 3 or 4 times (I usually use Arctic MX-4, more on this below), reinstalled the drivers, updated BIOS several times to the latest version. I used ThrottleStop, Intel XTU, underclocked Turbo clocked, disabled TurboBoost, undervolted cores and cache. Nothing helped. I was blaming this to the poor cooling solution or power limit design, which after boosting, dropped TDP to 15 W from stock 45 W.

At some point, I stumbled upon an article that suggested using GPU overclocking software to increase a thermal limit on GPU, which I gave a try. I increased thermal limit from 78 C to 88 C, and lo and behold — GPU throttling stopped. But CPU still throttled.

I went on Google, and decided to search for alternative thermal paste, as I was under impression that Arctic MX-4 may not be enough. My research led me to Thermal Grizzly Kryonaut, which claimed to have roughly 20% more thermal conductivity than Arctic MX-4.

So, I went ahead and ordered it, along with a bottle of compressed air. As soon as the package arrived, I changed the thermal paste and used compressed air to clean out the radiators behind the fans. There was a lot of dust there…

In the end, I started up my system, ran couple of games for couple of hours. The GPU never went above 70 C, which I thought was amazing.

I just wanted to share this here as I ‘ve stumbled upon a lot of forum / Reddit discussions on the Internet about this topic, and not only for G5 models, but XPS and Inspiron as well.

Categories
Uncategorized

Online expense tracker — Part 1 — Setting up access to Gmail

I’ve decided to write a python program that parses my emails from Gmail and finds the emails that contain information about my online spending — online shopping as well as monthly subscriptions.

So this is a series of posts describing how to do it. The content will be updated as I add new posts.

Contents

Part 1

This part is relatively simple, all you need to do is follow this tutorial here https://developers.google.com/gmail/api/quickstart/python
I will outline most important points

Prerequisites

  • Python 2.6 or greater
  • The pip package management tool
  • A Google account with Gmail enabled
    I do recommend using Python 3 and pip3 to get the best and latest

Step 1: Turn on the Gmail API

Click this button to create a new Cloud Platform project and automatically enable the Gmail API
In resulting dialog click DOWNLOAD CLIENT CONFIGURATION and save the file credentials.json to your working directory.

Step 2: Install the Google Client Library

Run the following command to install the library using pip:

pip install --upgrade google-api-python-client google-auth-httplib2 google-auth-oauthlib

or you can run pip3 instead of pip if you’re using python3

Step 3: Set up the sample

Create a new file with any name in your working directory and copy in the following code:

from __future__ import print_function
import pickle
import os.path
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request# If modifying these scopes, delete the file token.pickle.
SCOPES = ['https://www.googleapis.com/auth/gmail.readonly']def main():
"""Shows basic usage of the Gmail API.
Lists the user's Gmail labels.
"""
creds = None
# The file token.pickle stores the user's access and refresh tokens, and is
# created automatically when the authorization flow completes for the first
# time.
if os.path.exists('token.pickle'):
with open('token.pickle', 'rb') as token:
creds = pickle.load(token)
# If there are no (valid) credentials available, let the user log in.
if not creds or not creds.valid:
if creds and creds.expired and creds.refresh_token:
creds.refresh(Request())
else:
flow = InstalledAppFlow.from_client_secrets_file(
'credentials.json', SCOPES)
creds = flow.run_local_server(port=0)
# Save the credentials for the next run
with open('token.pickle', 'wb') as token:
pickle.dump(creds, token) service = build('gmail', 'v1', credentials=creds) # Call the Gmail API to list labels
results = service.users().labels().list(userId='me').execute()
labels = results.get('labels', []) if not labels:
print('No labels found.')
else:
print('Labels:')
for label in labels:
print(label['name']) # Call the Gmail API to fetch INBOX
results = service.users().messages().list(userId='me', labelIds=['INBOX']).execute()
messages = results.get('messages', [])
for message in messages:
msg = service.users().messages().get(userId='me', id=message['id']).execute()
print(msg['snippet'])
if __name__ == '__main__':
main()

Be aware that by default messages().list returns only the first page (within UI) of your emails. In my case, Gmail is set to show 100 emails per page, so it returns 100 latest emails. If you want to display more, just add maxResults=number after labelIds.

Sources