wget...
2014/05/26
linux passwd 認証トークンエラー
現在のLinuxでは、パスワードは暗号化されて専用のファイル(/etc/shadow)に保存される。このファイルが書き換えられて/etc/passwdファイルと整合性が取れなくなってしまうと、passwdコマンドでパスワードを変更しようとしてもエラーになってしまう。そのようなときは、pwconvコマンドで両者の整合性を取れば、passwdコマンドが使えるようになる。# passwd sato ←satoのパスワードを変更Changing password for user sato.passwd: Authentication token manipulation error ←エラーが出る# pwconv ←パスワードファイルの整合性を取る# passwd sato ←satoのパスワードを変更Changing password for user sato.New password: ←パスワードの入力プロンプトが表示...
2014/05/23
window task schedule jar
★Q:
I have an executable jar file and am trying to create a scheduled task using windows 7 Task Scheduler.
It runs fine as a .jar file when I double click it. But when I tell task scheduler to run it, it comes up with nothing.
★A:
"C:\Program Files\Java\jre7\bin\javaw.exe"
-jar C:\Users\admin\Desktop\TestTask.jar
==>直接jar指定など。。javaで実行などうまくいかなかった...
java javaw
the javaw command is identical to java,
except that javaw has no associated console window.
Use javaw when you do not want a command prompt window to be displayed.
The javaw launcher displays a window with error information if it fails.
==>console window??親がない、自由な子供と見なう。
親の任務は起動されること。起動終わったら親が去る。
子供もなくなる。
そのときは、javaw!親が要ら...
2014/05/19
Linux Command netrc
・This file contains configuration and autologin information for the File Transfer Protocol client ftp( The .netrc file contains login and initialization information used by the auto-login process. It resides in the user's home directory. The following tokens are recognized; they may be separated by spaces, tabs, or new-lines:machine name Identify a remote machine name The auto-login process searches the .netrc file for a machine token that matches the remote machine specified on the ftp command line or as an open command...
openssl update
cd /usr/local/src/
# wget https://www.openssl.org/source/openssl-1.0.1g.tar.gz
# tar -xzf openssl-1.0.1g.tar.gz
# cd ./openssl-1.0.1g
# ./config --prefix=/usr --openssldir=/etc/ssl --libdir=lib shared zlib-dynamic
# make
# make install
------------------------------------------------------------------------------
まだ1.0.1eのままですが、適応されたバージョンのchangelogを確認すると
Changes in packages about to be updated:
ChangeLog for: openssl-1.0.1e-16.el6_5.7.x86_64, openssl-devel-1.0.1e-16.el6_5.7.x86_64
* Mon Apr 7 21:00:00 2014 Tom?? Mr?z 1.0.1e-16.7
-...
mysql_secure_installation 個別
・mysql_secure_installation は UNIX ドメインソケットを設定できないため、個別の MySQL に対して mysql_secure_installation を実行することができません。解決策としては、ln -s /var/lib/mysql/mysql-db1.sock /var/lib/mysql.sock/usr/bin/mysql_secure_installationrm -f /var/lib/mysql/mysql.sockリンクを貼って、個別に...
2014/05/19
node.js install
■node.jsをインストール
・リポジトリ追加(64bit)
yum repolist all
rpm -ivh http://ftp.riken.jp/Linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
・yum install nodejs npm --enablerepo=epel
・Node向けパッケージ管理ツールnpm
■ Sailsをインストールする
npm install -g sails
sails new simpleChat --linker
sails lift
★★linux Another app is currently holding the yum lock; waiting for it to exit...
==>rm -f /var/run/yum.pid
サーバサイドJavaScriptには、「CommonJS」と呼ばれる標準化が策定されています。・Node.jsは、このCommonJSに則って開発されています。・Node.jsとは、サーバサイドJavaScriptの1つですが、「シングルスレッドベースの非同期処理環境」という特徴を持っています。・Node.jsは、あくまでサーバー側のJSのContextであり、JSはここで実行できる!経験上常に使うことをモジュールにされ、libraryになった。★non-blocking...
2014/05/19
html dt dd dl
<dl><dt>ジョン・レノン</dt><dd>1940年10月9日リヴァプール生まれ。</dd><dt>ポール・マッカートニー</dt><dd>1942年6月18日リヴァプール生まれ。</dd></dl><dl compact="compact"><dt>ジョン</dt><dd>1940年10月9日リヴァプール生まれ。</dd><dt>ポール</dt><dd>1942年6月18日リヴァプール生まれ。</dd></dl>...
2014/05/19
play framework template
・testProject/app/models/Products.java
・testProject/app/views/productList.scala.html
・testProject/app/controllers/Products.java
・マッピングファイル:
testProject/conf/routes
#products
GET /products/ controllers.Products.list()
===>MVCだね。。
・testProject/app/controllers/Products.java
import views.html.products.list;
★==>templateのViewをimporする.targetのところでコンバインしてくれた。。
testProject\target\scala-2.10\classes\views\html
public class Products extends Controller {
public static Result list() {
★==>モデルのメリットを呼び出す
Set<Product> products = Product.findAll();
return...
2014/05/19
play framework directory
★target directory==>the target directory. There’sonly one thing you have to know about the target directory: you should ignore it.The target directory is the build process’ working directory. This is where yourcompiled classes are stored, among other things. Just be sure to never commit it inyour versioning system.★The conf directory is where you configure the application.application.conf=>This is where you’ll configure things like logging, databaseconnections, which port the server runs on, and more.routes ? mappings from HTTP URLs to application...
bash-completion
bash-completion は、次のコマンドの入力補完を行えるようにするためのソフトウェアです。次のコマンドが対象となってい...
2014/05/19
hsperfdata
JDK1.4.2以降では、Javaプロセス動作時(Javaアプリケーション動作時)に、Java VMはシステムの一時作業領域(注)に「hsperfdata_ユーザ名」というフォルダ(またはディレクトリ)と、その配下に数字名の一時ファイルを作成します。これは、Java VM動作中に内部的に使用するファイルで、Java VMの動作中以外は不要となりますので、資産として、バックアップ対象とする必要はありま...
mysql データベース情報
show databases;SHOW CREATE DATABASE db_name;SELECT * FROM INFORMATION_SCHEMA.SCHEMA...
linux alternatives
・設定 sudo alternatives --config java ・選択肢を追加する alternatives --install /usr/bin/java java /opt/jdk1.6.0_17/bin/java...
Vagrant 試し
★vagrant box add chef/centos-6.5 (url)==>This will download the box named "chef/centos-6.5" from Vagrant Cloud, a place where you can find and host boxes. While it is easiest to download boxes from Vagrant Cloud you can also add boxes from a local file, custom URL, etc.★vagrant proxyWIndows7 のシステム環境変数 http_proxy に proxy_host:proxy_port のフォーマットで設定すればよいようです。https_proxy proxy_host:proxy_portvagrant init vagrant up★仮想マシンに接続するvagrant sshvagrant statusvagrant haltvagrant destory {name}★ターミナルで接続する方法例えばTeraTermとかで接続したいとき。vagrant initした際に作成されたVagrantfileのconfig.vm.networkを下記のように設定。(コメントアウトされてるのでそれを有効にすればよい。)config.vm.network...
ansible parallelism pull
★-f==>using a parallelism level of 10ansible-playbook playbook.yml -f 10★Ansible-Pull==>checkout a repo of configuration instructions from git, and then run ansible-playbook against that content.・it allows you to automatically deploy the latest code in your repository, even if the servers are different・I find the fact that you don’t have to run a deploy step, other than just committing, completely magical.==>これはいい...
linux make install uninstall
★install% wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p374.tar.gz% tar xzf ruby-1.9.3-p374.tar.gz=>適当な場所でアーカイブを展開する % cd ruby-1.9.3-p374% ./configure=>configure スクリプトがある場合は[./configure --help]=>/usr/local にインストールするなら --prefix=/usr/local、ホームディレクトリなら --prefix=$HOME という感じでオプションをつける。 ==>Makefileが自動生成される。 % make==>これはビルドである!% sudo make install==>これはインストール★uninstallconfigureの中にuninstallがあれば、==>make uninstall でOK-prefix や --enable-layout オプションを指定していないのであれば、デフォルトで /usr/local/apache または /usr/local/apache2 にインストールされるので、そのディレクトリご...
chef install
chef-soloでstandalone型の物を試す:
・yum install ruby ruby-devel rubygems make gcc
・sudo curl -L https://www.opscode.com/chef/install.sh | sudo bash
mkdir -p chef-repo/cookbooks
cd chef-repo/cookbooks
knife cookbook create setup-user -o .
-o .==>output を今のところ...
Jasper report Font not found exception
★reportでやる場合If the fonts you used are not yet installed (they probably aren't), you'll need to install them. Click the "Install Font" button. A wizard will pop up, asking you the font name and the location of the ttf files. Just direct the application to the location of the ttf files (for windows systems this is generally in the windows\fonts folder). Make sure to check the "Embed this font in PDF" checkbox on the second page! All other settings can be left at their defaults. Once all the fonts are installed, you select all the fonts you used in...
2014/05/19
127.0.0.1 localhost Ip
localhost
不联网
不使用网卡,不受防火墙和网卡限制
本机访问
127.0.0.1
不联网
网卡传输,受防火墙和网卡限制
本机访问
本机IP
联网
网卡传输 ,受防火墙和网卡限制
本机或外部访问
...
2014/05/16
2014/05/16
window task scheduler sleep wakeup

★sleep
Rundll32.exe Powrprof.dll,SetSuspendState Sl...
2014/05/14
Use Ansible without SSH
Yes, use "-c loca...
linux ansible install err No such file or directory
sudo yum install ansible==>ansible を実行して、エラーになる。。 File "/usr/lib64/python2.6/subprocess.py", line 642, in __init__ errread, errwrite) File "/usr/lib64/python2.6/subprocess.py", line 1234, in _execute_child raise child_exceptionOSError: [Errno 2] No such file or directory=====>Sorry for the confusion, I found this duplicate thread.Indeed, openssh-clients was missing. Now it looks much better.Thanks for pointing me to the right direction!===>openssh-clients...
2014/05/14
wget プロキシ経由
etc/wgetrc に以下の内容を追記する。デフォルトではコメントアウトされて無効になっている。/etc/wgetrchttp_proxy = http://1.1.1.1:port/これで、wget を実行するとプロキシ経由になっている。さらに https をプロキシ経由にする場合は次の通り。https_proxy = http://1.1.1.1:port/上の設定をして、逆にプロキシを経由したくない場合には、wget コマンド実行時に次のように --no-proxy オプションを指定する。# wget --no-proxy https://www.verisign.co.jp/index.htmlちなみに、https でファイルを取得する時に証明書のエラーで取得できない場合がある。その場合は次の通りにすれば証明書のエラーを無視してファイルを取得できる。# wget --no-check-certificate https://www.verisign.co.jp/index.h...
linux nslookup dig インストール
DNSの設定を確認するnslookupやdigは、bind-utilsパッケージに含まれます。bind-utilsパッケージがインストールしましょう。# bind-utilsパッケージのインストールyum -y install bind-utils これで、nslookupコマンドとdigコマンドが使用できます。# nslookupnslookup ドメイン名# digdig ドメ...
2014/05/13
Python pip インストール エラー
※CentOS6.5★Python Package Index(pip)とはPython Package Index(以下、pip)とは、Pythonにおけるパッケージ管理システムで、rubyのgemやperlのcpanみたいなものです。pipは同様のパッケージ管理システムである、『setuptools』の"easy_install"を置き換えます。pipをインストールするには、まずはsetuptoolsをインストールする必要があります。 ★yumインストールでエラーになった!Searching for pipReading http://pypi.python.org/simple/pip/Download error: [Errno -2] Name or service not known -- Some packages may not be found!・setuptoolsを確認する yum info python-setuptools ==>パッケージの情報を確認する・ setuptoolsを再インストールする sudo yum -y remove python-setuptoolsそして、最新の setuptools を自分で取ってきてインストールする。...
linux rpm
★RPMとは、
・RedHat Package Manager?
Linuxでパッケージ管理環境が貧弱だった1994年ごろにリリースされました
RPMのパッケージ管理システムとしての特徴は下記のようになっています
パッケージのインストール・アンインストール・アップグレードが容易
他のパッケージとの依存関係の調査が可能
ソース・パッチ管理が可能
ビルド手順の記録・再現が可能
パッケージ情報の多彩なキーで検索が可能
擬似パッケージ名の使用が可能.例えば「httpd(apache)はwebserverというパッケージ名も兼ねる」といったことが出来,
ウェブサーバーの種類にとらわれないパッケージは,httpdに依存するのではなく,webserverに依存するといった構築が可能になる.
★ファイルの書式:
<NAME>-<VERSION>-<RELEASE>.<ARCHITECTURE>.rpm
==>ARCHITECTURE OS、BITなど。。。
MySQL-client-5.6.16-1.el6.x86_64.rpm
★SRPM
==>RPMを作成するために必要なアーカイブやパッチファイルやデータのファイルなどをまとめたファイルになります
通常SRPMがあると,rpmbuildコマンドで再度RPMファイルを作成することが出来ます.
rpm...
Linux 環境変数
ログイン時に読み込むスクリプトと環境変数はどこに設定すればいいのか。シェルがbashの場合。/etc/profileログインしてまず読み込むユーザ全体向けの環境変数を書く/etc/profile.d//etc/profileのスクリプトにより/etc/profile.d/の下にあるスクリプトが実行される。~/.bash_profile個別ユーザ向けの環境変数はここに書く~/.bashrc~/.bash_profileのスクリプトによって実行されるエイリアスなどシェルの基本設定を書く/etc/bashrc~/.bashrc のスクリプトによって実行される全ユーザ向けの設定...
CentOS ant インストール
★バイナリ形式のtar.gzファイルをダウンロードし★環境変数を設定するtouch /etc/profile.d/ant.sh=->export ANT_HOME=".." export PATH="$PATH:ANT_HOME/bin"★拡張jarを全て ANT_HOME/libの下に入れるyum方式やめる方...
2014/05/09
MySQL GTID replication 理解深め
★gtid_mode must be ON on all servers or OFF on all servers★GSo once GTIDs are enabled on all servers, you can have some slaves using file-based positioning and some other slaves using GTID-based positioning.★GTID関係するパラメータmysql> show variables like '%gtid%';+--------------------------+-----------+| Variable_name | Value |+--------------------------+-----------+| enforce_gtid_consistency | ON || gtid_executed ...
linux java.net.UnknownHostException
新しいサーバーを作って、立ち上がり、いきなり。。ーーーInetAddress.getLocalHost()=>java.net.UnknownHostExceptionーーーー/etc/hosts ファイルの内容は、ホスト名とIPアドレスとの対応表です。IPアドレスからホスト名を知りたいとき、またはホスト名からIPアドレスを知りたいときに、このファイルが参照されます。/etc/hostsファイルの書式は以下の通りです。<アドレス> <ホスト名> [別名 ...]==>新しいモン追加して...
2014/05/07
ant
★ant
ant -buildfile test.xml
ant -buildfile test.xml dist
ant -buildfile test.xml -Dbuild=build/classes dist
-->buildFileをtest.xmlを使う。タスクをdistにする。
build属性を「build/classes」にする
★java言語を使って、新たな機能を追加できる。
★build.xml、eclipseで書く方が楽。
★platform間の溝を埋めるために作った。
=ー>実行できない。。
これだけ、後は使う時調...
maven 入門
mvn archetype:generate
->generate project in Interactive mode
・アーキタイプを指定する
=>
デフォルトが203(org.apache.maven.archetypes:maven-archetype-quickstart)になっているので、それを選んでみる
・versionを指定する
・groupIdを指定する
==>これは、何をやっている?
シンプルなクラスつくてくれた。。。。
ーー>test1を作る!
★Mavenでは「リポジトリー」という場所でアーカイブ(jarファイルやソースファイル等)を保管しておき、Mavenで管理された各アプリケーションではそれを参照する。
リポジトリーには「リモートリポジトリー」と「ローカルリポジトリー」がある。
リモートリポジトリーはインターネット上で公開されているリポジトリーで、ローカルリポジトリーは自分のマシン上に(自動的に)構築されたリポジトリー。
Mavenではpom.xmlにアプリケーションが依存(使用)するライブラリーを記述する。
Mavenのコマンドを実行すると、その依存関係に従ってリモートリポジトリーからライブラリー(アーカイブ)をダウンロードしてローカルリポジトリーに格納する。
そして、各アプリケーションはローカルリポジトリー内のファイルを参照して処理を行う。
(例えばローカルリポジトリー内のjarファイルをクラスパスに追加してアプリケーションをコンパイルしたり実行したりする)
==ー>リポジトリー?
★Mavenでは、mvnコマンドのオプションとして「ゴール」を指定して実行する
mvn...