Centos で Gnome

macばかり使っているので、GnomeでもMacの操作にしたい

 

キーボードマッピング

Terminalは

    編集-Preferences-ショートカットで

              コピーする    Super+C

              貼り付ける    Super+V

とすれば変更できる。

 

GnomeDesktopは標準では全く設定できないので、調べまくってxkeysnailをインストールすることに

$ sudo pip3 install xkeysnail

# cd

# vi xkeysnail_config.py 

---

import re
from xkeysnail.transform import *

#define_keymap(re.compile("Firefox|Google-chrome"), {
define_keymap(lambda wm_class: wm_class not in ('Terminator'), {
    K("Super-a"): K("C-a"),
    K("Super-v"): K("C-v"),
    K("Super-x"): K("C-x"),
    K("Super-c"): K("C-c"),
})

---

# xhost +SI:localuser:root ; sudo /usr/local/bin/xkeysnail xkeysnail_config.py

自動起動は調査中)

 

キーリピートも設定してもぜんぜん速くならないので

# gsettings set org.gnome.desktop.peripherals.keyboard repeat-interval 25
# gsettings set org.gnome.desktop.peripherals.keyboard delay 250

としている

 

英数/かな変換は設定のKeyboardから「前の入力ソースへ切り換える」を

Super + Hangul Hanja
にしている。英数キーかなキーで切り替えたいがいまのところ上手くいかない

一先ず

 

 

 

とはいえ、macOSはやっぱりいいosだなって

 

         

             

             

re:dash & docker

[re:dash docker]でぐぐれば先人がやってるのをいろいろみれるが、
世の中移り変わりが早いので、過去情報になってしまっている。
dockerをcloneしても、もうファイルが無かったり・・
(setup/docker/create_database.shとかとかとか)
(そもそもsetup/dockerすらない)
それでも試行錯誤したがどうも無理っぽくて
https://github.com/getredash/redash/tree/release_v0.11.1
からcloneすれば良さげなのを次の日気づくw

あと、CentOS7じゃないとDockerの新しいのは使えない
Dockerはインストール済みという前提で

# wget https://github.com/getredash/redash/archive/release_v0.11.1.zip
# unzip release_v0.11.1.zip
# mv redash-release_v0.11.1 redash
# cp docker-compose-example.yml docker-compose.yml
# cd redash
# service docker start

# ./setup/docker/create_database.sh

# docker-compose up -d
Starting redash_redis_1
Starting redash_postgres_1
Starting redash_redash_1
Starting redash_redash-nginx_1


で、
http://Centos7serverIP

ID admin
PASS admin

でいけると思います。

easy_install -U setuptoolsでRuntimeError: maximum recursion depth exceeded while calling a Python objectになった

easy_install -U setuptools
したら

# easy_install -U setuptools
Searching for setuptools
Reading https://pypi.python.org/simple/setuptools/
Best match: setuptools 34.2.0
Downloading https://pypi.python.org/packages/16/ef/44baff6e9b1f8125d759d026757677a8a82d14d9974726f13726dee9adfb/setuptools-34.2.0.zip#md5=41b630da4ea6cfa5894d9eb3142922be
Processing setuptools-34.2.0.zip
Writing /tmp/easy_install-ckKuPn/setuptools-34.2.0/setup.cfg
Running setuptools-34.2.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-ckKuPn/setuptools-34.2.0/egg-dist-tmp-fwNrcY
Traceback (most recent call last):
  File "/usr/bin/easy_install", line 9, in 
    load_entry_point('setuptools==0.9.8', 'console_scripts', 'easy_install')()
  File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1992, in main
    with_ei_usage(lambda:
  File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1979, in with_ei_usage
    return f()

省略

  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 814, in scan
    for dist in find_distributions(item):
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 1958, in find_distributions
    importer = get_importer(path_item)
  File "/usr/lib64/python2.7/pkgutil.py", line 394, in get_importer
    importer = ImpImporter(path_item)
RuntimeError: maximum recursion depth exceeded while calling a Python object

となった・・

pip install --upgrade distribute

を実行したらなんとかなった


python難しい・・

docker: Network timed out...

Docker for macで初めてDockerに触ってみたが

$ docker run hello-world

すると

Unable to find image 'hello-world:latest' locally
Pulling repository docker.io/library/hello-world
docker: Network timed out while trying to connect to https://index.docker.io/v1/repositories/library/hello-world/images. You may want to check your internet connection or if you are behind a proxy..
See 'docker run --help'.

てな具合で、先に進めない。

ぐぐる

$ docker-machine restart default
$ eval $(docker-machine env default)

https://blogdoparanga.wordpress.com/2015/12/27/docker-network-timed-out-while-trying-to-connect-to-httpsindex-docker-iov1repositoriesdockerwhalesayimages-you-may-want-to-check-your-internet-connection-or-if-you-are-behind-a-proxy/
するといいと出て来るが

Host does not exist: "default"

となる。

そもそもdefaultと言うものがない。

defaultについてさらにぐぐる

$ docker-machine create -d virtualbox default

という記述を見つける
(自分のMacにはvirtualboxはすでにInstall済み。だが、Installしているvirtualboxのことなのだろうか?)

$ docker-machine create -d virtualbox default

Creating CA: /Users/abcdefg/.docker/machine/certs/ca.pem
Creating client certificate: /Users/abcdefg/.docker/machine/certs/cert.pem
Running pre-create checks...
(default) Image cache directory does not exist, creating it at /Users/abcdefg/.docker/machine/cache...
(default) No default Boot2Docker ISO found locally, downloading the latest release...
(default) Latest release for github.com/boot2docker/boot2docker is v1.12.6
(default) Downloading /Users/abcdefg/.docker/machine/cache/boot2docker.iso from https://github.com/boot2docker/boot2docker/releases/download/v1.12.6/boot2docker.iso...
(default) 0%....10%....20%....30%....40%....50%....60%....70%....80%....90%....100%
Creating machine...
(default) Copying /Users/abcdefg/.docker/machine/cache/boot2docker.iso to /Users/abcdefg/.docker/machine/machines/default/boot2docker.iso...
(default) Creating VirtualBox VM...
(default) Creating SSH key...
(default) Starting the VM...
(default) Check network to re-create if needed...
(default) Found a new host-only adapter: "vboxnet0"
(default) Waiting for an IP...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Detecting the provisioner...
Provisioning with boot2docker...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
Checking connection to Docker...
Docker is up and running!
To see how to connect your Docker Client to the Docker Engine running on this virtual machine, run: docker-machine env default
$ docker-machine ls
NAME      ACTIVE   DRIVER       STATE     URL                         SWARM   DOCKER    ERRORS
default   -        virtualbox   Running   tcp://192.168.99.100:2376           v1.12.6   

なんか出来てるし、Virtualboxにもなんか出来てる。

これがDockerコンテナを動かすホストなのかな?

$ docker-machine restart default
Restarting "default"...
(default) Check network to re-create if needed...
(default) Waiting for an IP...
Waiting for SSH to be available...
Detecting the provisioner...
Restarted machines may have new IP addresses. You may need to re-run the `docker-machine env` command.

ぉぉぉーすすんだ!

$ eval $(docker-machine env default)
$ docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
78445dd45222: Pull complete 
Digest: sha256:c5515758d4c5e1e838e9cd307f6c6a0d620b5e07e6f927b07d05f6d12a1ac8d7
Status: Downloaded newer image for hello-world:latest

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://cloud.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/engine/userguide/

ぉー!動いたらしい!!

https://docs.docker.com/docker-for-mac/
に戻って

$ docker run -d -p 80:80 --name webserver nginx
Unable to find image 'nginx:latest' locally
latest: Pulling from library/nginx
75a822cd7888: Pull complete 
0aefb9dc4a57: Pull complete 
046e44ee6057: Pull complete 
Digest: sha256:fab482910aae9630c93bd24fc6fcecb9f9f792c24a8974f5e46d8ad625ac2357
Status: Downloaded newer image for nginx:latest
ed83898c498d41796a90fe2368e0181d22267562b95e684dc6ff9c88d5de944c

入ったらしいがどうすればいいんだろう?
サンプルではhttp://localhost/にアクセスしろって言ってるけど、だめだった

$ docker-machine ls
NAME      ACTIVE   DRIVER       STATE     URL                         SWARM   DOCKER    ERRORS
default   -        virtualbox   Running   tcp://192.168.99.100:2376           v1.12.6   

このIPかな?ってことで
http://192.168.99.100
にアクセスしたら

やったー!

Outlook 2016 for macでカレンダーに祝日を設定するたったひとつの方法

MSのMacに対する中途半端さは頭来るんですが
とにかくWindows版のサブセットのサブセットでしか無い「Outlook 2016 for mac」には
休日の表示をする方法がない!
本当にない!!
ヘルプで祝日や休日を検索しても出てこない!!!
たぶんMSもやり方を知らない





もしサブスクリプション版をつかっているならoffice365が有るはずなので
ブラウザからOffice365のoutlook365にアクセスする
上部に「カレンダーの追加」ってのがあるので

クリックすると、念願の「休日の予定表」がしれっとでてくるw
ここから「日本」を選べば追加されるので
Macoutlookにも休日が追加されているはず。

MS製品はなんか無理・・