Skip to content

Instantly share code, notes, and snippets.

@matsueushi
matsueushi / 1.create-gpg-keys.md
Created May 4, 2023 07:55 — forked from denvernine/1.create-gpg-keys.md
GPGキーを使ってGitHubにSSHで疎通確認、その後GPGキーを使った署名付きコミットをするまでのログ

GPGキーを作ってみよう

GPGキーを使ってGitHubにSSHで疎通確認、その後GPGキーを使った署名付きコミットをするまでのログです。

GPGってなに?

GnuPG is a complete and free implementation of the OpenPGP standard as defined by RFC4880 (also known as PGP). GnuPG allows you to encrypt and sign your data and communications; it features a versatile key management system, along with access modules for all kinds of public key directories. GnuPG, also known as GPG, is a command line tool with features for easy integration with other applications. A wealth of frontend applications and libraries are available. GnuPG also provides support for S/MIME and Secure Shell (ssh).

The GNU Privacy Guard

@matsueushi
matsueushi / sadservers.md
Last active November 23, 2022 13:36
sadserver解き方
  1. "Saint John": what is writing to this log file?

ファイルをオープンしているコマンドは lsof コマンドで調べられる。

ubuntu@ip-172-31-32-108:/$ lsof /var/log/bad.log
COMMAND   PID   USER   FD   TYPE DEVICE SIZE/OFF  NODE NAME
badlog.py 637 ubuntu    3w   REG  259,1    25744 67701 /var/log/bad.log

kill でコマンドを止める。

function solve(n, m, ts, xss, ss)
mat = BitArray(undef, n, m)
for i in 1:n
for j in 1:ts[i]
mat[i, xss[i][j]] = 1
end
end
println(mat)
s = BitArray(ss)
c = 1
└ @ Pkg.Operations /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.4/Pkg/src/Operations.jl:1365
ERROR: Unsatisfiable requirements detected for package Polynomials [f27b6e38]:
Polynomials [f27b6e38] log:
├─possible versions are: [0.5.0-0.5.3, 0.6.0-0.6.1, 0.7.0] or uninstalled
├─restricted to versions 0.6 by an explicit requirement, leaving only versions 0.6.0-0.6.1
└─restricted by compatibility requirements with RecipesBase [3cdcf5f2] to versions: [0.5.0-0.5.3, 0.7.0] or uninstalled — no versions left
└─RecipesBase [3cdcf5f2] log:
├─possible versions are: [0.4.0, 0.5.0, 0.6.0, 0.7.0, 0.8.0, 1.0.0] or uninstalled
└─restricted to versions 1 by IntervalArithmetic [d1acc4aa], leaving only versions 1.0.0
└─IntervalArithmetic [d1acc4aa] log:
using CuArrays, NNlib, Test

ACTIVATION_FUNCTIONS = [σ, logσ, hardσ, hardtanh, relu, leakyrelu, relu6, rrelu, 
                          elu, gelu, celu, swish, lisht, selu, trelu, softplus, 
                          softsign, logcosh, mish, tanhshrink, softshrink];

x = randn(Float32, (5, 5))
for f in filter(x -> x != rrelu, ACTIVATION_FUNCTIONS)
 @testset "$(f)" begin
@matsueushi
matsueushi / Dockerfile
Last active March 31, 2020 01:37
Julia GPU
ARG CUDA=10.0
ARG UBUNTU_VERSION=18.04
FROM nvidia/cuda:${CUDA}-cudnn7-devel-ubuntu${UBUNTU_VERSION}
ENV JULIA_PATH=/usr/local/julia
ENV PATH=$JULIA_PATH/bin:$PATH
ENV JULIA_TAR_ARCH=x86_64
ENV JULIA_DIR_ARCH=x64
@matsueushi
matsueushi / bce.ipynb
Last active January 26, 2020 16:55
(logit)binarycrossentropy
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@matsueushi
matsueushi / adapt.jl
Last active January 9, 2020 04:32
gpu, similar, cpu, adapt
using Adapt
using CuArrays
using Flux
using InteractiveUtils
function f1(x)
fill(1f0, size(x)) |> gpu
end
function f2(x)
function rolling(fun::Function, x::AbstractArray{T}, window::Int) where {T <: Real}
[fun(view(x, i:i + window - 1)) for i = 1:length(x) - window + 1]
end
println(rolling(sum, [1, 2, 3, 4, 5], 2)) # [3, 5, 7, 9]
println(rolling(sum, [1, 2, 3, 4, 5], 3)) # [6, 9, 12]
println(rolling(prod, [1, 2, 3, 4, 5], 3)) # [6, 24, 60]