トップ 追記

Masa's blog

検索キーワード:

2018年09月01日 How to mount .vmdk from Linux host [長年日記]

_ How to mount .vmdk from Linux host

$ vmware-mount
VMware DiskMount Utility version 6.0.0, build-7535481

Usage: vmware-mount diskPath [partition num] mountPoint
       vmware-mount [option] [opt args]

There are two modes for mounting disks.  If no option is
specified, we mount individual partitions from virtual disks
independently.  The filesystem on the partition will be
accessible at the mount point specified.

The -f option mounts a flat representation of a disk on a
user-specified mount point.  The user must explicitly unmount
the disk when finished.  A disk may not be in both modes at once.

Options: -p <diskID>      list all partitions on a disk
         -l <diskID>      list all mounted partitions on a disk
         -L               list all mounted disks
         -d <mountPoint>  cleanly unmount this partition
                          (closes disk if it is the last partition)
         -f <diskPath> <mountPoint> mount a flat representation of the disk
                          at "mountPoint/flat."
         -k <diskID>      unmount all partitions and close disk
         -K <diskID>      force unmount all partitions and close disk
         -x               unmount all partitions and close all disks
         -X               force unmount all partitions and close all disks
         -r               mount the disk or partition read-only
         -o               comma-separated list of options to be passed
                          to the 'mount' when mounting a partition

2018年08月12日 How to configure for rsync deamon [長年日記]

_ How to configure for rsync deamon

I'm going to get backup 192.168.0.26 from 192.168.0.100 :)

/etc/rsyncd.conf in 192.168.0.26

uid = root
gid = root
[root_partition]
        comment = root partition of my client-pc
        path = /
        read only = true
        hosts allow = 192.168.0.100
        hosts deny = *

Run rsync with daemon mode in 192.168.0.26

/etc/rc.d/rc.local

if [ -x /usr/bin/rsync ]
then
        /usr/bin/rsync --daemon --config=/etc/rsyncd.conf
fi

Backup command in 192.168.0.100

rsync -a --delete -v                            \
        --exclude "/proc/"                      \
        --exclude "/sys/"                       \
        --exclude "/dev/shm/"                   \
        --exclude "/run/"                       \
        rsync://192.168.0.26/root_partition     \
        /backup_dir_for_192.168.0.26

_ Tips about binlog of MySQL

/etc/my.cnf

[mysqld]
default-storage-engine=innodb
log-bin=mysql-bin
expire_logs_days = 5

Backup

$ mysqldump -u root -p password --all-databases >backup.dump

Restore from backup

$ mysql -u root -p password <backup.dump

And restore from binlog

$ mysqlbinlog --start-datetime="2018-08-12 08:45:00" --stop-datetime="2018-08-12 17:15:00" /var/lib/mysql/mysql-bin.XXXXXX | mysql -u root -p password

2018年07月29日 Tips for guest OS(MS-Windows) on vmware(vmplayer) [長年日記]

_ Tips for guest OS(MS-Windows) on vmware(vmplayer)

How to make delay time for starting boot OS.

Put next line into YOUR_OS.vmx

# 5000(ms) delay
BIOS.BootDelay ="5000"

How to cleanup drive

cleanmgr /sageset:1
cleanmgr /sagerun:1

For cleaning up system files quickly

Dism.exe /online /Cleanup-Image /StartComponentCleanup /ResetBase

How to shrink drive

"C:\Program Files\VMware\VMware Tools\VMwareToolboxCmd.exe" disk shrink C:\

For guest OS(Linux)

sudo vmware-toolbox-cmd disk shrink /

2018年07月18日 ijsgutenprint [長年日記]

_ ijsgutenprint

How to use ijsgutenprint for Epson Stylus Photo 1280(Epson PM-3500C)

draft color

cat Foo.ps|\
gs 	-sDEVICE=ijs \
	-sIjsServer=/usr/bin/ijsgutenprint.5.2 \
	-sDeviceManufacturer=EPSON \
	-sDeviceModel=escp2-pm3500c \
	-dIjsUseOutputFD \
	-sIjsParams=Quality=360x120,InkType=PhotoCMYK,MediaType=Plain,MediaSource=Standard,Dither=Fast,ImageType=0,PrintingDirection=Bidirectional \
	-sProcessColorModel=DeviceCMYK \
	-r120 \
	-sPAPERSIZE=a4 \
	-q \
	-dNOPROMPT \
	-dNOPAUSE \
	-dSAFER \
	-sOutputFile=- \
	- \
	-c \
	quit >/dev/lp

standard color

cat Foo.ps|\
gs 	-sDEVICE=ijs \
	-sIjsServer=/usr/bin/ijsgutenprint.5.2 \
	-sDeviceManufacturer=EPSON \
	-sDeviceModel=escp2-pm3500c \
	-dIjsUseOutputFD \
	-sIjsParams=Quality=360,InkType=PhotoCMYK,MediaType=Plain,MediaSource=Standard,Dither=Ordered,ImageType=1,PrintingDirection=Bidirectional \
	-sProcessColorModel=DeviceCMYK \
	-r360 \
	-sPAPERSIZE=a4 \
	-q \
	-dNOPROMPT \
	-dNOPAUSE \
	-dSAFER \
	-sOutputFile=- \
	- \
	-c \
	quit >/dev/lp

fine color

cat Foo.ps|\
gs 	-sDEVICE=ijs \
	-sIjsServer=/usr/bin/ijsgutenprint.5.2 \
	-sDeviceManufacturer=EPSON \
	-sDeviceModel=escp2-pm3500c \
	-dIjsUseOutputFD \
	-sIjsParams=Quality=720,InkType=PhotoCMYK,MediaType=Inkjet,MediaSource=Standard,Dither=Adaptive,ImageType=2,PrintingDirection=Unidirectional \
	-sProcessColorModel=DeviceCMYK \
	-r720 \
	-sPAPERSIZE=a4 \
	-q \
	-dNOPROMPT \
	-dNOPAUSE \
	-dSAFER \
	-sOutputFile=- \
	- \
	-c \
	quit >/dev/lp

photo color

cat Foo.ps|\
gs 	-sDEVICE=ijs \
	-sIjsServer=/usr/bin/ijsgutenprint.5.2 \
	-sDeviceManufacturer=EPSON \
	-sDeviceModel=escp2-pm3500c \
	-dIjsUseOutputFD \
	-sIjsParams=Quality=1440x720,InkType=PhotoCMYK,MediaType=Glossy,MediaSource=Standard,Dither=EvenTone,ImageType=2,,PrintingDirection=Unidirectional \
	-sProcessColorModel=DeviceCMYK \
	-r720 \
	-sPAPERSIZE=a4 \
	-q \
	-dNOPROMPT \
	-dNOPAUSE \
	-dSAFER \
	-sOutputFile=- \
	- \
	-c \
	quit >/dev/lp

draft monochrome

cat Foo.ps|\
gs 	-sDEVICE=ijs \
	-sIjsServer=/usr/bin/ijsgutenprint.5.2 \
	-sDeviceManufacturer=EPSON \
	-sDeviceModel=escp2-pm3500c \
	-dIjsUseOutputFD \
	-sIjsParams=Quality=360x120,InkType=PhotoCMYK,MediaType=Plain,MediaSource=Standard,Dither=Fast,ImageType=0,PrintingDirection=Bidirectional \
	-sProcessColorModel=DeviceGray \
	-r120 \
	-sPAPERSIZE=a4 \
	-q \
	-dNOPROMPT \
	-dNOPAUSE \
	-dSAFER \
	-sOutputFile=- \
	- \
	-c \
	quit >/dev/lp

standard monochrome

cat Foo.ps|\
gs 	-sDEVICE=ijs \
	-sIjsServer=/usr/bin/ijsgutenprint.5.2 \
	-sDeviceManufacturer=EPSON \
	-sDeviceModel=escp2-pm3500c \
	-dIjsUseOutputFD \
	-sIjsParams=Quality=360,InkType=PhotoCMYK,MediaType=Plain,MediaSource=Standard,Dither=Ordered,ImageType=1,PrintingDirection=Bidirectional \
	-sProcessColorModel=DeviceGray \
	-r360 \
	-sPAPERSIZE=a4 \
	-q \
	-dNOPROMPT \
	-dNOPAUSE \
	-dSAFER \
	-sOutputFile=- \
	- \
	-c \
	quit >/dev/lp

fine monochrome

cat Foo.ps|\
gs 	-sDEVICE=ijs \
	-sIjsServer=/usr/bin/ijsgutenprint.5.2 \
	-sDeviceManufacturer=EPSON \
	-sDeviceModel=escp2-pm3500c \
	-dIjsUseOutputFD \
	-sIjsParams=Quality=720,InkType=PhotoCMYK,MediaType=Inkjet,MediaSource=Standard,Dither=Adaptive,ImageType=2,PrintingDirection=Unidirectional \
	-sProcessColorModel=DeviceGray \
	-r720 \
	-sPAPERSIZE=a4 \
	-q \
	-dNOPROMPT \
	-dNOPAUSE \
	-dSAFER \
	-sOutputFile=- \
	- \
	-c \
	quit >/dev/lp

photo monochrome

cat Foo.ps|\ gs -sDEVICE=ijs \

-sIjsServer=/usr/bin/ijsgutenprint.5.2 \
-sDeviceManufacturer=EPSON \
-sDeviceModel=escp2-pm3500c \
-dIjsUseOutputFD \
-sIjsParams=Quality=1440x720,InkType=PhotoCMYK,MediaType=Glossy,MediaSource=Standard,Dither=EvenTone,ImageType=2,PrintingDirection=Unidirectional \
-sProcessColorModel=DeviceGray \
-r720 \
-sPAPERSIZE=a4 \
-q \
-dNOPROMPT \
-dNOPAUSE \
-dSAFER \
-sOutputFile=- \
- \
-c \
quit >/dev/lp

Parameters

Quality
-sIjsParams=Quality=360x120	Fast economy draft output on plain paper.
-sIjsParams=Quality=360	Standard quality output on plain paper.
-sIjsParams=Quality=720	Maximum quality on plain paper
-sIjsParams=Quality=1440x720	High quality on photo paper.
-sIjsParams=Quality=2880x720	Highest quality on photo paper.
InkType
-sIjsParams=InkType=CMYK
MediaType
-sIjsParams=MediaType=Plain		Plain Paper
-sIjsParams=MediaType=Inkjet		Inkjet Paper
-sIjsParams=MediaType=Photo		Photo Paper
-sIjsParams=MediaType=Glossy		Photo Quality Glossy Paper
MediaSource
-sIjsParams=MediaSource=Standard	Standard
-sIjsParams=MediaSource=Roll		Roll Feed
Dither
-sIjsParams=Dither=Adaptive		For highest quality
-sIjsParams=Dither=Ordered		Ordered
-sIjsParams=Dither=Fast		Fast
ProcessColorModel
-sProcessColorModel=DeviceGray -dBitsPerSample=1	Black and white
-sProcessColorModel=DeviceGray				Grayscale
-sProcessColorModel=DeviceCMYK				Color (CMYK)
ImageType
-sIjsParams=ImageType=0	Line art (color or gray scale)
-sIjsParams=ImageType=1	Primarily solid colors or smooth gradients (color or gray scale)
-sIjsParams=ImageType=2	Continuous-tone photographs (color or gray scale)
PrintingDirection
-sIjsParams=PrintingDirection=Unidirectional
-sIjsParams=PrintingDirection=Bidirectional

2018年06月17日 bind-9.13.1 dnssec validating ./NS: got insecure response; parent indicates it should be secure [長年日記]

_ bind-9.13.1 dnssec validating ./NS: got insecure response; parent indicates it should be secure

I have done version-up to bind-9.13.1 from bind-9.13.0.

but it can't work properly with following messages :(

validating ./NS: got insecure response; parent indicates it should be secure
validating ./NS: no valid signature found
validating myh.no-ip.org/AAAA: bad cache hit (org/DS)

I don't know why, but I have made DNSSEC off :P

/etc/named.conf

dnssec-validation no;

then everything goes fine :)


2018年04月12日 xrdp-0.9.6 and xorgxrdp-0.2.6 on Slackware-14.2(64) [長年日記]

_ How to build xrdp-0.9.6

$ tar xvf xrdp-0.9.6.tar.gz
$ cd xrdp-0.9.6
$ ./bootstrap
$ ./configure
$ ./configure --disable-pam --disable-painter --disable-rfxcodec
$ make
# make install

_ How to build xorgxrdp-0.2.6

$ tar xvf  xorgxrdp-0.2.6.tar.gz
$ cd xorgxrdp-0.2.6
$ ./bootstrap
$ ./configure
$ make
# make install

_ How to fix login failure

I could not login with next error message in /var/log/xrdp-sesman.log.

[20180412-01:46:53] [INFO ] Xorg :10 -auth .Xauthority -config xrdp/xorg.conf -noreset -nolisten tcp -logfile .xorgxrdp.%s.log
[20180412-01:47:03] [ERROR] X server for display 10 startup timeout
[20180412-01:47:03] [CORE ] waiting for window manager (pid 19184) to exit
[20180412-01:47:03] [ERROR] X server for display 10 startup timeout
[20180412-01:47:03] [ERROR] another Xserver might already be active on display 10 - see log
[20180412-01:47:03] [DEBUG] aborting connection...

I fixed this issue by next command :)

# echo "allowed_users=anybody" >>/etc/X11/Xwrapper.config

2018年03月19日 Build of firefox-59.0.1 on Slackware-14.2(64) [長年日記]

_ Build of firefox-59.0.1 on Slackware-14.2(64)

about:config

no longer `general.useragent.locale=ja_JP' is not used.

Use next.

intl.locale.requested=ja_JP

Environment

I got following message with firefox-59.0.1 on youtube and I couldn't get any sound, even I have installed pulseaudio :(

You may need to install the required PulseAudio software

I must need following environment variable to fix this :)

export MOZ_DISABLE_CONTENT_SANDBOX=1

or it also fix this to start pulseaudio in ~/.xinitrc like following.

/usr/bin/pulseaudio --start --log-target=syslog &

Environmet variable for plugin.

export MOZ_PLUGIN_PATH=/usr/lib64/mozilla/plugins

2018年01月25日 Build firefox-58.0 on Slackware-14.2(64) [長年日記]

_ Build

$ cd ~m-ito/tmp
$ tar xvf firefox-58.0.source.tar.xz
$ cd firefox-58.0
$ vi .mozcofig
export LDFLAGS="-latomic"
. $topsrcdir/browser/config/mozconfig
ac_add_options --enable-optimize
ac_add_options --enable-default-toolkit=cairo-gtk3
ac_add_options --disable-debug
ac_add_options --disable-tests
$ curl https://sh.rustup.rs -sSf | sh
$ PATH="/home/m-ito/.cargo/bin:/usr/local/autoconf-2.13/bin:${PATH}"; export PATH
$ export LANG=C; export LC_ALL=C
$ rustup update
$ ./mach build && ./mach build package

_ Install

# mkdir /usr/local/firefox-58.0
# cd /usr/local/firefox-58.0
# tar xvf /home/m-ito/tmp/firefox-58.0/obj-x86_64-pc-linux-gnu/dist/firefox-58.0.en-US.linux-x86_64.tar.bz2

2018年01月21日 How to make working stably `PLANEX GW-USNano2 802.11n Wireless Adapter [Realtek]' [長年日記]

_ 'PLANEX GW-USNano2' is unstable with Slackware-14.2's native driver.

I'm using `PLANEX GW-USNano2' for USB wireless adapter on Slackware-14.2(64). But it often disconnect with native driver rtl8291cu :(

_ How to fix

Use P.Varet's rtl8192cu-fixes for driver :)

Install dkms-2.4.0.tar.gz first.

# wget https://slackbuilds.org/slackbuilds/14.2/development/dkms.tar.gz
# tar xvf dkms.tar.gz
# cd dkms
# wget https://github.com/dell/dkms/archive/v2.4.0/dkms-2.4.0.tar.gz
# sh dkms.SlackBuild
# installpkg /tmp/dkms-2.4.0-x86_64-1_SBo.tgz

Install rtl8192cu-fixes

# git clone https://github.com/pvaret/rtl8192cu-fixes.git
# dkms add ./rtl8192cu-fixes
# dkms install 8192cu/1.10
# depmod -a
# cp ./rtl8192cu-fixes/blacklist-native-rtl8192.conf /etc/modprobe.d/
# cp ./rtl8192cu-fixes/8192cu-disable-power-management.conf /etc/modprobe.d/
# reboot

After that, `PLANEX GW-USNano2' works very fine(I don't face suddenly disconnect).

_ misc

Mr. P.Varet said in his github page

!! This driver is DEPRECATED !!
The new rtl8xxxu driver initially introduced in kernel 4.4 works pretty well these days, and you almost certainly should prefer it to this repository.

But I think P.Varet's driver is still more stable than Slackware-14.2's native driver in Kernel 4.4.14.


2017年11月05日 Fix for `East Asian Ambiguous Character Width(EAW )' [長年日記]

_ How to Fix

Get UTF-8-EAW-FULLWIDTH.gz

# cp UTF-8-EAW-FULLWIDTH.gz /usr/share/i18n/charmaps/
# cd /usr/share/i18n/charmaps/
# localedef -f UTF-8-EAW-FULLWIDTH -i ja_JP ja_JP.UTF-8

_ Undo

# localedef -f UTF-8 -i ja_JP ja_JP.UTF-8

Awesome!