Created
October 7, 2017 04:28
-
-
Save onokatio/bd03d6c26e43d23a4c0400c001857f0e to your computer and use it in GitHub Desktop.
中学生時代につかっていたチートシート(~/myhelp/*.txt) ref: http://qiita.com/onokatio/items/a5d5d6ce03ecb654cf52
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| info ホストの情報 | |
| version バージョン情報 | |
| pull [イメージ名:タグ名] イメージをhubからダウンロード | |
| images ローカルにダウンロード済みのイメージ | |
| run [--name コンテナ名] [イメージ名:タグ名] [-it 入力を開く] [-d バッググラウンド] [-p ホストのポート:コンテナのポート ] | |
| ps [-a 停止中も] コンテナ一覧 | |
| commit [コンテナー名またはコンテナID] [ユーザー名(任意)/イメージ名] | |
| stop [コンテナ名またはコンテナID] | |
| rm [コンテナ名またはコンテナID] コンテナ削除 | |
| rmi [イメージ名またはイメージID] イメージ削除 | |
| start [イメージ名またはコンテナID] 停止したコンテナを再実行 | |
| build [-t イメージ名:タグ名] . | |
| dockerfileからイメージ作成 | |
| dockerfile | |
| {命令} 用途 | |
| FROM 元となるDockerイメージの指定 | |
| MAINTAINER 作成者の情報 | |
| RUN コマンドの実行 | |
| ADD ファイル/ディレクトリの追加 | |
| CMD コンテナーの実行コマンド 1(run上書き可能) | |
| ENTRYPOINT コンテナーの実行コマンド 2(run上書き不可) | |
| WORKDIR 作業ディレクトリの指定 | |
| ENV 環境変数の指定 | |
| USER 実行ユーザーの指定 | |
| EXPOSE ポートのエクスポート | |
| VOLUME ボリュームのマウント |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE USER 'ユーザー名'@'localhost' IDENTIFIED BY 'パスワード'; ユーザー作成 | |
| DROP USER 'ユーザー名'@'localhost';ユーザー削除 | |
| GRANT ALL ON db.* TO user; 権限設定 | |
| GRANT ALL privileges ON db.* TO user1@"192.168.3.%" identified by 'パスワード' with grant option; 外部からでもアクセス許可 | |
| CREATE DATABASE db; データベース作成 | |
| SHOW DATABASES; データベース一覧 | |
| SHOW TABLES FROM db ; テーブル一覧 | |
| CREATE TABLE db.table(カラム名 型,カラム名 型); テーブル作成 | |
| ALTER TABLE db.table ADD (カラム名 型,カラム名 型...);カラム追加 | |
| ALTER TABLE db.table DROP カラム名;カラム削除 | |
| ALTER TABLE db.table MODIFY カラム名 型; | |
| DROP TABLE db.table;//テーブルさ駆除 | |
| SELECT Host, User, Password FROM mysql.user; ユーザー一覧 | |
| |=カラムの型===============| | |
| | 型 |内容 | | |
| |--------------------------| | |
| | int |数字 | | |
| | varchar(文字数) |文字列| | |
| |==========================| | |
| INSERT INTO db.table (カラム名,カラム名...) VALUES (データ,データ...); データ挿入 | |
| SELECT * FROM db.table WHERE カラム名 LIKE '値'; 読み出し | |
| UPDATE db.table SET 変更するカラム = 値 WHERE 指定カラム = 値; | |
| DELETE FROM db.table WHERE k = d; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $link = mysql_connect('mysqlサーバーアドレス', 'ユーザー', 'パスワード'); mysqlに接続 | |
| if (!$link) { | |
| die('接続失敗です。'.mysql_error()); | |
| } | |
| $db_selected = mysql_select_db('データベース名', $link); | |
| if (!$db_selected){ | |
| die('データベース選択失敗です。'.mysql_ | |
| } | |
| $result = mysql_query('SQL文セミコロンなし') | |
| if (!$result) { | |
| die('クエリーが失敗しました。'.mysql_er | |
| } | |
| mysql_close($link); mysql切断 | |
| 暗号化 | |
| function pass($arg){ | |
| $pass = MD5($arg);//まずMD5しときます | |
| $pass2 = sha1($pass); | |
| $pass3 = '21'.$pass2.'43'.$pass; | |
| $pass4 = hash('sha256',$pass3); | |
| $pass5 = MD5($pass4); | |
| $pass6 = sha1($pass5); | |
| $pass7 = hash('sha256',$pass6); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ wget -O - --post-file=login.txt --save-cookies=cookie.txt --keep-session-cookies | |
| wget -O - --load-cookies=cookie.txt | |
| wget -O - --save-cookies=cookie.txt --keep-session-cookies | |
| wget -O - --load-cookies=cookie.txt | |
| --post-data="a=1&b=2" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment