Skip to content

Instantly share code, notes, and snippets.

View 190ikp's full-sized avatar
😇
( ˘ω˘)

190ikp 190ikp

😇
( ˘ω˘)
View GitHub Profile
@190ikp
190ikp / docker_init.sh
Created October 9, 2023 10:07
Docker installation script
#!/usr/bin/env bash
set -euxo pipefail
# shellcheck disable=SC1091
source /etc/os-release
# Check if previous version of docker-compose is installed
if command -v doker-compose > /dev/null; then
sudo rm -f "$(command -v docker-compose)"
fi
INFO global: Vagrant version: 2.3.7
INFO global: Ruby version: 3.1.4
INFO global: RubyGems version: 3.3.26
INFO global: VAGRANT_INSTALLER_ENV="1"
INFO global: VAGRANT_EXECUTABLE="/opt/vagrant/embedded/gems/gems/vagrant-2.3.7/bin/vagrant"
INFO global: VAGRANT_INSTALLER_VERSION="2"
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="/opt/vagrant/embedded"
INFO global: VAGRANT_LOG="debug"
WARN global: resolv replacement has not been enabled!
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-2.3.7/plugins/communicators/winrm/plugin.rb
#!/usr/bin/env bash
set -euo pipefail
# This script is based on NodeSource's repository.
# see: https://github.com/nodesource/distributions
# shellcheck disable=SC1091
source /etc/os-release
export NODE_VERSION=node_16.x
@190ikp
190ikp / README.md
Last active January 31, 2023 07:06
VSCode setting at Keio ITC

ITCのLinux環境でC言語を書くときの設定

VSCodeを使って書くときの設定ファイル

ITCの環境はincludeとgccのバイナリが変な場所にあって,VSCodeがデフォルト設定のままではF5デバッグできないので...

フォーマッタはプロ3の演習で指定される形式のものにしています

必要なもの

#!/usr/bin/env bash
set -euo pipefail
# moving all stopping LXD container from node to node.
function get_stopping_containers() {
lxc list --format json |
jq -rc 'map({"name": .name, "node": .location, "status": .state.status, "disk_limit": .expanded_devices.root.size, "disk_usage": .state.disk.root.usage} |
select(.status == "Stopped" and .node == '\""$1"\"')) |
.[]'
#!/usr/bin/env bash
set -euxo pipefail
export NVIDIA_DRIVER_VERSION=470-server
export CUDA_VERSION=11-1
modify_bashrc() {
# don't variable expand in heredoc
cat << 'EOF' >> /etc/profile.d/cuda.sh
export PATH=$PATH:/usr/local/cuda/bin
@190ikp
190ikp / local.db
Created June 30, 2020 09:51
`/var/snap/lxd/common/lxd/database/local.db` before running `lxd init`
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE schema (
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
version INTEGER NOT NULL,
updated_at DATETIME NOT NULL,
UNIQUE (version)
);
INSERT INTO schema VALUES(1,39,1593510249);
CREATE TABLE config (
set -g default-terminal "tmux-256color"
set-option -g mouse on
bind-key -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
bind-key -n WheelDownPane select-pane -t= \; send-keys -M
bind e setw synchronize-panes on
bind E setw synchronize-panes off
@190ikp
190ikp / report.md
Created May 4, 2020 03:38 — forked from Kumassy/report.md
pandoc report

documentclass: ltjsarticle header-includes:

  • \usepackage[version=3]{mhchem} metadata: table1: date: 1615 年 5 月 5 日 (金)丑三つ時 theme: 様々な食品におけるカフェイン

table2:

@190ikp
190ikp / docker-compose.yml
Last active December 12, 2018 15:30
examples of docker-compose & nginx.conf for KCS article
version: '3'
services:
web:
container_name: web
image: nginx:mainline-alpine
ports:
- 80:80
- 443:443
volumes:
- /vagrant/nginx.conf:/etc/nginx/nginx.conf:ro