Thanks to antville.org
mysql and shell command

date -d"-1 day ago" +'%b%d'

equals to

mysql -Bse"select date_format(date(date_add(now() , interval 1 day)),'%b%d')"

... Link (0 comments) ... Comment


find dead processes

The 8th column of ps aux command will list the status of the process.

ps aux | awk '{if ($8 ~ "D") print $0}'

Here is a list of the various process statuses and what they mean:

D – Uninterruptible sleep (usually a critical system process, a process that cannot be killed without rebooting)
R – Running
S – Interruptible sleep (waiting for an event to complete)
T – Stopped
Z – Defunct (“zombie”) process

... Link (0 comments) ... Comment


connect to AWS

It is possible to use password to connect to AWS

1) change config file
sudo vi /etc/ssh/sshd_config

PermitRootLogin yes
PasswordAuthentication yes

2) restart
sudo service ssh restart

3) add a password
sudo passwd root

4) ssh without key
ssh root@xxx.com

... Link (0 comments) ... Comment


upgrade ubuntu

Upgrade from 14.04 to 15.04 is a 2 step journey.

sudo nano /etc/update-manager/release-upgrades
change the value to normal

And then use this command twice!
sudo do-release-upgrade

You can check your ubuntu version:

lsb_release -a
Description: Ubuntu 15.04

... Link (0 comments) ... Comment


Libre office on centOS

Here is how to install Libre office on centOS

64 bit
wget download.documentfoundation.org

32 bit
wget download.documentfoundation.org

tar xvf LibreOffice_4.4.4_Linux_x86_rpm.tar.gz

rpm -Uvh LibreOffice_4.4.4.3_Linux_x86_rpm/RPMS/*.rpm

... Link (0 comments) ... Comment


manage iso image file

Here is how you can open and copy files from an iso image.

mkdir /mnt/iso
mount -t iso9660 -o loop /root/Downloads/ubuntu-15.04-desktop-i386.iso /mnt/iso/

ls /mnt/iso/

... Link (0 comments) ... Comment


Create a Reverse SSH Tunnel

on Remote server:
ssh -fN -R 7000:localhost:22 username@yourMachine-ipaddress

Now do an ssh connection request from your machine to your own machine at port 7000:
ssh username@localhost -p 7000

... Link (0 comments) ... Comment


avoid key prompt

Here is a simple tip that will avoid RSA key fingerprint authentication. Edit /etc/ssh/ssh_config for global configuration or ~/.ssh/config for user-specific configuration.

Host 192.168.0.*
StrictHostKeyChecking no
UserKnownHostsFile=/dev/null

... Link (0 comments) ... Comment


Killing mysql

Here are a few ways to kill mysql process.

mysqladmin shutdown
kill -TERM nnnn
killalll mysqld
kill -TERM pidof mysqld
kill -TERM cat /var/run/mysqld.pid

... Link (0 comments) ... Comment


Managing top

While the output of the top command displayed, press F, which will display all fields available for sorting, press n (which is for sorting the processes by Memory) and press enter.

press c, which will display full pathname of running processes

press 1 (number one), which will display the performance data of the individual CPUs.

... Link (0 comments) ... Comment


Online for 6205 days
Last modified: 8/7/19 10:49 AM
Status
Youre not logged in ... Login
Menu
... Home
... Tags

Search
Calendar
August 2019
SunMonTueWedThuFriSat
123
45678910
11121314151617
18192021222324
25262728293031
June
Recent updates
Remove old backup files Cron
entry to remove all files in /home/ folder that starts...
by shantanuo (8/7/19 10:49 AM)
Types in AWS CNF List
of important Types in Amazon Cloud Formation tool: IAM (User,...
by shantanuo (8/5/19 7:36 AM)
codes used for classification Standard
codes used for classification: 1 SC 2 OBC 3 SBC...
by shantanuo (6/25/19 11:11 AM)
Shell scripting basics Here are
8 important concepts of Shell scripting that everyone should know....
by shantanuo (6/2/19 6:50 AM)
schema conversion tool This seems
to be a useful tool to convert mysql or oracle...
by shantanuo (3/30/19 6:52 AM)
Install packetbeat In order to
install packetbeat, you may need to change the windows security...
by shantanuo (3/26/19 8:01 AM)
python itertools module from itertools
import groupby s = 'abcccccbba' for w, v in groupby(s):...
by shantanuo (3/17/19 3:22 PM)
audio visual modules for Machine
Learning Here is the list of some of the modules...
by shantanuo (3/16/19 1:08 PM)
google module module for google
search !pip install google from googlesearch import search for url...
by shantanuo (1/8/19 10:38 AM)
Python date and time from
datetime import datetime date_string = "21 June, 2018" date_object =...
by shantanuo (12/26/18 12:14 PM)
Infer types in pandas This
will return the mixed datatypes but this can be slow....
by shantanuo (12/16/18 3:50 PM)
Extract words from Marathi wikipedia
1) Download the polyglot pickled marathi model wget http://bit.ly/12FI1xV mv...
by shantanuo (11/4/18 10:06 AM)
Google Input tools Google suddenly
stopped download of Input Tools package without giving any reason....
by shantanuo (9/10/18 7:44 AM)
Python objects and methods Here
are important python objects and their methods int __mul__, __add__,...
by shantanuo (8/18/18 3:11 PM)
JSON to DF Here is
how to read a JSON file into pandas dataframe. import...
by shantanuo (8/8/18 1:12 PM)
managing servers using python Fabric
is a high level Python library designed to execute shell...
by shantanuo (8/4/18 10:01 AM)
backup mysql users It is
easy to backup mysql users - wget percona.com/get/pt-show-grants; perl pt-show-grants
by shantanuo (5/20/18 3:42 PM)
About python 1 everything is
an object (class instances) 2 methods depends upon class of...
by shantanuo (5/20/18 2:52 PM)
mysql and shell command date
-d"-1 day ago" +'%b%d' equals to mysql -Bse"select date_format(date(date_add(now() ,...
by shantanuo (5/16/18 7:47 AM)
Preserving comments in Stored Procedure
You can write multi line comments in a stored procedure...
by shantanuo (5/12/18 12:56 PM)
Custom slack command Here are
5 steps to add any API to your slack channel....
by shantanuo (4/25/18 6:59 AM)
stack bookmarklet This bookmarklet will
help to quickly access stack pages linking to current page...
by shantanuo (1/10/18 10:47 AM)
Manage S3 like rsync ####
create bucket aws s3 mb s3://johntest123/ #### rsync all files...
by shantanuo (12/22/17 12:04 PM)
apache docker container issues If
apache docker container does not start then make these changes......
by shantanuo (11/10/17 3:00 PM)
Install aws client on centos
If pip is not installed, then the following command will...
by shantanuo (10/26/17 9:51 AM)

RSS feed

Made with Antville
Helma Object Publisher