To write a lambda function (technically inline function) in Python, you can use the “lambda” keyword. You can following example to see the basic usage of a lambda function:
Python 3.7.0 (default, Jun 29 2018, 20:13:13)
[Clang 9.1.0 (clang-902.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> add_function = lambda a,b: a+b
Yes, that is possible!
You can easily do this by triggering the binding-key and type
:setw synchronize-pane on
Now open multiple panes and type your favourite commands, they will now be typed in all the panes!
I had to connect to a new wireless network recently. I have done this several times, but every time I have to go through man pages to find the arguments for the command. So I have decided to document this for everyone:
To view the list of wireless connections:
nmcli device wifi
To connect to the preferred wireless connection:
nmcli device wifi connect Jahans-Wifi password Jahans-Password
Ofcourse you will need to replace Jahans-Wifi with the essid of the connection and Jahans-Password with the actual password for the wifi.
Get the download URL from: https://www.consul.io/downloads.html
On terminal type:
#Download Consul binaries
#Download Consul web app
# Uzip the archives
unzip consul_0.7.5_linux_amd64.zip && unzip consul_0.7.5_web_ui.zip
You can run the following command to start an alpine container:
kubectl run -i --tty alpine --image=alpine --restart=Never -- sh
I generally use SSL Labs qualsys to test servers for cipher strength and supported protocols. However, recently I was presented with a requirement to test a HTTPS server locally.
In past, I have tested such servers via openssl and it does a great job. This time around I came across something called CipherScan:
CipherScan is a great utility to test your SSL configuration specially to enable/disable weak/strong ciphers.
Clone the project and give it a go.
This can easily be acheived by running :
iptables -t nat -L CUSTOMNAME
Where CUSTOMNAME is the name of the chain your are looking for.
You can easily perform this by running the following command:
docker-compose up --force-recreate --build
Please make sure that you are in the same directory as your compose yaml file.
You can print the route table , simply by running the below command:
You can run the following command to get the destination: