Visual Studio Live Share
Real-time collaborative development can be done using live share plugin. Coders can work simultanously o nthe same file without an interruption:
- https://visualstudio.microsoft.com/services/live-share/
#IDE #microsoft #liveshare #plugin #visualstudio
Visual Studio
Live Share: Real-Time Code Collaboration & Pair Programming
Real-time collaborative code editor for pair programming, code reviews, technical interviews and more.
One of the methods to document your API is
To read more about the
- https://apidocjs.com/
#javascript #js #python #apidoc #apidocjs #api #documentation #rest #annotation
APIDOC
. It uses annotation in variety of languages like Python
, PHP
, JS
, etc. At the below code block you can see an example in Python
:"""
@api {get} /user/:id Request User information
@apiName GetUser
@apiGroup User
@apiParam {Number} id Users unique ID.
@apiSuccess {String} firstname Firstname of the User.
@apiSuccess {String} lastname Lastname of the User.
"""
To read more about the
APIDOC
itself and the installation process head over to link below:- https://apidocjs.com/
#javascript #js #python #apidoc #apidocjs #api #documentation #rest #annotation
https://superuser.com/questions/453988/whats-the-difference-between-su-with-and-without-hyphen
#linux #su
#linux #su
Super User
What's the difference between "su" with and without hyphen?
I'm quite new to Linux terminal and I'm not quite sure what the difference between su with a hyphen and su without a hyphen is, for example: su - username vs. su username.
I looked into the documen...
I looked into the documen...
Bamilo has reached its end!
The ecommerce website
- https://www.bamilo.com/
#bamilo #digikala #failure #ecommerce #snapp
The ecommerce website
Bamilo
which tried hard to combat with Digikala
has closed down. The domain now redirects to snapp market
:- https://www.bamilo.com/
#bamilo #digikala #failure #ecommerce #snapp
DO NOT USE UWSGI multi-threaded mode with alpine image!
I've been stuck on this issue for a couple of days as our service returned 503 Gateway timeout while our server load was totally ok around 1.0 (1m load average). So our load test got failed at the be beginning of the test! We found out it is related to docker base image of python alpine. Use python slim image instead. Or in case you have many changes you can stick with alpine and change thread to 1 in uswgi configuration file.
#docker #alpine #uwsgi #python #slim #respawn
I've been stuck on this issue for a couple of days as our service returned 503 Gateway timeout while our server load was totally ok around 1.0 (1m load average). So our load test got failed at the be beginning of the test! We found out it is related to docker base image of python alpine. Use python slim image instead. Or in case you have many changes you can stick with alpine and change thread to 1 in uswgi configuration file.
#docker #alpine #uwsgi #python #slim #respawn
A screamingly fast Python 2/3 WSGI server written in C.
https://github.com/jonashaag/bjoern
#wsgi #python2 #python3
https://github.com/jonashaag/bjoern
#wsgi #python2 #python3
GitHub
GitHub - jonashaag/bjoern: A screamingly fast Python 2/3 WSGI server written in C.
A screamingly fast Python 2/3 WSGI server written in C. - jonashaag/bjoern
Do you log a lot like me in your
You can see that both have the same log content but it's hard to follow
The formatter is as below:
Now the output will something like below:
You can see that log content is so much easier to follow by using space padding. It may not be obvious on telegram with small devices. So try it your self :)))
#python #logging #log #logger #formatter #log_formatter #space_padding #padding
Python
modules? If so, you had the same problem to always find the first occurence of a log after time, filename, etc. Let's clarify this with a sample log:[2012-10-02 application.py:1 _get()] DEBUG: this is a log content
[2012-10-02 db.py:1005 _fetch_all_info()] INFO: this is a log content
You can see that both have the same log content but it's hard to follow
cause of length of file name, line number and function name. To format this better we can have space padding in formatters. spaces are identified by `s
. Now lets see the same log, but this time with space padding.The formatter is as below:
[%(asctime)s %(filename)15s:%(lineno)4s %(funcName)20s()] %(levelname)s %(message)s
NOTE: this is not the exact formatter for the above log, it is for demonstration!
Now the output will something like below:
[2012-10-02 application.py: 1 _get()] DEBUG: this is a log content
[2012-10-02 db.py: 1005 _fetch_all_info()] DEBUG: this is a log content
You can see that log content is so much easier to follow by using space padding. It may not be obvious on telegram with small devices. So try it your self :)))
#python #logging #log #logger #formatter #log_formatter #space_padding #padding
How does kubernetes scheduler work?
uling works in Kubernetes.
https://jvns.ca/blog/2017/07/27/how-does-the-kubernetes-scheduler-work/
#containerization #kubernetes #scheduler #pods #kubectl
Stripe
engineer Julia Evans
has written a delightfully clear explanation of how sched‐uling works in Kubernetes.
https://jvns.ca/blog/2017/07/27/how-does-the-kubernetes-scheduler-work/
#containerization #kubernetes #scheduler #pods #kubectl
Julia Evans
How does the Kubernetes scheduler work?
Hello! We talked about Kubernetes’ overall architecture a while back.
In
gist in github for it:
- https://gist.github.com/SanderTheDragon/1331397932abaa1d6fbbf63baed5f043
Download shell and run it! (Be careful and read any shell script before running it, I've read it myself)
Now you can add it to favorites and have instant access to it.
Spread your love for m2sh :)))
#postman #debian #ubuntu #shell #gist #github
Debian
based OSes if you want to install Postman
you need to download the binary package and run it everytime you need. But there is a better way for it that you can access Postman
system wide. There isgist in github for it:
- https://gist.github.com/SanderTheDragon/1331397932abaa1d6fbbf63baed5f043
Download shell and run it! (Be careful and read any shell script before running it, I've read it myself)
Now you can add it to favorites and have instant access to it.
Spread your love for m2sh :)))
#postman #debian #ubuntu #shell #gist #github
Gist
A shellscript to create a Postman .deb file, for simple installation on Debian-based Linux distro's. Also creates a .desktop file.
A shellscript to create a Postman .deb file, for simple installation on Debian-based Linux distro's. Also creates a .desktop file. - postman-deb.sh
What is the difference between following 2
And:
Read about it here:
- https://stackoverflow.com/questions/18982610/difference-between-except-and-except-exception-as-e-in-python
#python #try #except
try excepts
?try:
pass
except:
pass
And:
try:
pass
except Exception:
pass
Read about it here:
- https://stackoverflow.com/questions/18982610/difference-between-except-and-except-exception-as-e-in-python
#python #try #except
Stack Overflow
Difference between except: and except Exception as e: in Python
Both the following snippets of code do the same thing. They catch every exception and execute the code in the except: block
Snippet 1 -
try:
#some code that may throw an exception
except:
#
Snippet 1 -
try:
#some code that may throw an exception
except:
#
Enable
open settings in telegram desktop and without clicking anywhere type
Spread your love for m2sh :)
#telegram #trick #fun #workmode #work_mode
workmode
in Telegram:open settings in telegram desktop and without clicking anywhere type
workmode
a dialog will open to confirm that want it to be enabled. After telegram restart you willl have a new bar above chat accounts -> Hide muted chats
click on it to hide muted chats from the left pane.Spread your love for m2sh :)
#telegram #trick #fun #workmode #work_mode
https://stackoverflow.com/questions/13032409/ssh-remote-variable-assignment
#linux #sysadmin #ssh #local_variable #variable_expansion #bashrc #export
#linux #sysadmin #ssh #local_variable #variable_expansion #bashrc #export
Stack Overflow
ssh remote variable assignment?
The following does not work for me:
ssh [email protected] "k=5; echo $k;"
it just returns an empty line.
How can I assign a variable on a remote session (ssh)?
Note: My question is not about ...
ssh [email protected] "k=5; echo $k;"
it just returns an empty line.
How can I assign a variable on a remote session (ssh)?
Note: My question is not about ...
In order to enable bash completion in Kubernetes you can usee the below command in linux bash:
Now to test this enter the below command and you should see the completion:
It should be expanded to
#linux #bash #shell #kubernetes #kubectl
source <(kubectl completion bash)
Now to test this enter the below command and you should see the completion:
kubectl cl<TAB>
It should be expanded to
kubectl cluster-info
.#linux #bash #shell #kubernetes #kubectl
EMQ X broker is a fully open source, highly scalable, highly available distributed MQTT messaging broker for IoT, M2M and Mobile applications that can handle tens of millions of concurrent clients.
Starting from 3.0 release, EMQ X broker fully supports MQTT V5.0 protocol specifications and backward compatible with MQTT V3.1 and V3.1.1, as well as other communication protocols such as MQTT-SN, CoAP, LwM2M, WebSocket and STOMP. The 3.0 release of the EMQ X broker can scaled to 10+ million concurrent MQTT connections on one cluster.
#github #emqx #mqtt #pubsub #wss #ws #websocket #web_socket
Starting from 3.0 release, EMQ X broker fully supports MQTT V5.0 protocol specifications and backward compatible with MQTT V3.1 and V3.1.1, as well as other communication protocols such as MQTT-SN, CoAP, LwM2M, WebSocket and STOMP. The 3.0 release of the EMQ X broker can scaled to 10+ million concurrent MQTT connections on one cluster.
https://github.com/emqx/emqx
#github #emqx #mqtt #pubsub #wss #ws #websocket #web_socket
tuples
vs list
from a different point of view. Tuples of constants can be precomputed by Python's peephole optimizer or AST-optimizer. Lists, on the other hand, get built-up from scratch:>>> from dis import dis
>>> dis(compile("(10, 'abc')", '', 'eval'))
1 0 LOAD_CONST 2 ((10, 'abc'))
3 RETURN_VALUE
>>> dis(compile("[10, 'abc']", '', 'eval'))
1 0 LOAD_CONST 0 (10)
3 LOAD_CONST 1 ('abc')
6 BUILD_LIST 2
9 RETURN_VALUE
#python #list #tuple #performance #dis #compile #ast_optimizer
Caddy
is the HTTP/2 web server with automatic HTTPS. I wanted to proxy pass websocket service using Caddy
but it didn't work:wss.example.org {
proxy / myservice:8083 {
header_upstream Host {host}
header_upstream X-Real-IP {remote}
}
tls [email protected]
}
In the documentation it is mentioned that
proxy
can proxy pass web sockets too. The problem was about not using websocket
inside of the proxy stanza, so we solved it using:wss.example.org {
proxy / myservice:8083 {
header_upstream Host {host}
header_upstream X-Real-IP {remote}
websocket
}
tls [email protected]
}
#webserver #caddy #proxy #proxy_pass #wss #ws #websocket
From Discover on Google https://nickjanetakis.com/blog/15-useful-flask-extensions-and-libraries-that-i-use-in-every-project
Nick Janetakis
15 Useful Flask Extensions and Libraries That I Use in Every Project — Nick Janetakis
Part of the benefit of using a popular web framework is the thriving community around it. Here's my favorite Flask extensions.