2015年6月23日火曜日

windows7とファイルサーバのやりとりを高速化したい(large mtuの有効化)

windows7とファイルサーバのやりとりを高速化したい(large mtuの有効化)

何故今まで知らなかったんだろうという目から鱗の記事。

http://d.hatena.ne.jp/ogawad/20130702/1372719890

windows8から標準化されたlarge MTUをwindows7で有効化すると、約30%以上の高速化が見込まれる。
普通にジャンボフレームとか設定しては挫折したのに、たったこれだけで「本当に」高速化した。

Registry key    HKEY_LOCAL_MACHINE
Registry path    System\CurrentControlSet\Services\Lanmanworkstation\Parameters
Value Name    DisableLargeMtu
Value type    REG_DWORD
Value range    1=disable, 0=enable
Default value    1 (if not present)

要はレジストリエディタで、

HKEY_LOCAL_MACHINE



System\CurrentControlSet\Services\Lanmanworkstation\Parameters

を開き、新規で

DisableLargeMtu

を追加(reg_DWORD)。

値を0に。

すると、クライアント→ファイルサーバの送信が
350mbps→430mbps(最速値。2GBのファイルを送信。22%高速化)
ファイルサーバ→クライアントが
500mbps→700mbps(最速値。同ファイルを受信。40%高速化)
した。

何で知らなかったんだろう本当に・・・。
因みにいわゆるMTU値を弄るジャンボフレームはオフでの値。

無知は恥ですわ・・・。

2015年6月17日水曜日

squid.conf設定(squid3のコンフィグレーションファイル)

一寸前のsquid設定を。
今はこれよりもっと書いてしまっているが、収拾が付かなくなりそうなので一度上げとこうかと。
透過プロキシで、httpアクセラレーター設定。
iptablesでポートの転送設定しないといつまでも繋がらないので注意。
あとhttps(ssl通信)をsquidで乗っ取ろうとしたけど断念。
理由は透過プロキシだとman inthe middleになってしまうので、sslbumpを入れないといけなくなる(入れたら入れたで、証明書が違うと警告がユーザークライアントに多発するので現実的では無いという判断)。
結局iptablesで、どうしてもはじきたい所をはじくという、苦肉の策になる。
どうにかならないものかなあ・・。


http://roserogue.blogspot.jp/2014/12/1e100netgoogle.html

 を参照のこと。


#squid3
#
#http://squid.robata.org/
#が一番情報載ってる
#
# Recommended minimum configuration:
# ここら辺はデフォルト設定をそのまま
#
#acl cache object localhost
acl manager proto cache_object
acl localhost src 127.0.0.1/32 ::1
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1


#acl ipv4local address ipv6 local unicast address
# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
acl localnet src 10.0.0.0/8     # RFC1918 possible internal network
acl localnet src 172.16.0.0/12  # RFC1918 possible internal network
acl localnet src 192.168.0.0/16 # RFC1918 possible internal network
acl localnet src fc00::/7       # RFC 4193 local private network range
acl localnet src fe80::/10      # RFC 4291 link-local (directly plugged) machines

acl SSL_ports port 443
acl Safe_ports port 80          # http
acl Safe_ports port 21          # ftp
acl Safe_ports port 443         # https
acl Safe_ports port 70          # gopher
acl Safe_ports port 210         # wais
acl Safe_ports port 1025-65535  # unregistered ports
acl Safe_ports port 280         # http-mgmt
acl Safe_ports port 488         # gss-http
acl Safe_ports port 591         # filemaker
acl Safe_ports port 777         # multiling http
acl CONNECT method CONNECT

#
# Recommended minimum Access Permission configuration:
#
# Only allow cachemgr access from localhost
http_access allow manager localhost
http_access deny manager

# Deny requests to certain unsafe ports
http_access deny !Safe_ports

# Deny CONNECT to other than secure SSL ports
http_access deny CONNECT !SSL_ports

# We strongly recommend the following be uncommented to protect innocent
# web applications running on the proxy server who think the only
# one who can access services on "localhost" is a local user
#http_access deny to_localhost

#
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
#

# Example rule allowing access from your local networks.
# Adapt localnet in the ACL section to list your (internal) IP networks
# from where browsing should be allowed

#user user
cache_effective_user squid
cache_effective_group squid



###########################################
#user blacklist
###########################################
#接続させたくないURL、IPアドレス、URLパス
#
#dstdomain ドメイン名を正規表現で表記。ドットから始めればサブドメインも含まれる
#ダブルクォーテーションでくくってファイル参照
#regex
#path
#user blacklist

acl blacklist dstdomain "/etc/squid/blacklist"
acl blacklist_regex url_regex "/etc/squid/blacklist_regex"
acl blackpath urlpath_regex -i "/etc/squid/blackpath"
#blacklist deny list
http_access deny blacklist
http_access deny blacklist_regex
http_access deny blackpath


###########################################
#deny user
###########################################
#接続させたくない特定のユーザー(クライアント)を指定。ローカルIPアドレスで指定する。

acl deny_userlist src "/etc/squid/userlist_deny"
#acl deny_userlist src 192.168.1.255 192.168.1.254
http_access deny deny_userlist


###########################################
#limit user
###########################################
#限定的に接続させたい任意のユーザー(クライアント)を指定。ローカルIPで指定する。

acl limit_userlist src "/etc/squid/userlist_limit"
acl limit_domain_url dstdomain "/etc/squid/url_limit_domain"
acl limit_regex_url url_regex "/etc/squid/url_limit_regex"
http_access allow limit_userlist limit_domain_url
http_access allow limit_userlist limit_regex_url
http_access deny limit_userlist


###########################################
#特定URL等。遅延プール
###########################################
#http://www.itmedia.co.jp/enterprise/articles/0812/01/news024_2.html

#acl peakperiod time 10:00-16:00

#Delay_Pool
delay_pools 3

#-----------pool 1 ----------------
#userlist_delayの中のIPアドレスユーザーを遅延させる
delay_class 1 1 # pool 1 is a class 1 pool
acl delay_userlist src "/etc/squid/userlist_delay"
#
# SPEED
delay_parameters 1 320/320
#
delay_access 1 allow delay_userlist
delay_access 1 deny all


#-----------pool 2 ----------------
#リストに表記されているURLなどへのアクセスを遅延させる
delay_class 2 1 # pool 1 is a class 1 pool

acl dstdelaylist dstdomain "/etc/squid/delaylistdst"
acl regex_delaylist url_regex "/etc/squid/delaylist_regex"
acl pathdelaylist urlpath_regex -i "/etc/squid/delaylistpath"

#1408kbit/s
delay_parameters 2 176000/176000
#896kbit/s
#delay_parameters 2 112000/112000
# 64 Kbit/s
#delay_parameters 2 8000/8000

delay_access 2 allow dstdelaylist
delay_access 2 allow regex_delaylist
delay_access 2 allow pathdelaylist
delay_access 2 deny all


#-----------pool 3 ----------------
#特定のブラウザ使用者を遅延させる
delay_class 3 1 # pool 1 is a class 1 pool
acl delaybrowser browser -i Chrome
acl delaybrowser browser -i Safari
# 128 Kbit/s
delay_parameters 3 16000/16000

delay_access 3 allow delaybrowser
delay_access 3 deny all


#----------delaypool end------------------#

###########################################
#user FTP
###########################################

acl FTP proto FTP
always_direct allow FTP


###########################################
#最終許可
###########################################

http_access allow localnet
http_access allow localhost

# And finally deny all other access to this proxy
http_access deny all

######################################################################################
###########################################


# Squid normally listens to port 3128
#user
#http_port 3246
http_port 3246 transparent
#http_port 3128 transparent
#http_port 3128

# We recommend you to use at least the following line.
hierarchy_stoplist cgi-bin ?

#--------------------------
# Uncomment and adjust the following to add a disk cache directory.
#cache_dir ufs /var/spool/squid 100 16 256
#user

#cache_dir 32GB
cache_dir aufs /var/spool/squid/cache_l 32768 16 256

#maximum_object_size 128MB
maximum_object_size 131072 KB

#cache_mem 1GB(total 3GB or so)
cache_mem 1024 MB
memory_pools_limit 0

# Leave coredumps in the first cache dir
coredump_dir /var/spool/squid
#--------------------------------

# Add any of your own refresh_pattern entries above these.
refresh_pattern ^ftp:           1440    20%     10080
refresh_pattern ^gopher:        1440    0%      1440
refresh_pattern -i (/cgi-bin/|\?) 0     0%      0
#refresh_pattern .              0       20%     4320
##################################
#USER ADD REFRESH PATTERN
##################################
refresh_pattern -i \.(gif|png|jpg|jpeg|ico)$ 10080 80% 43200 override-expire ignore-no-cache ignore-no-store ignore-private
refresh_pattern -i \.(iso|avi|wav|mp3|mp4|mpeg|3gp|swf|flv|x-flv)$ 43200 90% 432000 override-expire ignore-no-cache ignore-no-store ignore-private
refresh_pattern -i \.(deb|rpm|exe|msi)$ 10080 90% 43200 override-expire ignore-no-cache ignore-no-store ignore-private

refresh_pattern -i \.index.(html|htm)$ 0 40% 10080
refresh_pattern -i \.(html|htm|css|js)$ 1440 40% 40320
refresh_pattern . 0 40% 40320
##################################


#user
#LOG
logfile_rotate 14
cache_access_log /var/log/squid/access.log
cache_log /var/log/squid/cache.log
cache_store_log /var/log/squid/store.log
access_log /var/log/squid/access.log

#user
#auth_param basic program
auth_param basic children 10
auth_param basic realm Squid proxy-caching web server
auth_param basic credentialsttl 2 hours
auth_param basic casesensitive off

#user
pipeline_prefetch on

###########################################
#user anonymize
###########################################
icp_port 0
forwarded_for off
client_db off
#user HEADER ANONYMIZING
#header_accessは30系で無くなったらしい
request_header_access X-Forwarded-For deny all
request_header_access Via deny all
request_header_access Cache-Control deny all


###########################################
#SQUID3 HEADER REPLACE###
###########################################

request_header_access From deny all
request_header_access Referer deny all
request_header_access User-Agent deny all
header_replace User-Agent Mozilla/5.5 (Windows NT 55.0; Win64; x64) AppleWebKit/555.55 (KHTML, like Gecko) Chrome/55.0.0005.05 Safari/555.55 Edge/15.0

#user
visible_hostname none

#header_replace Referer google.com

2015年6月12日金曜日

windows8タブレットを使いやすくしたい@ASUS VivoTab 8 M81C(photoshopが快適に動く快感)

 windowsタブレットを入手したので、使いやすくするためのTIPS。

ASUS VivoTab 8 M81Cを手に入れたので、windows8.1のTIPSと、M81Cの使用感、所感。

1.「スタート」に登録されているタイル(ショートカット)は全て破棄してしまえ
windows8が使いにくいと言っている人は、「スタート」が何なのかを勘違いしている(し、マイクロソフトは勘違いさせようと必死だ)。
また、windows7風スタートにするソフトは絶対使わない。これこそ情報弱者の極みだと思う。
スタート画面をデスクトップにする
http://121ware.com/qasearch/1007/app/servlet/relatedqa?QID=015461
もやらない。これは後述の理由。

「スタート」は、「windowsボタンを押せば呼び出せるランチャー」なので、ここに要らないもの、たとえばフード&レシピとか、ヘルスケア&フィットネスとか置いていると使いにくくてしょうが無い。
まずは、
  • デスクトップ
  • PC
  • コントロールパネル
  • 設定
  • ドキュメント
この5つ以外のタイルを削除する。
そして、何時も使うソフトウェア、アプリケーションのタイルを追加する。
追加と削除は
http://121ware.com/qasearch/1007/app/servlet/relatedqa?QID=015456

また、デスクトップタイルのサイズを「大」にする。
デスクトップを見ると安心する病のためと、なんだかんだで一番押すタイルだから。

ポイントは、デスクトップにはショートカットなど必要ない。windowsキーを押せば全て出てくるから、というようにする、ということ。


2.テキストのサイズを大きくする
「コントロールパネル>デスクトップのカスタマイズ>ディスプレイ」の「すべての項目のサイズを変更する」で「中-125%」
これはやっておいた方が目に良い。ただ、多くの情報量を得たい場合は標準が良い。

3.ソフトウェアキーボードでフルキーが使えるようにする
初めから有効にして欲しかったフルキーボードオプション。

PC設定(紫色の歯車)>
「PC設定の変更」>
「PCとデバイス」>
「入力>ハードウェアキーボードに準拠したレイアウトをタッチキーボードオプションとして追加」のオプションをオンに。

これでフルキーボードが使えるようになる。

3.キャプションボタン(最小化ボタン、最大化ボタン、閉じるボタンなど)のサイズを変える
地味に端の方の認識をしてくれず、閉じられないという切ないことが度々あったので、サイズを大きくする。
スタート画面で「regedit」と打つと、レジストリエディタを検索してくれるので、エンターで起動、
「HKEY_CURRENT_USER」-「Control Panel」-「Desktop」-「WindowMetrics」と辿って、中にある
CaptionHeightとCaptionWidthの値を「-330(もしくは-336)」から「-500」に変更する。
一度サインアウトして、サインインすると、押しやすい大きさになっている。
http://mahoro-ba.net/e1724.html

4.bluetooth製品は基本的に信用しない
bluetooth製品によくある遅れての認識や誤動作はザラ。逆に「そんなものだ」と思って使うと幸せになれる。


所感
ベンチマークは色々出てくるので、体感を。

▼photoshopが快適に動作する
かなり意外だったのが、photoshopが快適に動作すること。
CS6の体験版を入れたのだけれども、
レイヤー数300枚超のA1イラスト(勿論2GBを超えるpsbファイル)が普通に開けて、そして編集・加工できる。ストレスはほぼ無い(もたつきも少なく、強いて言えばbluetoothの方が・・)。
逆に言えば、ミドルユーザーならwindows8.1update+Intel Atom Z3745で十分と言うことになる。
勿論、フラッシュメモリによる高速アクセスの恩恵があるのは言うまでも無いけれども、それにしても凄い。 ましてメモリ2GB。
一昔前では考えられなかった。
officeも軽く動作する。
兎に角言うこと無しの使用感。

▲ただ、ポインティングデバイスは欲しい
やはり人間の指には限界があり、細かい作業をする際はどうしても厳しい。bluetoothマウスが選択肢としては適当だけれども、上手く割り切って使うのが良いと思う。

■windows phoneのチームとはやはり別なんだろう
windows phoneの方が扱いやすいと感じる場面がままあった。
キーボード入力、画面の遷移で「phoneだったら」と思うことがしばしば。
またその逆もあるので、windows10に大期待、というところか。

●ノートPCの代わりになるのか
これは半半。
たとえばプログラマだと、bluetoothキーボードに泣かされるだろうけど、日常使いには全く支障が無い。
古いデスクトップでwin7動かしてウェブサーフィンするなら、4ヶ月分の電気代で買えるこいつをお勧めする。

追記
○やっぱりWindowsはWindows
数日使ってみたが、良くも悪くもWindowsだった。
androidのような「コンテンツ消費型」では無い。使い方として、コンテンツを消費するのであれば、androidに分がある(まあ、分かっていたことだけれども)。
全画面UIからの選択的なアプリケーション切替、ウェブコンテンツを消費するためのアプリケーション連携等は、間違いなくandroidに分がある。
但し、そこに少しでも生産性という言葉が入ると、androidでは全く以て不十分になる。
 そこを勘違いして買ってしまうと、一寸残念な感じになるかもしれない。
コンテンツ消費型のUIは、まさにWindows Phone 8.1なので、windows10でどう混ぜ込んでくるのかがとても期待できる所。

2015年6月8日月曜日

Windows Phone 8.1 Update 2にアップデートするには

Windows Phone 8.1 Update 2(GDR2)に、windowsphoneを8.1update2にアップデートするにはどうすればいいのか。

http://www.onetechstop.net/2015/04/11/screenshots-how-to-install-windows-phone-8-1-update-2-on-any-windows-phone-device/

をざっくり翻訳することにする。

1.設定>電話の更新>この電話の更新プログラムが利用可能になったとき通知する、のチェックボックスを外す

2.windows insiderプログラムに参加し、かつWindows Insiderアプリをダウンロードする

3.Windows Insiderを起動。設定する

4.設定>電話の更新でオフにしたチェックボックスをオンにする。更新の確認を押す

5.バージョンの確認をする(8.10.15116.125)
 確認したらダウンロード。

6.Windows Insiderをアンインストールする

7. インストール


3はWindows Insiderのバージョンによって違うらしい。虫眼鏡マークのpreview~を押下して、windows 10 mobileのテクニカルプレビューを選択するというのもある。

6のアンインストールは、バージョン確認してダウンロードを始めれば、途中であろうがアンインストールして良い。というか、他の記事ではアンインストールしろと書いてある。

 いわゆるwin10mobileに対応する機種に適応できるよう。
MADOSMAで是非やってみたいが、残念ながら購入予定無し。誰かやってみて欲しい。

因みにGDRとは、
http://www.sql-master.net/articles/SQL887.html
GDRとはGeneral Distribution Releaseの略
だそうで。