Thanks to antville.org
Sunday, 12. April 2020
important leafy vegetables
  1. Amaranthus caudatus: rajgira.
  2. Amaranthus tricolor: Math. (Chhoti Chulai- Hindi, Cheera- Malayalam)
  3. Amarnthus blitum: tamda math.
  4. Amaranthus oleracea: tandulja.

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


Saturday, 11. April 2020
program creek

program creek seems to be a good site for handy references of python modules. For e.g. when I wanted to know who to use Stratified Shuffle module, the examples shown on this page were very useful.

www.programcreek.com

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


Standard out to a file

This code will change the standard out to a file so that jupyter notebook cell's responses are saved to a file.

import sys
oldStdout = sys.stdout
file = open('logFile', 'w')
sys.stdout = file

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


Thursday, 20. February 2020
Create config file for AWS command line tool

While creating amazon config file in a shell script, use cat with heredoc like this..

cat > myconfigfile.txt << "heredoc"
[default]
aws_access_key_id=XXX
aws_secret_access_key=XXX
region=us-east-1
heredoc

export AWS_CONFIG_FILE=./myconfigfile.txt

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


setting colors in pandas

This is how to set the colors in pandas

mapper = {v: k for k, v in enumerate(colors.unique())}

ccolors.cat.reorder_categories(mapper).cat.codes

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


Wednesday, 19. February 2020
log mysql output

tee output.txt
show global variables;
show engine innodb status\G
show full processlist;
show global status;
select sleep(60);
show engine innodb status\G
show full processlist;
show global status;
notee;

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


Sunday, 16. February 2020
access AWS API gateway using python

Amazon API gateway allows us to host server-less API's those can talk to cloud or on-premises databases. Here is 5 lines of python code to use the API

from urllib.request import Request, urlopen

url='xxx.execute-api.ap-south-1.amazonaws.com'

q = Request(url)
q.add_header('uname', '472202986990')
data = urlopen(q).read().decode('UTF-8')

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


Saturday, 15. February 2020
Using boto

In the bad old days, the glacier class used to have different layers.

import boto.glacier.layer2
l2 = boto.glacier.layer2.Layer2(aws_access_key_id='xxx', aws_secret_access_key='xxx')

Now the client is all you need!

import boto3
gc = boto3.client("glacier",
aws_access_key_id="xxx", aws_secret_access_key="xxx",)

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


Thursday, 13. February 2020
backup mysql users 

3 steps to install perconal utility...

yum install perl-DBI perl-Data-Dumper perl-DBD-MySQL

wget percona.com/get/pt-show-grants

perl pt-show-grants -h 1.2.3.4 -uroot -pPasswd

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


Steps to be used for generating AWS API gateway

a) Method Execution - Get Method Request - URL Query String Parameters - add a variable: cmnumber

b) Method Execution - Get Integration Request - Mapping Templates - Content-Type - application/json - Mapping template

{"mnumber": "$input.params('cmnumber')"}

"requestTemplates": {
"application/json": {
"querystring": "$input.params().querystring"
}
}

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


Online for 6672 days
Last modified: 10/28/20 5:59 PM
Status
Youre not logged in ... Login
Menu
... Home
... Tags

Search
Calendar
November 2020
SunMonTueWedThuFriSat
1234567
891011121314
15161718192021
22232425262728
2930
April
Recent updates
important leafy vegetables 1. Amaranthus
caudatus: rajgira. 2. Amaranthus tricolor: Math.  (Chhoti Chulai- Hindi, Cheera-...
by shantanuo (4/12/20 2:01 PM)
program creek program creek
seems to be a good site for handy references of python...
by shantanuo (4/11/20 11:24 AM)
Standard out to a file
This code will change the standard out to a file...
by shantanuo (4/11/20 11:18 AM)
Create config file for AWS
command line tool While creating amazon config file in a...
by shantanuo (2/20/20 6:00 AM)
setting colors in pandas This
is how to set the colors in pandas mapper =...
by shantanuo (2/20/20 5:53 AM)
log mysql output tee output.txt
show global variables; show engine innodb status\G show full processlist;...
by shantanuo (2/19/20 10:33 AM)
access AWS API gateway using
python Amazon API gateway allows us to host server-less API's...
by shantanuo (2/16/20 9:41 AM)
Using boto In the bad
old days, the glacier class used to have different layers....
by shantanuo (2/15/20 10:28 AM)
backup mysql users  3
steps to install perconal utility... yum install perl-DBI perl-Data-Dumper perl-DBD-MySQL wget...
by shantanuo (2/13/20 1:49 PM)
Steps to be used for
generating AWS API gateway a) Method Execution - Get Method...
by shantanuo (2/13/20 1:30 PM)
apply colors to pandas Here
is how to change the color of negative values to...
by shantanuo (2/12/20 8:57 AM)
Holidays in India These are
the common holidays celebrated in India (Mumbai) during 2016 -...
by shantanuo (2/11/20 1:53 PM)
change log file size in
MySQL Here are the steps to be followed while changing...
by shantanuo (2/11/20 10:38 AM)
MySQL common error messages 1146
Table does not exist 1054 column does not exist 1062...
by shantanuo (2/11/20 10:13 AM)
ipython parallel demo First start
ipython in cluster mode ipcluster start -n 4 from IPython.parallel...
by shantanuo (2/9/20 9:02 AM)
djanog settings You may see
this message if you have DEBUG = True in your...
by shantanuo (2/9/20 4:07 AM)
clear tmp folder Here is
following commands to clear unwanted stuff from the /tmp partition...
by shantanuo (2/8/20 2:41 PM)
change your server time to
IST If you need to change your server clock to...
by shantanuo (2/8/20 2:39 PM)
Transfer root emails to another
email address If you have root access to the server...
by shantanuo (2/8/20 2:32 PM)
special strings in cron Instead
of the first five fields, you can use any one...
by shantanuo (2/8/20 2:30 PM)
LibreOffice version conflict I am
not able to install latest version of Libre office. I...
by shantanuo (1/29/20 9:15 AM)
while loop This is
a sample shell script while loop while read mydb do echo...
by shantanuo (1/26/20 12:24 PM)
compare mysql schema And here
is poor man's schema compare using good old diff command......
by shantanuo (1/26/20 11:49 AM)
Selecting from error log grep
"error" error_log |awk -F[ {'print $4'} \ | sort |...
by shantanuo (1/26/20 10:40 AM)
Rank mysql records using variables
SET @rank = 0, @prev_val = NULL; SELECT rank, correct...
by shantanuo (1/26/20 9:45 AM)

RSS feed

Made with Antville
Helma Object Publisher