Wednesday, April 22, 2020

DB load affected by huge mysql slow query log

One of the reason found for below error message in Turbogears was due to the high load in mysql.

uwsgi_response_write_headers_do(): Broken pipe [core/writer.c line 238] during GET /static/images/icon2.ico

Further debugging mysql showed:
1. Lot of slow queries reported usually scanning large number of rows.
2. mysql slow query with huge size. It was observed that mysql started reaching peaks and choking once the log size reached 69 GB!

Following was the version of mysql:
    Server version: 5.5.15-log MySQL Community Server (GPL)

Monday, November 14, 2016

Git commands - reference for my own usage

git add .
git status
git diff
git commit
# To stop tracking a file, remove it from the index
git rm --cached <file>
git rm --cached -r . 

# Display checkin details
# p4 describe
git log

# p4 revert
git checkout -- 
 
# Modify previous commit, change message,add/delete files
git commit --amend

# p4 sync
git pull

## Push and pull from remote location - bitbucket

git remote add origin https://vjonnak@bitbucket.org/vjonnak/mdm.git
git push -u origin master
# To verify
git remote -v
# Pull the repository
git pull


## To amend the author of checked in code
git config --global user.name "Name"
git config --global user.email "< email id >"

git commit --amend --reset-author

# Normal flow
git pull
git add
git commit
git push -u origin master


Monday, October 17, 2016

Kafka installation on ubuntu

Installation for Ubuntu
Instruction link: http://kafka.apache.org/documentation.html
Commands
Install Java
https://help.ubuntu.com/community/Java
https://www.digitalocean.com/community/tutorials/how-to-install-java-with-apt-get-on-ubuntu-16-04
  
sudo apt-get update
sudo apt-get install default-jre
sudo apt-get install default-jdk
 
 

wget http://redrockdigimark.com/apachemirror/kafka/0.10.0.0/kafka_2.11-0.10.0.0.tgz

tar -xzf kafka_2.11-0.10.0.0.tgz
cd kafka_2.11-0.10.0.0
 

Monday, August 3, 2015

Sqlite Commands

sqlite3 /path/to/file/wall_test_test.db

Desc Table:
PRAGMA table_info([store_workspace]);
select * from store_workspace;

Delete rows from table:
delete from store_workspace;

List all tables:
.tables;

Monday, July 27, 2015

Ubuntu commands


  1. When following messages are seen when logged into Ubuntu:

88 packages can be updated.
80 updates are security updates
Run the following commands to update the packages:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo reboot - If necessary

Saturday, July 25, 2015

AWS - puTTY Setup, tunneling to VNC Viewer - Install Django

Connection through putty

  1. Download puTTy and puTTygen from puTTy download page
  2. Convert .pem to .ppk which puTTy understand
    1. Start puTTygen
    2. Select SSH-2 RSA under "Type of key to generate"
    3. Click load, locate the .pem file [ Select the option to display 'All files (*.*)' ]
    4. Click "Save private key"
    5. Specify the same name for the key that was used for the key pair. PuTTy automatically adds the .ppk file extension
  3. Start puTTy
  4. In Category pane,
    1. select session
    2. In 'Host Name' enter user_name@public_dns_name for ubuntu it is 'ubuntu'
    3. Select SSH under Connection type
    4. Port is 22
    5. In the Category pane, expand Connection, expand SSH, and then select Auth
      1. Click Browse
      2. Select .ppk file and then click Open
      3. If you plan to start this session again later, you can save the session information for future use. Select Session in the Category tree, enter a name for the session in Saved Sessions, and then click Save.
      4. Click Open to start the PuTTY session

Connect VNC

  1. Follow the steps at link
  2. Load the above session by clicking Category->Session->select the session under 'Saved session' -> Load
  3. In Category pane, expand SSH, select X11, check Enable X11 Forwarding
  4. Select Tunnels from Category pane, Enter these values:
    1. Source port: 5900
    2. hostname:port_number
    3. To determine the destination port, use the number (#) you were given in the vncserver command above and add it to 5900. For example, if your server is running on :1, use hostname:5901
    4. Click Add
  5. Save the session: Category->Session->select the session under 'Saved session' -> Save
  6. Open VNC Viewer
    1. VNC server: localhost
    2. Click OK

Monday, September 22, 2014

Debug Build Failures on Linux platform

Tools/Unix commands which helps debug build failures

  1. nm
  2. file
  3. objdump
  4. strings
  5. ar
  6. ldd
  7. Know about the significance and behavior of different types of symbols.