Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Akashi_SN AkashiSN

🏠
Working from home
View GitHub Profile
@AkashiSN
AkashiSN / md-tex2img.py
Last active Dec 29, 2017
Markdownの$$で囲まれたTex数式を画像に置き換えてGitHubなどで表示できるようにするスクリプト
View md-tex2img.py
#!/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 / ctf_tools.sh
Last active May 31, 2018
CTF tool installation script.
View ctf_tools.sh
#!/bin/bash
# Advance preparation
echo "source $HOME/.ctf_tool" >> $HOME/.zshrc
# Support 32-bit elf.
sudo apt install -y lib32z1
# Install other tools.
sudo apt install -y gdb binutils build-essential strace ltrace\
View common_modulus_attack.py
#!/usr/bin/env python3
#
# Common Modulus Attack
#
import gmpy2,binascii
n = int(input('n:'))
e1 = int(input('e1:'))
View rsa.py
#!/usr/bin/env python3
#
# Compute the RSA cipher
#
import gmpy2,binascii
n = int(input('n:'))
e = int(input('e:'))
View low_public_exponent_attack.py
#!/usr/bin/env python3
#
# Low Public-Exponent Attack
#
import gmpy2
n = int(input('n:'))
e = int(input('e:'))
@AkashiSN
AkashiSN / caps_lock.json
Last active Apr 22, 2019
setting for Karabiner
View caps_lock.json
{
"title": "caps_lock",
"rules": [
{
"manipulators": [
{
"conditions": [
{
"bundle_identifiers": [
"^com\\.apple\\.Terminal$",
@AkashiSN
AkashiSN / softether-install-vyos1.2.md
Created Apr 27, 2019
vyos1.2にSoftEther VPNをインストールする
View softether-install-vyos1.2.md

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 / ddclient-install-vyos1.2.md
Last active Apr 27, 2019
vyos1.2でCloudFlareのDDNSを使う
View ddclient-install-vyos1.2.md

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'
View colaboratory_ssh.txt
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
View caps2ctrl.reg
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,1d,00,3a,00,00,00,00,00