Quick nmcli notes

This is a quick post so I can remember these details.

So, on the R810, I am currently running ArchLinux, which uses by default NetworkManager, which I have a love/hate relationship with. At my last job, I recommended removing it from our servers, as under RHEL6, it does very odd things to the network and is hard to manage. I have heard that it is better under RHEL7. But, it does let you do some really cool things. On the R810, there is a cellular modem, and on previous installes, I have had it configured and scripted using nmcli to easily bring up and down the cellular connections.

The problem I am facing now is that my current DHCP server for the house does not let me provide two MAC Address for a single IP, so when I dock the R810, it gets a different IP address than when it is on WiFi. Very annoying. Also, for some reason, it would prefer to use WiFi when the ethernet connection was present, thus giving me a slower connection.

The documentation I found was a bit light in examples and/or dated (I am running version 1.6.2 of NetworkManager, and the examples were from 1.2.x or 1.4.x, which did not work). So, with a bit of expermenting, I finally got it fixed to:

  • Chose the ethernet connection over the Wifi when both are present
  • ‘Clone’ the MAC address of the Wifi NIC to the ethernet NIC

Here are the commands. local is what I called the local ethernet connection, and home-wifi is what I call the house Wifi Network.

  • To set the MAC adress:

nmcli connection modify local ethernet.cloned-mac-address aa:bb:cc:dd:ee:ff

  • To set the connection priorities:

nmcli connection modify local connection.autoconnect-priority 999
nmcli connection modify home-wifi connection.autoconnect-priority 999

Home Network Updates

So, in the last couple of weeks, I have had the following issues:

  • The CMOS battery dies on my file-server (a FreeNAS box), taking it, and the zpools down with it. I fought over a long weekend to recover the data, and in the end, got it mounted read-only, and copied it off. New hardware, and new zpools, and we seem to be going again. Recovering services is taking a bit of time.
  • There is a bug with the ZFS on Root for Antergos Linux. Seems that it does not put all the kernel drivers in the init image when you upgrade. Last time, I booted off the install media to fix it. I lost that USB stick, so I downloaded a new one. Guess what? They have turned that feature off ZFS, so there is no way to recover. Since FreeBSD still does not support suspend/resume on the Acer C720 that is my small travel laptop, I have to reinstall Antergos and reload my data.
  • My main laptop, the HP R810G1 seems to be having major battery issues. I bought a new battery in Novembers, and it died. I bought a new one a couple of weeks ago, and it at first did not seem to be holding a charge. Now, the OS does not see the battery. I think I might need a ‘new’ laptop.

I am torn between getting something one or two reves old with a solid record in the size I want (sub 13″, under 1″ thin, and good 6+ hours of battery) or the latest shiny.

Other news, I have the ownCloud server upgraded to nextcloud, and everything I have tried works out of the box, which is a lot more than I can say for ownCloud. Last major thing I need to recover it the Plex Server!

Updates to AUR packages

So, with the migration of the AUR to version 4, I looked at the 12 AUR packages I had created over the years which I have not looked at in a long, long time.

The list started out with:

In the end, I only kept xlhttp as I do not use the others anymore. Surprisingly enough, only one of the packages (chronicle) was out of date. I disowned all the others, so if you want, you can pick them up.

FreeBSD Challenge II, End Report

And, again, I hit something which is causing massive disk performance issues. That, and suspend/resume does not work on either laptop.

I would try to debug the issues, but that means learning a whole new set of tools, and I will not have time for a while. Next week, I am in week long meetings which will run late every day, and then I have to finish writing and present a training class the last week of the month. The hour or two I can spare will be far better spent for me by backup, re-installing ArchLinux than by starting to learn the tools. Yes, a bit of a cop-out, but I need the machines to do what I need to do. I will keep the servers FreeBSD, however, as it works great there.

I will revisit the issue of FreeBSD on the laptops when I either get new kit, or support for my models gets better.

Perl, Modules, and Package Management

So, even though I have started to work with FreeBSD again , I am still running ArchLinux on my workstation.

And I wanted to run a script I wrote a long time ago to support a website of mine, which I have not updated in a while. The way I would update the site is by doing some batch editing of photos, park them in a directory, and then run my script which pushes the photos to the web server, and then interfaces with the CMS software to schedule the posts and all is good.

Except the script is in perl, and it uses some modules which are not main-stream. While perl has the awesome cpan(1perl) command to fetch and install perl modules, I wanted it to be tied into pacman(8) . A quick trip to the AUR turned up the tools cpan2aur and mkaurball which made it pretty easy to package up and post the the AUR the 9 perl modules I needed to get my script going and keep track of things with pacman.

Yeah!

wifiroamd, Intel PRO/Wireless 3945ABG, and Fedora

wifiroamd, Intel PRO/Wireless 3945ABG, and Fedora

One of the things that has annoyed me about Fedora has been the decision to switch over to using NetworkManager to manage all network connections.

Now, on the service this has a lot of advantages. A lot of work has gone into it, and it just works for a vast majority of the installations out there. They have made it so the move from wired to wireless and back can be done without the user doing anything. They have also seamlessly tied in Dial-Up Networking if you still need a modem or use a wireless modem. They even have two-click access to your VPN which is pretty cool.

All these are things which are very good for Linux users. The biggest drawback to all this? The need for a user-space program to manage the non-hardwired connections. Which means that in order to be able to have any network running besides the good old twisted-pair copper, you have to have a little applet running as you, and it has to have a systray somewhere to display. Which means you have to be a) logged into the system and b) you have to be running a window manager which supports having a system tray. Now, Fedora gives you lots of choices for the second part now days. You have Gnome, KDE, XFCE, and LXDE. All are perfectly usable window managers. But, they still require you to be logged in to X. And, I do not use any of them.

So, what is a cli-loving Fedora user to do? Well, there is this great program called wifiroamd. It will handle the same basic tasks that NetworkManager handles. It will automatically configure your wifi interface and connect to the wifi networks or the locate hardwired NIC if it cannot. You can configure it to run scripts per connection, so for example, you can change your firewall rules for different networks (shields down at home or the office, but up full at the coffee house), or you could bring up your VPN connection when you start using a given wireless network.

One tip I picked up from the author was that if you have multiple AP’s in range, an you want to select once AP over the other, is under the /etc/wifiroamd/connections directory, simply link the AP info you do not want to the one you want:

ln essid:my_home_ap essid:bad_ap

where essid:my_home_ap is your AP with the keys and other information you want, and essid:bad_ap is the one you do not want to connect to. My neighbors have some very powerful AP’s which have a habit of showing up high than mine, but I have no problem with them now.

I have been using this set up under Fedora since FC6 days, but when I upgraded to F10, this stopped working. wifiroamd would try to scan for an AP, and not find anything. The change, it turns out, is that when I switched from using the iw3945 driver to the native iwl3945, wifiroamd could no longer see the wireless NIC due to the wpa_supplicant process, but NetworkManager could. Simply stopping and disabling wp_supplicant and NetworkManager, and wifiroamd started working again! I am a happy camper again.

Command-Line blog posts

So, it only seems fitting that I should talk about a command-line interface to posting on this blog. No, I do not mean using links or the like, but a way to post from the command line.

So, this post is being typed up in vim on my Fedora 8 laptop. I will use this great little tool I found called wppost to post. wwpost is part of the perl module WordPress::Post.

A brief summary of its commands are bellow:

 -c category, can be a list separated by commas, no spaces
-t title
-i description, main body of post, if it has a slash, it is interpreted as a file to slurp
like a text or html file
-D iso formatted date for post, can be left out
-T if there are image attachments, place them as thumbnails only, with link, not just resized

Some usage examples taken from the man page:

 Most basic of usage, (provided you have a ~/.wppost file) wppost -t 'hi everyone' -i 'i just wanted to say hello' If you want to specify two different categories: wppost -t 'Another Apple' -i 'Apples are really great. I do love them so.' -c food,rant -D 20071231 If the body of the post is in a file wppost -t 'title here' -i ./content.txt If the content of the post is in a file and you want to use the file
name as the title wppost -i ./Title_Here.txt If you want to have file attachments: wppost -t 'recent photos' -i 'these are recent pictures i took' ./*jpg

Pretty cool, huh?

Peace out!