T-Mobile Prepaid Options

Refer: https://support.t-mobile.com/docs/DOC-7261

How to add for a Pay As You Go (Prepaid) plan

To purchase a pass on your Pay As You Go plan, call T-Mobile customer service by dialing 611 from your T-Mobile phone, or call 1-877-746-0909. You can get a 1-day pass or a 1-week (7-day) pass. Automated account help and customer service representatives are available 24 hours a day, 7 days a week. For the hearing impaired, TTY service is available by calling 1-877-296-1018, 7 days a week, from 3 a.m.-10 p.m. PT.

 

Parallels Resize Issue

Refer: https://askubuntu.com/questions/1073568/preventing-window-resizing-after-resume

There's an issue when resuming from suspend, the screen warps and it needs resized.  This fix does not work completely but it downsizes the window, so you just need to double-click to get it working again.  This is NOT a perfect solution for Parallels and it is wonky when suspending in full screen too.

If this returns a value of uint32 0, then it means you have automatic scaling turned on. I found that setting this to a specific value (in my case 1) fixed the issue, which you can do using the following:

gsettings get org.gnome.desktop.interface scaling-factor
gsettings set org.gnome.desktop.interface scaling-factor 1

API Mock Testing

Simple tool to verify you can send various requests
Refer: https://httpbin.org

Simple Debug Post Tools

  • https://webhook.site/#!/
  • https://pipedream.com

Mocking Tools

  • https://getsandbox.com
    • https://github.com/getsandbox/sandbox
  • https://www.mockable.io
  • http://jsonstub.com

You can run it locally:
$ docker run -p 80:80 kennethreitz/httpbin

Announcing Httpbin.org

June 12, 2011
The development of Requests, the Python HTTP Module for Humans, led to some annoying testing practices. Relying on random websites and services in order to test different capabilities of the HTTP client became annoying quickly. PostBin.org was perfect for testing POST request behavior, but is usless for other situations. I was hoping to extend its functionality to other request types, but it turns out that PostBin runs on the Google App Engine platform. No.

Thus, httpbin.org was born.

Example Endpoints

To get a feel for what HttpBin does, here are a few endpoint examples:

$ curl http://httpbin.org/ip :

{"origin": "::ffff:24.127.96.129"}
$ curl http://httpbin.org/user-agent :

{"user-agent": "curl/7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7 OpenSSL/0.9.8l zlib/1.2.3"}

Lubuntu Synapse – Program Search

Refer:  http://lubuntuhowto.blogspot.com/2017/03/using-synapse-on-lubuntu.html

sudo apt-get install synapse

After you install it, you have to launch it for your current session, and then it will be active when you hit [Ctrl] + [Space]

It's found in Start, Accessories, Synapse

 

Xfce Xubuntu Interface

A lightweight interface for Ubuntu

Refer: https://www.lifewire.com/ubuntu-15-04-vs-xubuntu-15-04-2201174

$ sudo apt-get update
$ sudo apt-get install xfce4

Logout Change settings by gear next to logon, you might need to reboot, if you are using auto logon.

User Admin GUI is missing on XFCE, use the following to add it:
$ sudo apt install gnome-system-tools

Launch it like this:
users-admin

Debug NodeJS Application

Refer: https://dev.to/john_papa/debug-your-nodejs-app-in-60-seconds-5cni

Visual Studio Code (aka VS Code) has changed the game on Node.js debugging. There is a feature called Node: Auto Attach (you can learn more about it here in the docs). Or keep reading — this will only take a minute.

When you enable this feature, you can run your node app from a command line, from an npm script, or from a tool that runs one of those. Just make sure you add the Node Inspector flag to let Node know you are planning on debugging. Once you do this, the debugger lights up in VS Code!

Auto-Attach the Debugger to Node.js Apps with VS Code

Step by Step

Open the settings in VS Code (CMD + , on Mac or CTRL + , on Windows). You can also go to the Command Palette (CMD + SHIFT + P on Mac or CTRL + SHIFT + P on Windows) and search for settings.

Search for “auto attach” and you’ll see a setting for Node: Auto Attach. Go ahead and turn that on.

Now run your Node.js app from your favorite command line whether that be integrated terminal, external terminal.

node --inspect=0.0.0.0:9229 server.js

Now when you launch your app with the --inspect flag the debugger attaches to your app in VS Code! From here you can set breakpoints, step through your code, and have all the great debugging goodness!

Python Pathlib Module

Refer: https://stackabuse.com/introduction-to-the-python-pathlib-module/

How to use the Pathlib Module?

To use the pathlib module conveniently within our scripts, we import all the classes in it using:

from pathlib import *
As a first task, let's retrieve the current working directory and home directory objects, respectively, using the code below:

current_dir = Path.cwd()
home_dir = Path.home()
print(current_dir)
print(home_dir)
We can choose to import pathlib instead of importing all the classes. In that case, all the subsequent uses of classes within the module should be prefixed with pathlib.

import pathlib

current_dir = pathlib.Path.cwd()
home_dir = pathlib.Path.home()
print(current_dir)
print(home_dir)
Why use the Pathlib Module?
If you've been working with the Python language for a while, you would be wondering what is the necessity of Pathlib module when os, os.path, glob, etc. modules are already available? This is a fully justified concern. Let's try to address this via an example.

Let's say we want to make a file called "output/output.xlsx" within the current working directory. The following code tries to achieve this using the os.path module. For this, os.getcwd and os.path.join functions are used.

import os
outpath = os.path.join(os.getcwd(), 'output')
outpath_file = os.path.join(outpath, 'out.xlsx')
Alternately,

outpath_file = os.pathjoin(os.path.join(os.getcwd(), 'output'), "out.xlsx")
Though the code works, it looks clunky and is not readable nor easy to maintain. Imagine how this code would look if we wanted to create a new file inside multiple nested directories.

The same code can be re-written using Pathlib module, as follows:

from pathlib import Path
outpath = Path.cwd() / 'output' / 'output.xlsx'
This format is easier to parse mentally. In Pathlib, the Path.cwd() function is used to get the current working directory and / operator is used in place of os.path.join to combine parts of the path into a compound path object. The function nesting pattern in the os.path module is replaced by the Path class of Pathlib module that represents the path by chaining methods and attributes. The clever overloading of the / operator makes the code readable and easy to maintain.

Another benefit of the method provided by the Pathlib module is that a Path object is created rather than creating a string representation of the path. This object has several handy methods that make life easier than working with raw strings that represent paths.

Performing Operations on Paths
The classic os.path module is used only for manipulating path strings. To do something with the path, for example, creating a directory, we need the os module. The os module provides a set of functions for working with files and directories, like: mkdir for creating a directory, rename to rename a directory, getsize to get the size of a directory and so on.

Let's write some of these operations using the os module and then rewrite the same code using the Pathlib module.

Sample code written using os module:

if os.path.isdir(path):
os.rmdir(path)
If we use Pathlib module's path objects to achieve the same functionality, the resulting code will be much more readable and easier to maintain as shown below:

if path.is_dir()
path.rmdir()
It is cumbersome to find path related utilies in the os module. The Pathlib module solves the problem by replacing the utilities of os module with methods on path objects. Let us understand it even better with a code:

Debug NodeJS

Refer: https://dev.to/john_papa/debug-your-nodejs-app-in-60-seconds-5cni

Visual Studio Code (aka VS Code) has changed the game on Node.js debugging. There is a feature called Node: Auto Attach (you can learn more about it here in the docs). Or keep reading — this will only take a minute.

When you enable this feature, you can run your node app from a command line, from an npm script, or from a tool that runs one of those. Just make sure you add the Node Inspector flag to let Node know you are planning on debugging. Once you do this, the debugger lights up in VS Code!

Auto-Attach the Debugger to Node.js Apps with VS Code

Step by Step

Open the settings in VS Code (CMD + , on Mac or CTRL + , on Windows). You can also go to the Command Palette (CMD + SHIFT + P on Mac or CTRL + SHIFT + P on Windows) and search for settings.

Search for “auto attach” and you’ll see a setting for Node: Auto Attach. Go ahead and turn that on.

Now run your Node.js app from your favorite command line whether that be integrated terminal, external terminal.

node --inspect=0.0.0.0:9229 server.js

Now when you launch your app with the --inspect flag the debugger attaches to your app in VS Code! From here you can set breakpoints, step through your code, and have all the great debugging goodness!