This file contains hidden or 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
- name: Check multimedia keyring | |
command: dpkg-query -W deb-multimedia-keyring | |
register: multimedia_keyring | |
changed_when: multimedia_keyring.rc == 1 | |
failed_when: multimedia_keyring.rc > 1 | |
check_mode: no | |
- name: Retrieve deb-multimedia-keyring | |
get_url: | |
url: http://www.deb-multimedia.org/pool/main/d/deb-multimedia-keyring/deb-multimedia-keyring_2016.8.1_all.deb |
This file contains hidden or 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
#!/bin/sh | |
# Example attachment decoder script. The attachment comes from stdin, and | |
# the script is expected to output UTF-8 data to stdout. (If the output isn't | |
# UTF-8, everything except valid UTF-8 sequences are dropped from it.) | |
# The attachment decoding is enabled by setting: | |
# | |
# plugin { | |
# fts_decoder = decode2text |
This file contains hidden or 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
dn: cn=mydovecotperson,cn=schema,cn=config | |
objectClass: olcSchemaConfig | |
cn: mydovecotperson | |
olcAttributeTypes: ( 1.3.6.1.4.1.7165.1.1.5.1 NAME 'mailPassword' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE ) | |
olcAttributeTypes: ( 1.3.6.1.4.1.7165.1.1.5.2 NAME 'mailForward' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 ) | |
olcObjectClasses: ( 1.3.6.1.4.1.7165.1.1.6.1 NAME 'myDovecotPerson' SUP top AUXILIARY MAY ( mailPassword $ mailForward ) ) |
This file contains hidden or 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
acl all src 0.0.0.0/0.0.0.0 | |
acl localhost src 127.0.0.1/255.255.255.255 | |
acl examplenet src 198.51.100.0/255.255.255.0 | |
http_access allow localhost | |
http_access allow examplenet | |
http_access deny all | |
# anonymous proxy | |
visible_hostname unkown |
This file contains hidden or 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
- name: first task | |
register: current_task | |
- set_fact: | |
taskset_changed: "{{ current_task.changed }}" | |
- name: second task | |
register: current_task | |
- set_fact: |
This file contains hidden or 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
# https://github.com/containers/buildah/blob/master/install.md | |
- name: Add buildah repository key | |
apt_key: | |
url: https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/Debian_10/Release.key | |
state: present | |
- name: Enable buildah repository | |
apt_repository: | |
repo: deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/Debian_10/ / |
This file contains hidden or 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
# https://tonak-ai.hatenablog.com/entry/2019/03/26/124537 | |
import torch | |
import torch.nn as nn | |
from torch import optim | |
import torch.nn.functional as F | |
from torch.autograd import Variable | |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu") | |
n_vocab = 3 |
This file contains hidden or 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 | |
import torch.nn as nn | |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu") | |
n_vocab = 3 | |
n_layers = 1 | |
n_embed = 5 | |
def padding_test(x_padding): | |
embedding = nn.Embedding(n_vocab, n_embed, padding_idx=x_padding) | |
inputs = [[1,1,2,1,1,2,1],[1,1,2]] |
This file contains hidden or 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
def skipfalse(iterable): | |
for elem in iterable: | |
if elem: | |
yield elem | |
foo=['abc', False, 'de'] | |
print(skipfalse(foo)) | |
print(list(skipfalse(foo))) | |
# filter() と lambda を使うと上記コードと同じことができる. |
This file contains hidden or 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
#!/usr/bin/python3 | |
import regex as re | |
import sys | |
import io | |
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8') | |
re_quantity = re.compile(r""" | |
((?:各|お?好みで|あれば|約|軽く)? |