sudo apt update
sudo apt install nfs-kernel-server nfs-common
sudo mkdir /data/nfs-mount
sudo chown username:groupname /data/nfs-mount
sudo chmod 755 /data/nfs-mount
sudo vim /etc/exports
# Add below line in /etc/exports
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
class ResumableRandomSampler(torch.utils.data.Sampler): | |
r"""Samples elements randomly. If without replacement, then sample from a shuffled dataset. | |
If with replacement, then user can specify :attr:`num_samples` to draw. | |
Arguments: | |
data_source (Dataset): dataset to sample from | |
replacement (bool): samples are drawn on-demand with replacement if ``True``, default=``False`` | |
num_samples (int): number of samples to draw, default=`len(dataset)`. This argument | |
is supposed to be specified only when `replacement` is ``True``. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: ConfigMap | |
metadata: | |
name: pihole-config | |
data: | |
WEBPASSWORD: pihole | |
TZ: 'Asia/Ho_Chi_Minh' | |
DNS1: 1.1.1.1 | |
DNS2: 1.0.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
the | |
of | |
and | |
to | |
a | |
in | |
for | |
is | |
on | |
that |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!python3 | |
''' | |
This is a demo of how you can use the CoreML framework (via objc_util) to classify images in Pythonista. It downloads the trained 'MobileNet' CoreML model from the Internet, and uses it to classify images that are either taken with the camera, or picked from the photo library. | |
''' | |
import requests | |
import os | |
import io | |
import photos | |
import dialogs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
from collections import Counter | |
import csv | |
import os | |
import torch | |
from torch.autograd import Variable | |
import torch.nn as nn | |
import torch.optim as optim | |
import torch.utils.data as data | |
import tarfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
# Barcode scanner demo for Pythonista | |
# Based on http://www.infragistics.com/community/blogs/torrey-betts/archive/2013/10/10/scanning-barcodes-with-ios-7-objective-c.aspx | |
from objc_util import * | |
from ctypes import c_void_p | |
import ui | |
import sound | |
found_codes = set() |