ncduでUbuntuのフォルダの容量を可視化するのが便利する義理
Nov 19, 2019
1 2 |
sudo apt install ncdu ncdu ./ |
Twitter: 0 | Facebook: 0 | Google Plus: 0 | Hatena: 0 | Pocket: 0 | Total: 0 | Feedly: 0
1 2 |
sudo apt install ncdu ncdu ./ |
Twitter: 0 | Facebook: 0 | Google Plus: 0 | Hatena: 0 | Pocket: 0 | Total: 0 | Feedly: 0
先日バックアップも何もない環境で、ディスク・スペースが100%になり急遽パーミッションを追加してサイトのフォルダの移設が必要なったのですが、サイトのいたるところにシンボリックリンがはられていて、シンボリックリンク(ハードも含めて)の削除がどのようになるか、非常に怖かったのメモしておきます。
シンボリックリンクを削除したらリンク元も消えるのか気になったのですが、unlinkで削除すれば参照元は消えることはないようです。
ですが、リンクしていたファイルは消えるので、必要な場合はcpなどでファイルを持ってきておきます。
1 2 3 4 5 6 7 |
$ cd /home/hoge/ $ ls -al setting.php -> /var/www/test/setting.php $ unlink ./setting.php $ ls -al .. $ cp /var/www/test/setting.php ./ |
Twitter:
Warning: Undefined array key "Twitter" in /home/sazaeau/mizoshiri.com/public_html/blog.mizoshiri.com/wp-content/plugins/sns-count-cache/sns-count-cache.php on line 2897
0 | Facebook: 0 | Google Plus:
Warning: Undefined array key "Google+" in /home/sazaeau/mizoshiri.com/public_html/blog.mizoshiri.com/wp-content/plugins/sns-count-cache/sns-count-cache.php on line 2897
0 | Hatena: 0 | Pocket: 1 | Total: 1 | Feedly: 0
Ruby 2.2.1
Rails 4.2.1
Ubuntu 14.04
でcapybara-webkitをインストールしようとしたら下記のエラーがでました。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
qmake: could not find a Qt installation of '' *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options. Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/home/vagrant/.rbenv/versions/2.2.1/bin/$(RUBY_BASE_NAME) --with-gl-dir --without-gl-dir --with-gl-include --without-gl-include=${gl-dir}/include --with-gl-lib --without-gl-lib=${gl-dir}/lib --with-zlib-dir --without-zlib-dir --with-zlib-include --without-zlib-include=${zlib-dir}/include --with-zlib-lib --without-zlib-lib=${zlib-dir}/lib Command 'qmake ' failed extconf failed, exit code 1 |
エラー通りqmakeがないので、入れてあげて解決です。
1 |
sudo apt-get install qt5-default libqt5webkit5-dev |
Twitter:
Warning: Undefined array key "Twitter" in /home/sazaeau/mizoshiri.com/public_html/blog.mizoshiri.com/wp-content/plugins/sns-count-cache/sns-count-cache.php on line 2897
0 | Facebook: 0 | Google Plus:
Warning: Undefined array key "Google+" in /home/sazaeau/mizoshiri.com/public_html/blog.mizoshiri.com/wp-content/plugins/sns-count-cache/sns-count-cache.php on line 2897
0 | Hatena: 0 | Pocket: 0 | Total: 0 | Feedly: 0
最新のプロジェクトをVagrant Ruby 2.2.1 & Ruby on Rail 4.2.1の最新安定バージョンで開発を開始いたのですが、Vagrantの内のRails Appにhttpでアクセスがうまくできなかったのでその際のメモです。
VagrantのUbuntuにrbenvでRubyをインストールしております。
各種Appには、/etc/hostsに独自ドメインを指定してアクセスしております。
1 2 |
$ sudo vi /etc/hosts 192.168.33.10 dev.domain |
アクセスは下記のようなドメインでやっております。
http://dev.domain:3000
いきなり解決方法です。
1 2 3 4 5 6 7 8 9 |
$ rails s -b 0.0.0.0 => Booting Puma => Rails 4.2.1 application starting in development on http://0.0.0.0:3000 => Run `rails server -h` for more startup options => Ctrl-C to shutdown server Puma 2.11.1 starting... * Min threads: 0, max threads: 16 * Environment: development * Listening on tcp://0.0.0.0:3000 |
問題なのは、Rails4.2のbindsが0.0.0.0が127.0.0.1になっているので、-bで指定して立ち上げることが解消できます。
Twitter:
Warning: Undefined array key "Twitter" in /home/sazaeau/mizoshiri.com/public_html/blog.mizoshiri.com/wp-content/plugins/sns-count-cache/sns-count-cache.php on line 2897
0 | Facebook: 0 | Google Plus:
Warning: Undefined array key "Google+" in /home/sazaeau/mizoshiri.com/public_html/blog.mizoshiri.com/wp-content/plugins/sns-count-cache/sns-count-cache.php on line 2897
0 | Hatena: 0 | Pocket: 0 | Total: 0 | Feedly: 0
purgeを入れて、ファイルごと消して、再インストールで解決
1 2 |
sudo apt-get --purge remove apache2 sudo apt-get install apache2 |
Twitter: 0 | Facebook: 0 | Google Plus: 0 | Hatena: 0 | Pocket: 0 | Total: 0 | Feedly: 0
VagrantでUbuntu14.04
rbenvを使ってRuby 1.9.3-p551
gem pg
で下記のエラーがでました。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. /home/vagrant/.rbenv/versions/1.9.3-p551/bin/ruby extconf.rb checking for pg_config... yes Using config values from /usr/bin/pg_config You need to install postgresql-server-dev-X.Y for building a server-side extension or libpq-dev for building a client-side application. You need to install postgresql-server-dev-X.Y for building a server-side extension or libpq-dev for building a client-side application. checking for libpq-fe.h... *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options. Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/home/vagrant/.rbenv/versions/1.9.3-p551/bin/ruby --with-pg --without-pg --with-pg-dir --without-pg-dir --with-pg-include --without-pg-include=${pg-dir}/include --with-pg-lib --without-pg-lib=${pg-dir}/lib --with-pg-config --without-pg-config --with-pg_config --without-pg_config /home/vagrant/.rbenv/versions/1.9.3-p551/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError) You have to install development tools first. from /home/vagrant/.rbenv/versions/1.9.3-p551/lib/ruby/1.9.1/mkmf.rb:506:in `try_cpp' from /home/vagrant/.rbenv/versions/1.9.3-p551/lib/ruby/1.9.1/mkmf.rb:983:in `block in find_header' from /home/vagrant/.rbenv/versions/1.9.3-p551/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for' from /home/vagrant/.rbenv/versions/1.9.3-p551/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postpone' from /home/vagrant/.rbenv/versions/1.9.3-p551/lib/ruby/1.9.1/mkmf.rb:254:in `open' from /home/vagrant/.rbenv/versions/1.9.3-p551/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone' from /home/vagrant/.rbenv/versions/1.9.3-p551/lib/ruby/1.9.1/mkmf.rb:254:in `open' from /home/vagrant/.rbenv/versions/1.9.3-p551/lib/ruby/1.9.1/mkmf.rb:280:in `postpone' from /home/vagrant/.rbenv/versions/1.9.3-p551/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for' from /home/vagrant/.rbenv/versions/1.9.3-p551/lib/ruby/1.9.1/mkmf.rb:982:in `find_header' from extconf.rb:40:in `<main>' Gem files will remain installed in /var/www/html/hoge/vendor/bundle/ruby/1.9.1/gems/pg-0.13.2 for inspection. Results logged to /var/www/html/hoge/vendor/bundle/ruby/1.9.1/gems/pg-0.13.2/ext/gem_make.out An error occurred while installing pg (0.13.2), and Bundler cannot continue. Make sure that `gem install pg -v '0.13.2'` succeeds before bundling. </main> |
libpq-dev(UbuntuのPostgres系パッケージ)が入っていないが原因ですよねー
1 |
sudo apt-get install libpq-dev |
Twitter:
Warning: Undefined array key "Twitter" in /home/sazaeau/mizoshiri.com/public_html/blog.mizoshiri.com/wp-content/plugins/sns-count-cache/sns-count-cache.php on line 2897
0 | Facebook: 0 | Google Plus:
Warning: Undefined array key "Google+" in /home/sazaeau/mizoshiri.com/public_html/blog.mizoshiri.com/wp-content/plugins/sns-count-cache/sns-count-cache.php on line 2897
0 | Hatena: 0 | Pocket: 0 | Total: 0 | Feedly: 0
Rails3.1の古い案件の修正が入ったので、環境を構築していたのですが、Nokogiriが1.5.2を入れないと動かない構成でして、苦労しましたのでメモしておきます。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
$bundle install Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. /usr/bin/ruby1.9.1 extconf.rb extconf.rb:10: Use RbConfig instead of obsolete and deprecated Config. checking for libxml/parser.h... yes checking for libxslt/xslt.h... yes checking for libexslt/exslt.h... yes checking for iconv_open() in iconv.h... yes checking for xmlParseDoc() in -lxml2... yes checking for xsltParseStylesheetDoc() in -lxslt... yes checking for exsltFuncRegister() in -lexslt... yes checking for xmlHasFeature()... yes checking for xmlFirstElementChild()... yes checking for xmlRelaxNGSetParserStructuredErrors()... yes checking for xmlRelaxNGSetParserStructuredErrors()... yes checking for xmlRelaxNGSetValidStructuredErrors()... yes checking for xmlSchemaSetValidStructuredErrors()... yes checking for xmlSchemaSetParserStructuredErrors()... yes creating Makefile make compiling xml_io.c xml_io.c: In function ‘io_read_callback’: xml_io.c:28:3: warning: conversion to ‘int’ from ‘size_t’ may alter its value [-Wconversion] compiling xml_reader.c compiling xml_element_content.c compiling xml_entity_decl.c compiling xml_sax_push_parser.c compiling xml_node_set.c xml_node_set.c: In function ‘dealloc_namespace’: xml_node_set.c:9:13: warning: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual] xml_node_set.c:11:13: warning: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual] compiling xml_processing_instruction.c compiling xml_comment.c compiling xml_document.c xml_document.c: In function ‘set_encoding’: xml_document.c:159:12: warning: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual] xml_document.c: In function ‘canonicalize’: xml_document.c:505:15: warning: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual] compiling xml_sax_parser.c compiling xml_schema.c compiling xml_attribute_decl.c compiling html_sax_parser_context.c compiling xml_dtd.c compiling xml_encoding_handler.c compiling xml_element_decl.c compiling xml_entity_reference.c compiling html_entity_lookup.c compiling html_document.c compiling xml_syntax_error.c compiling html_element_description.c html_element_description.c: In function ‘get_description’: html_element_description.c:249:10: warning: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual] compiling xml_document_fragment.c compiling nokogiri.c compiling xml_node.c compiling xml_cdata.c compiling xml_xpath_context.c xml_xpath_context.c: In function ‘xpath_generic_exception_handler’: xml_xpath_context.c:189:3: error: format not a string literal and no format arguments [-Werror=format-security] cc1: some warnings being treated as errors make: *** [xml_xpath_context.o] Error 1 Gem files will remain installed in /home/vagrant/.bundler/tmp/3761/gems/nokogiri-1.5.2 for inspection. Results logged to /home/vagrant/.bundler/tmp/3761/gems/nokogiri-1.5.2/ext/nokogiri/gem_make.out An error occurred while installing nokogiri (1.5.2), and Bundler cannot continue. Make sure that `gem install nokogiri -v '1.5.2'` succeeds before bundling. |
NokogiriとUbuntuで下記のもので入るようになるとはあるのですが、1.5.2はこれでもうまく行かず。。
1 |
sudo apt-get install libxml2-dev libxslt1-dev |
下記のオプションをつけてなんとかインストールできました。
1 |
sudo gem install nokogiri -v '1.5.2' -- --with-cflags="-O2 -pipe -march=native -w" |
Twitter:
Warning: Undefined array key "Twitter" in /home/sazaeau/mizoshiri.com/public_html/blog.mizoshiri.com/wp-content/plugins/sns-count-cache/sns-count-cache.php on line 2897
0 | Facebook: 0 | Google Plus:
Warning: Undefined array key "Google+" in /home/sazaeau/mizoshiri.com/public_html/blog.mizoshiri.com/wp-content/plugins/sns-count-cache/sns-count-cache.php on line 2897
0 | Hatena: 0 | Pocket: 1 | Total: 1 | Feedly: 0
VagrantにPostgresをChef-Soloで入れてから、下記のエラーがでるようになりました。
recipeの書き方に問題があったようです。。。。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
$ bundle install rails Sorry, command-not-found has crashed! Please file a bug report at: https://bugs.launchpad.net/command-not-found/+filebug Please include the following information with the report: command-not-found version: 0.3 Python version: 3.3.1 final 0 Distributor ID: Ubuntu Description: Ubuntu 13.04 Release: 13.04 Codename: raring Exception information: unsupported locale setting Traceback (most recent call last): File "/usr/lib/python3/dist-packages/CommandNotFound/util.py", line 24, in crash_guard callback() File "/usr/lib/command-not-found", line 69, in main enable_i18n() File "/usr/lib/command-not-found", line 40, in enable_i18n locale.setlocale(locale.LC_ALL, '') File "/usr/lib/python3.3/locale.py", line 541, in setlocale return _setlocale(category, locale) locale.Error: unsupported locale setting |
言語設定に問題があるようなので、下記の内容を設定して解決しました。
1 2 3 4 5 |
export LANGUAGE=en_US.UTF-8 export LANG=en_US.UTF-8 export LC_ALL=en_US.UTF-8 locale-gen en_US.UTF-8 sudo dpkg-reconfigure locales |
Twitter:
Warning: Undefined array key "Twitter" in /home/sazaeau/mizoshiri.com/public_html/blog.mizoshiri.com/wp-content/plugins/sns-count-cache/sns-count-cache.php on line 2897
0 | Facebook: 0 | Google Plus:
Warning: Undefined array key "Google+" in /home/sazaeau/mizoshiri.com/public_html/blog.mizoshiri.com/wp-content/plugins/sns-count-cache/sns-count-cache.php on line 2897
0 | Hatena: 0 | Pocket: 0 | Total: 0 | Feedly: 0
せっかく新しい案件が来たので、Ruby2 & Rails4で開発しているんですが、debuggerでReadlineのエラーがでたので、メモしておきます。
1 2 |
$ rails s --debugger /home/vagrant/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/debugger-1.6.1/lib/ruby-debug/interface.rb:67:in `block (2 levels) in initialize': uninitialized constant Debugger::LocalInterface::Readline (NameError) |
エラーを読みかぎりReadlineがないらしいので、Readlineをインストール
1 2 3 4 |
$ sudo apt-get install libreadline6 libreadline6-dev $ CONFIGURE_OPTS="--with-readline-dir=/usr/include/readline" rbenv install 2.0.0-p247 $ rbenv global 2.0.0-p247 $ rbenv rehash |
Twitter:
Warning: Undefined array key "Twitter" in /home/sazaeau/mizoshiri.com/public_html/blog.mizoshiri.com/wp-content/plugins/sns-count-cache/sns-count-cache.php on line 2897
0 | Facebook: 0 | Google Plus:
Warning: Undefined array key "Google+" in /home/sazaeau/mizoshiri.com/public_html/blog.mizoshiri.com/wp-content/plugins/sns-count-cache/sns-count-cache.php on line 2897
0 | Hatena: 0 | Pocket: 0 | Total: 0 | Feedly: 0
VagrantのUbuntuにPostgreSQLをインストールして、立ち上げようとすると下記のようなエラーがでたので、メモしておきます。
1 2 3 4 5 6 7 8 9 10 11 |
$ apt-get update $ apt-get install postgresql $ psql --version psql (PostgreSQL) 9.1.9 $ service postgresql start * Restarting PostgreSQL 9.1 database server * The PostgreSQL server failed to start. Please check the log output: 2013-08-05 22:19:14 UTC LOG: could not bind IPv4 socket: Cannot assign requested address 2013-08-05 22:19:14 UTC HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry. 2013-08-05 22:19:14 UTC WARNING: could not create listen socket for "localhost" 2013-08-05 22:19:14 UTC FATAL: could not create any TCP/IP sockets |
コネクション指定の問題なので、下記のように変更しました。
1 2 3 4 |
$ vi /etc/postgresql/9.1/main/postgresql.conf #listen_addresses = 'localhost'  ↓ listen_addresses = '*' |
Twitter:
Warning: Undefined array key "Twitter" in /home/sazaeau/mizoshiri.com/public_html/blog.mizoshiri.com/wp-content/plugins/sns-count-cache/sns-count-cache.php on line 2897
0 | Facebook: 0 | Google Plus:
Warning: Undefined array key "Google+" in /home/sazaeau/mizoshiri.com/public_html/blog.mizoshiri.com/wp-content/plugins/sns-count-cache/sns-count-cache.php on line 2897
0 | Hatena: 0 | Pocket: 0 | Total: 0 | Feedly: 0
Sorry. No data so far.