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 user@remote.server "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 user@remote.server "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 myemail@gmail.com
}
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 myemail@gmail.com
}
#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.
https://hackernoon.com/python-3-7s-new-builtin-breakpoint-a-quick-tour-4f1aebc444c
#python #python37 #breakpoint #pdb #set_trace
#python #python37 #breakpoint #pdb #set_trace
Hackernoon
Python 3.7’s new builtin breakpoint — a quick tour | HackerNoon
Debugging in Python has always felt a bit “awkward” compared with other languages I’ve worked in.
For
- https://hub.docker.com/r/prom/alertmanager
Awesome
- https://github.com/samber/awesome-prometheus-alerts
- https://awesome-prometheus-alerts.grep.to/rules
So to add
You alert manager configuration may look something like below:
You should be up & running with this sample configurations.
Spread your love for M2SH :)
#prometheus #prom #alert #alert_manager #docker #dockerfile #slack
prometheus
you can use an alert manager, it has a docker file in the link below:- https://hub.docker.com/r/prom/alertmanager
Awesome
Prometheus
alerts:- https://github.com/samber/awesome-prometheus-alerts
alertmanager
has rules, you can see sample rules here in the following link:- https://awesome-prometheus-alerts.grep.to/rules
So to add
alertmanager
service:alertmanager:
image: prom/alertmanager:latest
restart: always
command: --config.file=/etc/alertmanager/alertmanager.yml
volumes:
- ./alert/config/alertmanager.yml:/etc/alertmanager/alertmanager.yml
dns:
- 8.8.8.8
You alert manager configuration may look something like below:
global:
resolve_timeout: 5m
route:
# When a new group of alerts is created by an incoming alert, wait at
# least 'group_wait' to send the initial notification.
# This way ensures that you get multiple alerts for the same group that start
# firing shortly after another are batched together on the first
# notification.
group_wait: 10s
# When the first notification was sent, wait 'group_interval' to send a betch
# of new alerts that started firing for that group.
group_interval: 5m
# If an alert has successfully been sent, wait 'repeat_interval' to
# resend them.
repeat_interval: 30m
# A default receiver
receiver: "slack"
# All the above attributes are inherited by all child routes and can
# overwritten on each.
routes:
- receiver: "slack"
group_wait: 10s
match_re:
severity: error|warning
continue: true
# - receiver: "sms"
# group_wait: 10s
# match_re:
# severity: error
# continue: true
receivers:
- name: "slack"
slack_configs:
- api_url: 'YOUR-WEBHOOK-URL'
send_resolved: true
channel: 'monitoring'
text: "{{ range .Alerts }}<!channel> {{ .Annotations.summary }}\n{{ .Annotations.description }}\n{{ end }}"
# - name: "sms"
# webhook_config:
# - url: http://a.b.c:8080/send/sms
# send_resolved: true
You should be up & running with this sample configurations.
Spread your love for M2SH :)
#prometheus #prom #alert #alert_manager #docker #dockerfile #slack
GitHub
GitHub - samber/awesome-prometheus-alerts: 🚨 Collection of Prometheus alerting rules
🚨 Collection of Prometheus alerting rules. Contribute to samber/awesome-prometheus-alerts development by creating an account on GitHub.
Create a linux SWAP file:
https://linuxize.com/post/create-a-linux-swap-file/
#linux #swap #swapfile #swappiness #swapon #mkswap
https://linuxize.com/post/create-a-linux-swap-file/
#linux #swap #swapfile #swappiness #swapon #mkswap
Linuxize
Create a Linux Swap File
Swap is a space on a disk that is used when the amount of physical RAM memory is full. When a Linux system runs out of RAM, inactive pages are moved from the RAM to the swap space.