2018/3/19

SoftEtnerVPN 安裝

沒有 package,所以要從 source..
git clone https://github.com/SoftEtherVPN/SoftEtherVPN.git
cd SoftEtherVPN
./configure
---------------------------------------------------------------------
SoftEther VPN for Unix

Copyright (c) SoftEther VPN Project at University of Tsukuba, Japan.
Copyright (c) Daiyuu Nobori. All Rights Reserved.

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation.

Read and understand README.TXT, LICENSE.TXT and WARNING.TXT before use.
---------------------------------------------------------------------

Welcome to the corner-cutting configure script !

The Makefile is generated. Run 'make' to build SoftEther VPN.

看一下 Makefile...
安裝位置..
INSTALL_BINDIR=/usr/bin/
INSTALL_VPNSERVER_DIR=/usr/vpnserver/
INSTALL_VPNBRIDGE_DIR=/usr/vpnbridge/
INSTALL_VPNCLIENT_DIR=/usr/vpnclient/
INSTALL_VPNCMD_DIR=/usr/vpncmd/

2018/3/17

把google photo 中高解析的照片換成低解析不,不佔空間

How to Convert Full Resolution Photos to Free Unlimited?
有一個 Recover storage 的 button..
按下去,等一下..(好幾小時) 到 google driver 去看 storage quota, google photo 佔的就變成 0 了。

2018/3/16

couldn't mount RDWR because of unsupported optional features (400)

linux-couldnt-mount-rdwr-because-of-unsupported-optional-features-400

所以 follow 這一篇...
用 tune2fs -l 列出用 prebuilt/linux-x86/mkfs/make_ext4s 和 系統 mkfs.ext4 format 過得 block deviice, feature 部份...
make_ext4fs:
Filesystem volume name:   
Last mounted on:          
Filesystem UUID:          57f8f4bc-abf4-0000-675f-946fc0f9f25b
Filesystem magic number:  0xEF53
Filesystem revision #:    1 (dynamic)
Filesystem features:      has_journal resize_inode filetype extent sparse_super large_file
Default mount options:    (none)
Filesystem state:         clean
Errors behavior:          Remount read-only
Filesystem OS type:       Linux
Inode count:              6400
Block count:              25600
Reserved block count:     0
Free blocks:              24162
Free inodes:              6389
First block:              0
Block size:               4096
Fragment size:            4096
Reserved GDT blocks:      7
Blocks per group:         32768
Fragments per group:      32768
Inodes per group:         6400
Inode blocks per group:   400
Last mount time:          n/a
Last write time:          Thu Jan  1 08:00:00 1970
Mount count:              0
Maximum mount count:      -1
Last checked:             Thu Jan  1 08:00:00 1970
Check interval:           0 ()
Reserved blocks uid:      0 (user root)
Reserved blocks gid:      0 (group root)
First inode:              11
Inode size:           256
Required extra isize:     28
Desired extra isize:      28
Journal inode:            8
Default directory hash:   tea
Journal backup:           inode blocks

mkfs.ext4:
Filesystem volume name:   
Last mounted on:          
Filesystem UUID:          b4eaefc3-2856-4c9f-9abd-4b65a2fbd6f0
Filesystem magic number:  0xEF53
Filesystem revision #:    1 (dynamic)
Filesystem features:      has_journal ext_attr resize_inode dir_index filetype extent 64bit flex_bg sparse_super large_file huge_file dir_nlink extra_isize metadata_csum
Filesystem flags:         signed_directory_hash 
Default mount options:    user_xattr acl
Filesystem state:         clean
Errors behavior:          Continue
Filesystem OS type:       Linux
Inode count:              64000
Block count:              256000
Reserved block count:     12800
Free blocks:              247252
Free inodes:              63989
First block:              0
Block size:               4096
Fragment size:            4096
Group descriptor size:    64
Reserved GDT blocks:      124
Blocks per group:         32768
Fragments per group:      32768
Inodes per group:         8000
Inode blocks per group:   500
Flex block group size:    16
Filesystem created:       Fri Mar 16 18:35:45 2018
Last mount time:          n/a
Last write time:          Fri Mar 16 18:35:45 2018
Mount count:              0
Maximum mount count:      -1
Last checked:             Fri Mar 16 18:35:45 2018
Check interval:           0 ()
Lifetime writes:          17 MB
Reserved blocks uid:      0 (user root)
Reserved blocks gid:      0 (group root)
First inode:              11
Inode size:           256
Required extra isize:     32
Desired extra isize:      32
Journal inode:            8
Default directory hash:   half_md4
Directory Hash Seed:      0a08ac54-71c0-4329-93b6-8830d536aaba
Journal backup:           inode blocks
Checksum type:            crc32c
Checksum:                 0x9b3ce51d
果然 filesystem feature 部份差異很多..

2018/3/14

refcode, dump_sector..

void dump_sector(unsigned char *buf, int len)
{
        int i, j;

        printk(KERN_ERR " Sector Dump \n");

        for (i = 0 ; i < len ; i += 16) {
                printk(KERN_ERR "%04d: ", i);

                for (j = 0 ; j < 16 ; j++) {
                        unsigned char c = buf[i+j];
                        if (c >= 0x20 && c < 0x7e)
                                printk(" %c ", buf[i+j]);  // 如果不用印出 ascii 的話,就不用這個判斷..
                        else
                                printk("%02x ", buf[i+j]);
                }

                printk("\n");
        }
}
常常會用到...

sudo PATH

ref:How to make sudo preserve $PATH

sudo 的 PATH 和user 不一樣。
設定在 /etc/sudoers :
Defaults    secure_path = /sbin:/bin:/usr/sbin:/usr/bin
所以要改的話....