Μηνιαία αρχεία: Φεβρουάριος 2017


Fedora 25 with GNOME 3: Making a Wi-Fi hotspot 7

Recently we tried to create a Wi-Fi hotspot on Fedora 25 running GNOME 3.

When we clicked on the Use as Hotspot... button  on the network manager it did not activate the hotspot.
Actually, nothing changed after we clicked on the button.
We tried this several times, some while being disconnected from all networks, others with having the Wi-Fi device disabled etc. None of the tests payed out.

To mitigate the problem, we used nm-connection-editor to create the hotspot configuration and then activate it from the network manager.

After we starter nm-connection-editor, we pressed the Add button to create a new configuration:

From the prompt, we selected the option Wi-Fi and then clicked on the Create... button.

In the newly appeared window, we filled in

  • the Connection name (which is not used by the system, it is only for us to identify which configuration this is),
  • then the SSID (which is the name of the network you will create and connect to),
  • we set Mode to Hotspot

Then we switched to the Wi-Fi Security tab where we filled in the type of protection we want the hotspot to have and the password for it.

We clicked Save and then we closed the Network Connections window as well.

From the network manager, we clicked on Use as Hotspot... button and then the Turn On button on the confirmation popup to finish the activation.

After this, the network manager changed its screen and showed a page which had all the necessary information that are needed to connect to our newly created hotspot.

Note:

In case you cannot connect because the password verification fails even though you are providing the correct password, you can always do the ugly hack of setting up a hotspot with no security to get your job done…


Git: Create a branch on your local machine, switch to it and then push it on the server

Following are a couple of simple commands that we use daily to create a new branch on git and push it to the git server.

The following command will create locally a new branch called branch_name and switch to it.

git checkout -b branch_name;

The following command will push the local branch you are currently switched to on the git server.
It will be made available to the server using the name branch_name.

git push --set-upstream origin branch_name;

How to find the program interpreter that a Linux application requests 1

Recently we tried to execute an application and we got the following error:
-bash: ./main: No such file or directory
This error occurred because our application was trying to use an interpreter that was not available on that machine.
We used the readelf utility that displays information about ELF files (including the interpreter information) to resolve our issue.
Specifically we used readelf -l ./main which displays the information contained in the file’s segment headers, if it has any.
(You can replace the parameter -l with --program-headers or --segments, they are the same).

From the data that was produced we only needed the following line:

[Requesting program interpreter: /lib/ld-linux-armhf.so.3]
so we used grep to filter out all other lines and then cut and tr to get the data after the : character (second column) and then remove all spaces and the ] character from the result.
The full and final command we used was:
readelf -l ./main | grep 'Requesting' | cut -d':' -f2 | tr -d ' ]';

Device has MAC address X, instead of configured address Y.

Recently, we tried to take a network interface down on a VM, when we executed the command

ifdown eth0

we got the following error:

ERROR    : [/etc/sysconfig/network-scripts/ifdown-eth] Device  has MAC address 00:00:00:00:00:00
 00:45:4D:04:02:36
 00:45:4D:04:02:40, instead of configured address 00:45:4D:16:0B:29. Ignoring.

We used ifconfig eth0 to check the information on the network interfaces which resulted in the following data:

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
 inet 10.1.20.115  netmask 255.255.255.0  broadcast 10.1.20.255
 inet6 fe80::215:5dff:fe01:236  prefixlen 64  scopeid 0x20<link>
 ether 00:45:4d:04:02:36  txqueuelen 1000  (Ethernet)
 RX packets 10103919  bytes 5474528935 (5.0 GiB)
 RX errors 0  dropped 0  overruns 0  frame 0
 TX packets 6541413  bytes 1190276207 (1.1 GiB)
 TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

We saw that the value ether for eth0 was 00:45:4d:04:02:36, which was one of the addresses the warning mentioned that are valid.

Apparently, we had an error in the following configuration file:

/etc/sysconfig/network-scripts/ifcfg-eth0

The value for HWADDR was set to 00:45:4D:16:0B:29 which was wrong (most likely this file was copied here from another source), after we updated the value to 00:45:4d:04:02:36 we were able to use the device normally.