Skip to content

Instantly share code, notes, and snippets.

@idkqh7
idkqh7 / sshRPi.py
Last active August 29, 2015 13:59
MACアドレスからプライベートネットワーク上のRaspberry Piを検索し、自動でSSH接続を行う(有線ネットワーク用)
from _socket import gethostbyname, gethostname
import subprocess
import os
import re
import pexpect
from sys import stdout
def get_rpi_ip(network):
output = subprocess.check_output(['arp', '-a'])
\documentclass[uplatex]{jsarticle}
\begin{document}
吾輩は猫である。名前はまだ無い。
どこで生れたかとんと見当がつかぬ。
何でも薄暗いじめじめした所で
ニャーニャー泣いていた事だけは記憶している。
吾輩はここで始めて人間というものを見た。
sudo apt-get update
sudo apt-get install texlive-lang-cjk
wget https://gist.github.com/idkqh7/8c6439b89f7aa1250a5d/raw/test.tex
uplatex test.tex
dvipdfmx test.dvi
evince test.pdf
@idkqh7
idkqh7 / addupdflatex.py
Last active August 29, 2015 14:06
Add a typeset of updfLatex for TexWorks
#!/usr/bin/python3
__author__ = 'idkqh7'
import os
import re
updfLatex = '''[001]
name=updfLatex
program=updflatex
#!/bin/sh
uplatex -synctex=1 "$1" && \
dvipdfmx "`basename "$1" .tex`"
sudo apt-get install texworks
wget https://gist.github.com/idkqh7/369ec0fc915fcbbee559/raw/updflatex
chmod +x updflatex
sudo mv updflatex /usr/local/bin/
wget https://gist.github.com/idkqh7/ea94620ec6c5951bef30/raw/addupdflatex.py
python3 addupdflatex.py
rm addupdflatex.py
@idkqh7
idkqh7 / enable_universe_repo.patch
Created September 14, 2014 08:20
Enable universe repository for Jetson TK1
--- sources.list 2000-02-01 11:19:01.619500826 +0000
+++ sources.list 2000-02-01 11:19:54.623500813 +0000
@@ -14,10 +14,10 @@
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
-# deb http://ports.ubuntu.com/ubuntu-ports/ trusty universe
-# deb-src http://ports.ubuntu.com/ubuntu-ports/ trusty universe
-# deb http://ports.ubuntu.com/ubuntu-ports/ trusty-updates universe
-# deb-src http://ports.ubuntu.com/ubuntu-ports/ trusty-updates universe
cd ~/NVIDIA-INSTALLER
sudo ./installer.sh
sudo reboot
# CUDA 6.0 Toolkit for L4T Rel
# https://developer.nvidia.com/jetson-tk1-support
# ダウンロードにはCUDA Registered Developer Programへの参加(登録)が必要
# debインストールのために時刻合わせ
sudo ntpdate ntp.nict.jp
date
sudo dpkg -i ~/Downloads/cuda-repo-l4t-r19.2_6.0-42_armhf.deb
sudo apt-get update
sudo apt-get install cuda-samples-6-0 cuda-toolkit-6-0
sudo sh -c 'echo "deb http://jp.archive.ubuntu.com/ubuntu/ precise main universe" >> /etc/apt/sources.list'
sudo sh -c 'echo "deb-src http://jp.archive.ubuntu.com/ubuntu/ precise main universe" >> /etc/apt/sources.list'
sudo dpkg --add-architecture armhf
dpkg --print-foreign-architectures
# i386
# armhf
# HACK : I don't want to touch sources.list
# apt-get updateの404が気にならない人は実行しなくても問題なし