Thanks to antville.org
Tuesday, 11. February 2020
MySQL common error messages

1146 Table does not exist
1054 column does not exist
1062 duplicate entry for primary key
1406 Data too long for column
1064 sql syntax error
1111 invalid use of group function
1366 incorrect integer value
1046 No database selected

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


Sunday, 9. February 2020
ipython parallel demo

First start ipython in cluster mode

ipcluster start -n 4

from IPython.parallel import Client
rc = Client()
v=rc.load_balanced_view()
@v.parallel(block=True)
def f(x): return 2*x
result = f.map(range(10))
print("Using a parallel function: ", result)

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


djanog settings

You may see this message if you have DEBUG = True in your Django settings file and you haven't configured any URLs.

django-admin.py startproject todo

python manage.py runserver localhost:8000

$$ If you plan to use a database, edit the DATABASES setting in todo/settings.py.
python manage.py startapp todoapp

$$ syncdb and flush are other 2 parameters accepted by manage.py

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


Saturday, 8. February 2020
clear tmp folder

Here is following commands to clear unwanted stuff from the /tmp partition on the server?

tmpwatch –mtime –all 48 /tmp

The above command will remove all files and folders from the /tmp which have not been accessed in the last couple of days (24×2=48). You can modify the number of hours as required.

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


change your server time to IST

If you need to change your server clock to another timezone for e.g. (Indian Standard Time), you can do so by modifying the /etc/localtime file:

mv /etc/localtime /etc/localtime.bak

ln -s /usr/share/zoneinfo/Asia/Calcutta /etc/localtime

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


Transfer root emails to another email address

If you have root access to the server then open the file /etc/aliases in your favorite editor. Look for the section Person who should get root mail and make the change as required.

vim /etc/aliases

Person who should get root’s mail ##
root: info@unixserveradmin.com

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


special strings in cron

Instead of the first five fields, you can use any one of eight special strings. It will not just save your time but it will improve readability.

Special string Meaning
@reboot ——> Run once, at startup.
@yearly ——> Run once a year, “0 0 1 1 ”.
@annually –> (same as @yearly)
@monthly —> Run once a month, “0 0 1
”.
@weekly —–> Run once a week, “0 0
0″.
@daily ——–> Run once a day, “0 0
”.
@midnight –> (same as @daily)
@hourly —–> Run once an hour, “0 ”.

For e.g. run ntpdate every hour:
@hourly /path/to/ntpdatevim /etc/ssh/sshd_config

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


Wednesday, 29. January 2020
LibreOffice version conflict

I am not able to install latest version of Libre office. I get an error message for file LibreOffice_6.3.4_Win_x86.msi

LibreOffice 6.3.4.2 can not be installed on this Windows version. Windows 7 SP1 or newer is required.

The fix is easy. Download earlier version for e.g. 6.2 version file:
LibreOffice_6.2.0.1_Win_x64.msi

From:

downloadarchive.documentfoundation.org

This site is very slow and may take 10 or 20 times more time to download older version compared to the latest one!


If I try the 64 bit version file LibreOffice_6.3.4_Win_x64.msi then I get the processor error like this:

This installation package is not supported by this processor type. Contact your product vendor.

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


Sunday, 26. January 2020
while loop

This is a sample shell script while loop

while read mydb
do
echo "time scp /home/backup/mysql/$mydb/ticket.txt.gz 1.2.3.4:/tmp/$mydb.txt.gz "
done << dblist
akolaII
akol
ako
dblist

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


compare mysql schema

And here is poor man's schema compare using good old diff command...

mysqldump nasik1 --no-data > nasik1.sql

mysqldump -h1.2.3.4 murtizapur --no-data > murtizapur.sql

diff murtizapur.sql nasik1.sql --side-by-side --suppress-common-lines | grep -v ENGINE | grep -v BTREE > to_study.txt

Or use one of the packages:

code.google.com

www.red-gate.com

www.devart.com

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


Online for 6432 days
Last modified: 2/28/20 2:35 PM
Status
Youre not logged in ... Login
Menu
... Home
... Tags

Search
Calendar
April 2020
SunMonTueWedThuFriSat
1234
567891011
12131415161718
19202122232425
2627282930
February
Recent updates
Awesome! Thank you for posting
your simple and amazing steps. I followed it and enjoyed....
by masterdani2018 (2/25/20 11:46 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)
14 days ago This is
the python way of calculating the date that is 14...
by shantanuo (1/14/20 2:26 PM)
docker on ARM Here are
5 commands to run docker on ARM processors: sudo apt-get...
by shantanuo (12/26/19 5:41 AM)

RSS feed

Made with Antville
Helma Object Publisher