tmux new -s mysessionname- While pressing
Ctrl, hitband release both. - Hit
d.
| Assume IIS is installed. My machine already had IIs 8.5. | |
| Install Python | |
| ============== | |
| 1. Download web installer (Python 3.6.3). | |
| 2. Run as Administrator. | |
| 3. Select custom installation for all users. | |
| 4. Choose install directory such that there are no white spaces in the path. Not sure if it needs to be done. Just being cautious. | |
| 5. Check the box for "Add Python 3.6 to PATH". |
| import subprocess | |
| import re | |
| def parse_free_memory(output): | |
| """ | |
| $ nvidia-smi -q -d MEMORY -i 1 | |
| ==============NVSMI LOG============== | |
| Timestamp : Wed Jan 31 14:13:22 2018 |
| # 1. | |
| # Flip the label values. Change 0's to 1's and viceversa. | |
| # PowerLayer computes outputs y = (shift + scale * x) ^ power | |
| layer { | |
| name: "flip_label" | |
| type: "Power" | |
| bottom: "label" | |
| top: "flip_label" | |
| power_param { | |
| power: 1 |
| 1. When drawing links from source to target, make sure that the link simply touches the target. | |
| This will make the arrow-head at the end of the link visible. | |
| .attr("x1", function(d) { return d.source.x_ * width + nodeW / 2 ; }) | |
| .attr("y1", function(d) { return d.source.y_ * height + nodeH / 2 ; }) | |
| .attr("x2", function(d) { return d.target.x_ * width + nodeW / 2 + nodeW / 2 * Math.sign(d.source.x_ - d.target.x_); }) | |
| .attr("y2", function(d) { return d.target.y_ * height + nodeH / 2 + nodeH / 2 * Math.sign(d.source.y_ - d.target.y_); }) | |
| 2. If you want to insert text in a rectangle, the text and the rect elements should be siblings. https://stackoverflow.com/a/5450269 | |
| To keep the text within the rect, specify the following attributes: |
| import cv2 | |
| import numpy as np | |
| from sklearn.decomposition import IncrementalPCA | |
| from sklearn.cluster import KMeans | |
| import glob | |
| import re | |
| from collections import defaultdict | |
| import sys | |
| 1. Create a MySQL dump with `mysqldump.exe`:: | |
| mysqldump.exe --single-transaction -u user -p password -h localhost db_name > db_name_dump.sql | |
| 2. Transfer `db_name_dump.sql` to your Linux machine | |
| 3. Assume you are now in a Linux machine. `db_name_dump.sql` may not be encoded in utf-8. | |
| $ # Find out what encoding the file has from the terminal. | |
| $ file -i db_name_dump.sql |
| import re | |
| # Assume a system where /proc/cpuinfo exists. We will just parse this file with re module. | |
| cpu_info = open("/proc/cpuinfo").read() | |
| # Pattern of the line in "/proc/cpuinfo" which has the needed count: | |
| # cpu cores : 12 | |
| patc = re.compile(r"cpu cores\s:\s(\d+)") | |
| # Search and extract. |
| import boto3 | |
| # Build your list of bucket names. | |
| s3_list = ["abc", "xyz", "my-dev-bucket"] | |
| s3 = boto3.client('s3') | |
| for i, bkt in enumerate(s3_list): | |
| # Try reading first. | |
| try: |