Skip to content

Instantly share code, notes, and snippets.

View AkashiSN's full-sized avatar
🏠
Working from home

Akashi_SN AkashiSN

🏠
Working from home
View GitHub Profile
@AkashiSN
AkashiSN / Dockerfile
Last active December 25, 2019 14:43
Jupyterlab docker
FROM nvidia/cuda:10.0-cudnn7-devel-ubuntu18.04 as cuda
ENV DEBIAN_FRONTEND=noninteractive
ENV NVIDIA_DRIVER_CAPABILITIES utility,compute
ENV NVIDIA_VISIBLE_DEVICES all
RUN sed -i'~' -E "s@http://(..\.)?(archive|security)\.ubuntu\.com/ubuntu@http://jp.archive.ubuntu.com/ubuntu@g" /etc/apt/sources.list \
&& apt-get update \
&& apt-get install --yes --no-install-recommends \
build-essential \
@AkashiSN
AkashiSN / colaboratory_ssh.txt
Last active November 22, 2019 05:05 — forked from creotiv/gist:d091515703672ec0bf1a6271336806f0
connect colaboratory by ssh
import random, string, urllib.request, json, getpass, time
#Generate root password
password = ''.join(random.choice(string.ascii_letters + string.digits) for i in range(20))
#Download ngrok
! wget -q -c -nc https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip
! unzip -qq -n ngrok-stable-linux-amd64.zip
#Setup sshd
@AkashiSN
AkashiSN / ddclient-install-vyos1.2.md
Last active April 27, 2019 01:44
vyos1.2でCloudFlareのDDNSを使う

vyos1.2でCloudFlareのDDNSを使う

vyos1.2ではDDNSとしてddclientをサポートしているので以下のように設定できる

$ config
# set service dns dynamic interface eth0 service cloudflare host-name '[変更したいドメイン名]'
# set service dns dynamic interface eth0 service cloudflare login '[email]'
# set service dns dynamic interface eth0 service cloudflare password '[Global API Key]'
# set service dns dynamic interface eth0 service cloudflare protocol 'cloudflare'
@AkashiSN
AkashiSN / softether-install-vyos1.2.md
Created April 27, 2019 01:25
vyos1.2にSoftEther VPNをインストールする

vyos1.2にSoftEther VPNをインストールする

1.2.0-rolling+201904260337ではgccなどが依存関係によりインストールできないので他のマシンでビルドを行う

Linux router 4.19.36-amd64-vyos #1 SMP Sun Apr 21 10:39:20 CEST 2019 x86_64 GNU/Linux

kernelバージョンは4.19.36のようなので、ubuntu18.10kernelバージョンを4.19.36にあげてビルドを行う

@AkashiSN
AkashiSN / caps_lock.json
Last active April 22, 2019 06:57
setting for Karabiner
{
"title": "caps_lock",
"rules": [
{
"manipulators": [
{
"conditions": [
{
"bundle_identifiers": [
"^com\\.apple\\.Terminal$",
#!/usr/bin/env python3
#
# Low Public-Exponent Attack
#
import gmpy2
n = int(input('n:'))
e = int(input('e:'))
#!/usr/bin/env python3
#
# Compute the RSA cipher
#
import gmpy2,binascii
n = int(input('n:'))
e = int(input('e:'))
#!/usr/bin/env python3
#
# Common Modulus Attack
#
import gmpy2,binascii
n = int(input('n:'))
e1 = int(input('e1:'))
@AkashiSN
AkashiSN / md-tex2img.py
Last active December 29, 2017 14:00
Markdownの$$で囲まれたTex数式を画像に置き換えてGitHubなどで表示できるようにするスクリプト
#!/usr/bin/env python3
import sys
pattern = '<img src="https://latex.codecogs.com/png.latex?{}" />'
with open(sys.argv[1] ,"r") as f:
new_lines = ""
while True:
new_line = ""
line = f.readline()
@AkashiSN
AkashiSN / dev_tools.sh
Last active January 11, 2021 14:10
Development tool installation script for ubuntu 18.04 LTS
#!/bin/bash
#
# JetBrains ToolBox
#
# Download program.
wget https://download.jetbrains.com/toolbox/jetbrains-toolbox-1.11.4269.tar.gz -P /tmp
# Expand archives.