Skip to content

Instantly share code, notes, and snippets.

@Ovis
Ovis / gist:6a12816e40a9997fde2b45727b8bfc11
Created March 22, 2020 17:00
RaspberryPi4 fstab_old
proc /proc proc defaults 0 0
PARTUUID=738a4d67-01 /boot vfat defaults 0 2
PARTUUID=738a4d67-02 / ext4 defaults,noatime 0 1
# a swapfile is not a swap partition, no line here
# use dphys-swapfile swap[on|off] for that
pi@raspberrypi:~ $ ls -l /dev/disk/by-partuuid/
total 0
lrwxrwxrwx 1 root root 10 Mar 22 12:15 0dac4cfa-ecf8-4927-9c86-b8b30e54ddb9 -> ../../sda1
lrwxrwxrwx 1 root root 15 Feb 13 16:09 738a4d67-01 -> ../../mmcblk0p1
lrwxrwxrwx 1 root root 15 Feb 13 16:10 738a4d67-02 -> ../../mmcblk0p2
@Ovis
Ovis / gist:8c96805a9ea518d5b9e0d30d1148f28d
Created March 22, 2020 16:50
RaspberryPi4 e2fsck -f /dev/sda1
pi@raspberrypi:~ $ sudo e2fsck -f /dev/sda1
e2fsck 1.44.5 (15-Dec-2018)
rootfs: recovering journal
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
Free blocks count wrong (3394406, counted=3353763).
Fix<y>? y
@Ovis
Ovis / gist:ee39dac0b008a484b4422f2aa9def9f3
Created March 22, 2020 16:45
RaspberryPi4 sudo fdisk -l
pi@raspberrypi:~ $ sudo fdisk -l
Disk /dev/ram0: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
(中略)
Disk /dev/mmcblk0: 14.5 GiB, 15582887936 bytes, 30435328 sectors
Units: sectors of 1 * 512 = 512 bytes
@Ovis
Ovis / gist:4985f96b65dfb737ab0af2e4264de359
Created March 22, 2020 16:43
RaspberryPi4 sudo parted /dev/sda
pi@raspberrypi:~ $ sudo parted /dev/sda
GNU Parted 3.2
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) mklabel gpt
Warning: The existing disk label on /dev/sda will be destroyed and all data on this disk will be lost. Do you want to continue?
Yes/No? y
(parted) mkpart primary ext4 0% 100%
(parted) p
Model: SanDisk Ultra Fit (scsi)
@Ovis
Ovis / gist:23e51634cb5cf819f181f96bf0c0f43a
Created March 22, 2020 16:36
RaspberryPi 4 sudo fdisk -l
pi@raspberrypi:~ $ sudo fdisk -l
Disk /dev/ram0: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
(中略)
Disk /dev/mmcblk0: 14.5 GiB, 15582887936 bytes, 30435328 sectors
Units: sectors of 1 * 512 = 512 bytes
@Ovis
Ovis / Cron
Last active January 13, 2020 06:37
Raspberry Piで.NET Coreアプリを定期実行する場合のCronファイル
# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/home/pi/dotnet
# Example of job definition:
@Ovis
Ovis / vpnserver_start.sh
Last active February 17, 2020 10:23
SoftEther起動用シェルスクリプト
#!/bin/bash
/usr/local/vpnserver/vpnserver start
#SoftEther起動に時間がかかって、tapが取得できない問題の対応
sleep 5
tap=$(/sbin/ifconfig -a| awk '$1 ~ /^tap/ {print $1}')
/sbin/brctl addif br0 $tap
@Ovis
Ovis / gist:4831aefdf613026c613fc98ed9f8da71
Created January 8, 2020 05:10
SoftEther Bridge用設定
## loopback
auto lo
iface lo inet loopback
## Ethernet port
auto eth0
iface eth0 inet manual
## Bridge interface
auto br0
@Ovis
Ovis / MainWindow.xaml
Created November 24, 2019 08:45 — forked from kekyo/MainWindow.xaml
DelegateCommand on WPF
<Window x:Class="WpfApp1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfApp1"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Button x:Name="button">
TEST