Tech C**P
15 subscribers
161 photos
9 videos
59 files
304 links
مدرس و برنامه نویس پایتون و لینوکس @alirezastack
Download Telegram
Mail blacklist on hotmail.com live outlook:

2017-03-08 18:49:08 +0000 08 mail1 SMTP-OUT:000011A2: Negative reply to MAIL command: SC-001 (SNT004-MC11F14) Unfortunately, messages from MY_MAIL_SERVER_IP_ADDRESS weren't sent. Please contact your Internet service provider since part of their network is on our block list. You can also refer your provider to http://mail.live.com/mail/troubleshooting.aspx#errors.
2017-03-08 18:49:08 +0000 08 mail1 SMTP-OUT:000011A2: Set recipient <USER_MAIL@hotmail.com> state to RELAY ERROR
2017-03-08 18:49:08 +0000 08 mail1 SMTP-OUT:000011A2: Delivery attempt completed for mail 1CAEE3; schedule for cleanup
2017-03-08 18:49:08 +0000 08 mail1 SMTP-OUT:000011A2: Set mail state to SENT
2017-03-08 18:49:08 +0000 08 mail1 SMTP-OUT:000011A2: Disconnected from 104.44.194.237

To solve this problem submit your request to Microsoft with link below:

https://support.microsoft.com/en-us/getsupport/hostpage.aspx?oaspworkflow=start_1.0.0.0&wfname=WOL&productkey=outlook&supporttopic_L1=100110385&supporttopic_L2=100110391&supporttopic_L2.STName=Sending,%20receiving%20and%20reading%20email&supporttopic_L1.STName=Email%20&%20communication&supportregion=EN-US&locale=EN-US&ccsid=635380844757616869

Your mail server should be unblocked within 48 hours, in case your mail server is working OK.

#mail_server #outlook #blacklist #hotmail #live #smtp #microsoft
Check if a mail server has PTR record (reverse DNS):

nslookup 185.12.231.212

The result would be:

Server:  172.16.131.15
Address: 172.16.131.15#53

Non-authoritative answer:
212.231.12.185.in-addr.arpa name = 212.231.12.185.in-addr.arpa.

Authoritative answers can be found from:

It means that you have PTR record.
* some mail servers like mail.com reject your mails in case your mail server does not have a PTR record with the error below:

2017-08-17 19:25:21 +0000 08 mail1 SMTP-OUT:000022AF: Server rejected connection with message: resimta-ch2-03v.sys.comcast.net resimta-ch2-03v.sys.comcast.net YOUR_MAIL_SERVER_IP Comcast requires that all mail servers must have a PTR record with a valid Reverse DNS entry. Currently your mail server does not fill that requirement. For more information, refer to: http://postmaster.comcast.net/smtp-error-codes.php#554
Create partition on MySQL based on a date column:

CREATE TABLE members (
firstname VARCHAR(25) NOT NULL,
lastname VARCHAR(25) NOT NULL,
username VARCHAR(16) NOT NULL,
email VARCHAR(35),
joined DATE NOT NULL
)
PARTITION BY RANGE COLUMNS(joined) (
PARTITION p0 VALUES LESS THAN ('1960-01-01'),
PARTITION p1 VALUES LESS THAN ('1970-01-01'),
PARTITION p2 VALUES LESS THAN ('1980-01-01'),
PARTITION p3 VALUES LESS THAN ('1990-01-01'),
PARTITION p4 VALUES LESS THAN MAXVALUE
);

MySQL subdivide table into smaller tables based on date in low level. It improves performance in case you want to query based on date
field and another column. There is also other partitioning types like LIST, HASH, KEY.

Delete a specific partition in MySQL:

ALTER TABLE members DROP PARTITION p0;

The above command is much more efficient than command below:

DELETE FROM members WHERE joined <= '1990-01-01';

If your field is of type timestamp you can do something like below:

CREATE TABLE quarterly_report_status (
report_id INT NOT NULL,
report_status VARCHAR(20) NOT NULL,
report_updated TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
)
PARTITION BY RANGE ( UNIX_TIMESTAMP(report_updated) ) (
PARTITION p0 VALUES LESS THAN ( UNIX_TIMESTAMP('2008-01-01 00:00:00') ),
PARTITION p1 VALUES LESS THAN ( UNIX_TIMESTAMP('2008-04-01 00:00:00') ),
PARTITION p2 VALUES LESS THAN ( UNIX_TIMESTAMP('2008-07-01 00:00:00') ),
PARTITION p3 VALUES LESS THAN ( UNIX_TIMESTAMP('2008-10-01 00:00:00') ),
PARTITION p4 VALUES LESS THAN ( UNIX_TIMESTAMP('2009-01-01 00:00:00') ),
PARTITION p5 VALUES LESS THAN ( UNIX_TIMESTAMP('2009-04-01 00:00:00') ),
PARTITION p6 VALUES LESS THAN ( UNIX_TIMESTAMP('2009-07-01 00:00:00') ),
PARTITION p7 VALUES LESS THAN ( UNIX_TIMESTAMP('2009-10-01 00:00:00') ),
PARTITION p8 VALUES LESS THAN ( UNIX_TIMESTAMP('2010-01-01 00:00:00') ),
PARTITION p9 VALUES LESS THAN (MAXVALUE)
);

#mysql #partition #range_partition #database
https://portainer.io/overview.html

Manage your docker ecosystem by Portainer.

#container #docker #dashboard
Tech C**P
https://portainer.io/overview.html Manage your docker ecosystem by Portainer. #container #docker #dashboard
Start it using:

$ docker volume create portainer_data
$ docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer
Proxy your whole computer using the command below to tunnel through your server:


ssh -D 127.0.0.1:8157 admin@YOUR_SERVER_IP_ADDR


Now install Omega Chrome addon and setup socks5 proxy to tunnel your browser traffic.
In case you are printing utf-8 characters (e.g. Persian) in a python script use the below workaround at the begining of your file:

# coding: utf-8
Put your views on different design documents in couchDB in order to bypass whole DB lock for indexing. Be cautious that if your database has huge amount of data there will be an hourly lock on couchiDB on all operations!!!

So for example if you have couchDB view on:
http://YOUR_IP:5984/_utils/#/database/YOUR_DATABASE/_design/query/_view/THIS_IS_YOUR_VIEW

Put your view that is on a different category like below:
http://YOUR_IP:5984/_utils/#/database/YOUR_DATABASE/_design/NEW_DESIGN_DOCUMENT/_view/THIS_IS_YOUR_VIEW

This simple trick will prevent database lock on whole operations, the change wiill at least does not affect other views operations.

#couchdb #database #performance #lock #indexing
Get query result from MySQL for last month:

SELECT * FROM users WHERE registration_date >= DATE_SUB(NOW(), INTERVAL 1 MONTH)

#mysql #query #interval #now #date_sub
اسنپ یکی از قابلیت‌های مهم «اوبر» به نام «uberPOOL» را به سیستم خود اضافه می‌کند. بر اساس این طرح، می‌توان تعداد سفرهای تکراری را کاهش داد، هزینه کمتری از مسافر دریافت نمود و البته سهم بیشتری نیز به راننده پرداخت.

در این راهکار که تا دو ماه دیگر عملیاتی می‌شود، مسافرانی که به شکل پیاده کمتر از ۵ دقیقه با هم فاصله داشته باشند می‌توانند از یک خودرو استفاده کنند. در واقع یک اسنپ، با این راهکار دو مسافر را جا‌به‌جا می‌کند و هزینه آن نیز ۳۰ درصد ارزان‌تر است.

#snapp #startup
Projects written in ReactJS:
- uber.com
- ubereats.com
- metbase.com
- trello.com
- instagram
- discordapp.com
Indent in vim:
1- press V and select multiple lines
2- press > (you can press > as many times as you want to indent more)

Unindent in vim:
1- press V and select multiple lines
2- press < (you can press < as many times as you want to unindent more)

#vim #commands #indent #unindent
.format() (new method) is far better than string formatters like %s,%r,%d (old method) from readability, flexibility and other point of views.
In the following pictures this is demonstrated:
Unlike string formatter, formatter() method is consistent with no change in method call.
In old style you cannot give positional index, but in format() you can.
Padding and aligning strings
These operations are not even available in old style, to choose a character for padding! :)
There are tons of these examples for format(), like thousand separator and so. Go for it and explore more.