2014. 6. 10. 08:10

Difference between bin and sbin

Remember this simply like sbin is system-bin and bin is user-bin.

For more detail:
http://linuxtroubleshoot.blogspot.kr/2011/03/difference-between-bin-vs-sbin-vs.html?m=1
2014. 6. 10. 02:23

Shame and ashamed

Today (Actually yesterday cause 12 am was passed) I feel very ashamed of failing the test. To express this feeling in English, I had confusion  about shame and ashamed.


I feel ashamed 


- I feel almost ashamed that I've been so lucky


I'm ashamed 


- I'm ashamed to say that I liked to her


Have you no shame?


You have shamed your family.



shame is noun and verb but ashamed is adjective. That's the point that I need to keep in mind.


* 종교 : Religion!


2014. 6. 10. 01:54

Memory Structure

The following diagram shows three different memory categories that server allocates.



 Server / Shared

  • Query Cache
  • Thread Cache 

 Storage Engine / Shared

  • Log buffer
  • Buffer pool

 Connection / Session

  • Sort buffer
  • Read buffer
  • Temporary table


Now check each item in more detail.


Query Cache


The query cache stores results of SELECT queries so that if the identical query is received in future, the results can be quickly returned.


Queries are examined in a case-sensitive manner, so


SELECT * FROM t


is different to 


select * from t


Comments are also considered and can make the queries differ, so


/* retry */ SELECT * FROM t


is different to


/* retry 2 */ SELECT * FROM t



Thread cache


By default, connection manager threads associate each client connection with a thread dedicated to it that handles authentication and request processing for that connection. Manager threads create a new thread when necessary but try to avoid doing so by consulting the thread cache first to see whether it contains a thread that can be used for the connection. When a connection ends, its thread is returned to the thread cache if the cache is not full.


The thread cache has a size determined by the thread_cache_size system variable. The default value is 0 (no caching), which causes a thread to be set up for each new connection and disposed of when the connection terminates.


(http://dev.mysql.com/doc/refman/5.5/en/connection-threads.html)


** I need to write more items that were not covered here **




2014. 6. 8. 18:20

Binary Portablity

Both MyISAM and InnoDB tablespaces are binary portable from one host to another if two conditions are met:


  • Both machines must use two's-complement integer arithmetic
  • Both machines must use IEEE floating-point format or else the tables must contain no floating-point columns (FLOAT or DOUBLE)

A third condition for InnoDB binary portability is that you should use lowercase names for tables and databases.

   ☞ This is because InnoDB stores these names internally (in its data dictionary) in lowercase on Windows. Using lowercase names allows binary portability between Windows and Unix, to force the use of lowercase names, you can put the following lines in an option file:


[mysqld]
lower_case_table_names=1


To sum up,


MyIsam 


  • Both machines must use two's-complement integer arithmetic
  • Both machines must use IEEE floating-point format or else the tables must contain no floating-point columns (FLOAT or DOUBLE)

InnoDB

  • Both machines must use two's-complement integer arithmetic
  • Both machines must use IEEE floating-point format or else the tables must contain no floating-point columns (FLOAT or DOUBLE)
  • Database and table names must use lowercase format


2014. 6. 8. 17:05

On behalf of

Implicitly set locks are locks set and released on behalf of the client, by the server.


On behalf of the department I would like to thank you all





~ 를 대신하여, ~를 대표하여

2014. 6. 8. 16:34

Dirty Read, Non-Repeatable Read and Phantom row

A dirty read occurs when a transaction is allowed to read data from a row that has been modified by another running transaction and not yet committed.


A non-repeatable read occurs, when during the course of a transaction, a row is retrieved twice and the values within the row differ between reads.


A phantom read occurs when, in the course of a transaction, two identical queries are executed, and the collection of rows returned by the second query is different from the first. The phantom reads anomaly is a special case of Non-repeatable reads.

2014. 6. 6. 23:50

Check where the data directory is on MySQL

The following command will show:

 

 

  mysql> show variables like 'datadir';
+---------------+---------------------------------------------+
| Variable_name | Value                                       |
+---------------+---------------------------------------------+
| datadir       | C:\ProgramData\MySQL\MySQL Server 5.6\data\ |
+---------------+---------------------------------------------+
1 row in set (0.00 sec)

 

2014. 6. 6. 23:28

Use explain

To get query execution plan, explain is used. but not just for this, explain is more useful to get the table information such as column list and its detail.


mysql> explain [schema_name].[table_name]


or


mysql > explain table_name


 mysql> explain world.city;

+-------------+----------+------+-----+---------+----------------+
| Field       | Type     | Null | Key | Default | Extra          |
+-------------+----------+------+-----+---------+----------------+
| ID          | int(11)  | NO   | PRI | NULL    | auto_increment |
| Name        | char(35) | NO   |     |         |                |
| CountryCode | char(3)  | NO   |     |         |                |
| District    | char(20) | NO   |     |         |                |
| Population  | int(11)  | NO   |     | 0       |                |
+-------------+----------+------+-----+---------+----------------+
5 rows in set (0.01 sec)


describe is same with this.


 mysql> describe information_schema.tables;

+-----------------+---------------------+------+-----+---------+-------+
| Field           | Type                | Null | Key | Default | Extra |
+-----------------+---------------------+------+-----+---------+-------+
| TABLE_CATALOG   | varchar(512)        | NO   |     |         |       |
| TABLE_SCHEMA    | varchar(64)         | NO   |     |         |       |
| TABLE_NAME      | varchar(64)         | NO   |     |         |       |
| TABLE_TYPE      | varchar(64)         | NO   |     |         |       |
| ENGINE          | varchar(64)         | YES  |     | NULL    |       |
| VERSION         | bigint(21) unsigned | YES  |     | NULL    |       |
| ROW_FORMAT      | varchar(10)         | YES  |     | NULL    |       |
| TABLE_ROWS      | bigint(21) unsigned | YES  |     | NULL    |       |
| AVG_ROW_LENGTH  | bigint(21) unsigned | YES  |     | NULL    |       |
| DATA_LENGTH     | bigint(21) unsigned | YES  |     | NULL    |       |
| MAX_DATA_LENGTH | bigint(21) unsigned | YES  |     | NULL    |       |
| INDEX_LENGTH    | bigint(21) unsigned | YES  |     | NULL    |       |
| DATA_FREE       | bigint(21) unsigned | YES  |     | NULL    |       |
| AUTO_INCREMENT  | bigint(21) unsigned | YES  |     | NULL    |       |
| CREATE_TIME     | datetime            | YES  |     | NULL    |       |
| UPDATE_TIME     | datetime            | YES  |     | NULL    |       |
| CHECK_TIME      | datetime            | YES  |     | NULL    |       |
| TABLE_COLLATION | varchar(32)         | YES  |     | NULL    |       |
| CHECKSUM        | bigint(21) unsigned | YES  |     | NULL    |       |
| CREATE_OPTIONS  | varchar(255)        | YES  |     | NULL    |       |
| TABLE_COMMENT   | varchar(2048)       | NO   |     |         |       |
+-----------------+---------------------+------+-----+---------+-------+
21 rows in set (0.01 sec)



2014. 6. 3. 07:30

[Fiddler] WCF Binary Message Inspector

Source: https://github.com/waf/WCF-Binary-Message-Inspector

 

 

BinaryMessageFiddlerExtension.dll

 

WCF Binary Message Inspector


This is a modification of the WCF Binary Message Inspector. It provides two notable enhancements:

Uses a collapsible tree view instead of a textarea to display the decoded WCF binary message.
Allows editing and reissuing of captured WCF binary messages (thanks to HofmaDresu)


Installation for Fiddler2

 

Copy the file BinaryMessageFiddlerExtension/bin/Release/BinaryMessageFiddlerExtension.dll (direct download) into C:\Program Files\Fiddler2\Inspectors and restart Fiddler.

 

Installation for Fiddler4 (Beta)

 

Copy the file BinaryMessageFiddlerExtension/bin/Release/BinaryMessageFiddlerExtension_Fiddler4.dll (direct download) into C:\Program Files\Fiddler2\Inspectors and restart Fiddler.

 

Tree View Usage

 

The tree view provides the following shortcuts:

Ctrl+c — Copy current node XML
Ctrl+Shift+c — Copy tree XML
Alt+→ — Expand node and all child nodes
Alt+← — Collapse node and all child nodes
Middle-click — Toggle expand/collapse of node and all child nodes


Edit Usage

 

Capture a WCF binary message
In the sessions list, right click on the message and choose "Unlock for editing"
Edit the request
Reissue the request using the toolbar or the session list context menu

2014. 6. 2. 06:56

Knife bootstrap failed only with "Connection closed by remote host"

Knife bootstrap beyond a jump host failed just showing following log:



 DEBUG: Adding xx.xx.xxx.xxx

DEBUG: establishing connection to 127.0.0.1:xxxxxx

DEBUG: connection established

INFO: negotiation protocol version

ERROR: Net::SSH:Disconnect: connection closed by remote host


To resolve this, change ssh config as below on the jump host:


sudo vi /etc/ssh/sshd_config


 AllowTcpForwading yes


And restart ssh service.