Skip to content

Instantly share code, notes, and snippets.

@m-tmatma
m-tmatma / cla-test1.txt
Created May 26, 2018 22:48
CLA テスト
CLA テスト
@m-tmatma
m-tmatma / image-mount-test.sh
Last active January 24, 2021 01:14
image-mount-test.sh
#!/bin/sh -e
# イメージファイルのファイル名
FILENAME=$1
# マウントポイント
MOUNT_POINT=$2
# 引数で指定したイメージをループバックデバイスに関連づける。ループバックデバイス名は変数 LOOPBACK_DEVICE に割り当てる。
LOOPBACK_DEVICE=$(sudo losetup -P --show -f ${FILENAME})
@m-tmatma
m-tmatma / docker-proxy.py
Last active December 28, 2020 00:13
docker-proxy.py
#!/usr/bin/python3
import string
import subprocess
import os
import sys
###########################################################################
# template for /etc/apt/apt.conf
###########################################################################
@m-tmatma
m-tmatma / add-docker-group.sh
Last active December 28, 2020 00:12
add docker group.sh
#!/bin/sh -e
sudo usermod -aG docker $USER
sudo reboot
@m-tmatma
m-tmatma / run-squid.sh
Last active December 28, 2020 00:12
run-squid.sh
#!/bin/sh
docker run --name proxy-squid --restart=always -d -p 3128:3128 minimum2scp/squid
@m-tmatma
m-tmatma / setup-build-wireshark.sh
Last active December 28, 2020 00:11
setup-build-wireshark.sh
#!/bin/sh
sudo apt install -y build-essential \
python3-pip \
ninja-build \
cmake flex bison libgcrypt20-dev \
libssh-dev libpcap-dev libsystemd-dev \
qtbase5-dev qttools5-dev qtmultimedia5-dev \
libqt5svg5-dev libc-ares-dev
@m-tmatma
m-tmatma / yocto-proxy.sh
Last active December 28, 2020 00:11
yocto-proxy.sh
#!/bin/sh -e
proxy_url=$http_proxy
if [ -z "$proxy_url" ]; then
git config --global http.proxy ""
git config --global https.proxy ""
else
git config --global http.proxy $proxy_url
git config --global https.proxy $proxy_url
@m-tmatma
m-tmatma / Dockerfile
Last active October 3, 2020 03:48
Dockerfile JDK 8
FROM ubuntu:16.04
ENV DEBIAN_FRONTEND noninteractive
RUN sed -i.bak -r 's!(deb|deb-src) \S+!\1 mirror://mirrors.ubuntu.com/mirrors.txt!' /etc/apt/sources.list \
&& apt-get update -y \
&& apt-get install -y software-properties-common \
&& add-apt-repository ppa:openjdk-r/ppa \
&& apt-get install -y openjdk-8-jdk \
&& rm -rf /var/lib/apt/lists/*
@m-tmatma
m-tmatma / apt-change-mirror.sh
Last active December 28, 2020 00:10
apt の取得先を mirror に変更
#!/bin/sh
sudo sed -i.bak -r 's!(deb|deb-src) \S+!\1 mirror://mirrors.ubuntu.com/mirrors.txt!' /etc/apt/sources.list
@m-tmatma
m-tmatma / install-vscode-ubuntu.sh
Last active December 28, 2020 00:10
ubuntu 上での Visual studio code のインストール
#!/bin/sh
# https://code.visualstudio.com/docs/setup/linux
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
sudo install -o root -g root -m 644 packages.microsoft.gpg /etc/apt/trusted.gpg.d/
sudo sh -c 'echo "deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/packages.microsoft.gpg] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'
sudo apt-get install apt-transport-https
sudo apt-get update
sudo apt-get install code # or code-insiders