Debugging latency using curl
I had an issue recently where I had to debug why a request to a website was taking such a long time. After a bit of searching around, I found the following bit of code:
I had an issue recently where I had to debug why a request to a website was taking such a long time. After a bit of searching around, I found the following bit of code:
I have been working with Linux for years, and I've always used screen when working in the terminal. I even wrote a small introduction to screen over 10 years ago.
So you can imagine my surprise when I at a very late point found out about tmux. It has completely changed the way I work, and boy do I love it.
I am hopefully going to take the second half of my RHCE exam this year, which is EX294. I have taken inspiration from and , and have decided to provide my own answers and explanations as I myself prepare for the exam.
I’ve also only used 4 VM’s in total, 1 controller and 3 nodes, and not 4 nodes as the practice exam suggests.
Here are the tips that I’ve found helpful so far:
I’ve been using vim as my editor of choice ever since I started learning Linux, and something that has been bothering me for a while is how vim handles pasting.
and the result:
It listens on all IPv4 interfaces, and binds to the port you specify, which in my case is 8080. The person on the other side will then be able to access the files in the directory from the outside by going to http://server1.example.com:8080, provided that your machine has the hostname server1.example.com, and that you have the port 8080 forwarded to the IP of server1.
For a while now I’ve been trying to set up VMware to work with multiple monitors, in a Linux guest. With some windowmanagers it works out of the box without any issue, such as with Unity. I never figured out how to do it with xmonad, and recently I switched to i3 just to try something new. The damn “Cycle multiple monitors” button didn’t work here either. When I tried it, a message popped up saying:
The virtual machine must have up-to-date VMware Tools installed and running.
ncat is a utility that is like the UNIX cat command but for network connections. It’s based on the original netcat and comes with a couple of more modern features.
In this short post, we’ll go through a couple of examples to see exactly what uses this tool has. I’m currently using ncat version 7.01, in Ubuntu 16.04. ncat is a part of the nmap package in Ubuntu.
As an example, we have a file named primary_data_file.txt that contains 616 lines of data. We want to split this into 4 files, with the equal amount of lines in each.
The following command should do the trick:
split -da 1 -l $((`wc -l < primary_data_file.txt`/4)) primary_data_file.txt split_file --additional-suffix=".txt"
The option -da generates the suffixes of length 1, as well as using numeric suffixes instead of alphabetical.
The results after running the command are the following files:
With telnet:
With bash:
Replace tcp with udp, depending on what you want.
With netcat:
If the port is open, you will get an output of 0. If it’s closed, it’s a 1.
I just reinstalled one of my machines with Fedora 21. The install went great, but when the machine was done rebooting, and I was trying to set up my access to a wireless network with nmcli (NetworkManager), I got the following error-message:
# nmcli dev
DEVICE TYPE STATE CONNECTION
enp0s25 ethernet unavailable --
lo loopback unmanaged --
wlo1 wifi unmanaged --
..and:
Spending a lot of time finding what the problem was, I finally found the solution. It seems that Wi-Fi support in NetworkManager has been separated to a plugin. The package NetworkManager-wifi was missing. According to Pablo S. Torralba, who was kind enough to comment on this post, it should be enough to kill NetworkManager and launch it again as root. Should that fail, you can always try the old reboot-trick! Either way, it should hopefully be working.