IP Camera Recording Software

The Story

Who doesn’t love a good story? 😀 To start I’ve been running Zoneminder for a while personally, and it’s done great. Then again, it’s been great with older PTZ cameras (think Wanscam). See this blog from 8 years ago (time sure flies).

This is an unpublished blog that I never got around to writing up. So I’m just going to write my experience around IP cameras real quick here and just post this as is.

Zoneminder

OS: Linux

I started off with Zoneminder and it’s still good for free and if you are using older IP cameras just based of JPEG based images streams off HTTP.

However modern cameras usually support RTSP (Real Time Streaming Protocol).

I haven’t used the product in a while, and maybe they support that now, but when I originally started to write this article they didn’t. Checking the home page looks pretty modern, so possibly the application is even better then when I first started using it.

Overall I liked Zoneminder. Though the management UI was def lacking and dated.

Shinobi

OS: Linux

For a good while I ran Shinobi which amazing still seems to be supporting the latest Ubuntu release. However, I found the application to be buggy and the community to be lacking.

Installation was a pain. Management was a pain. Data Retention was a pain, support was a pain.

But if you had it up and running properly, it did well for itself. At least in supporting RTSP and motion detection and file recording quality.

XProtect

OS: Windows

My cousin told me about this product by Milestone Systems: XProtect. I dabbled with this one a bit, overall, I liked it. The setup was OK, as most windows setups are, just double click and wizard away.

The Design was for the most part intuitive, some design aspects I felt were a bit clunky, and the software felt like it ran on an older framework (which I’m all for, given it remains stable).

Installation of Cameras I remember wasn’t too bad, but it’s been a while since I used it, and I unfortunately never blogged about its install and use. Sorry.

When my bike got stolen from my Garage and I had to go back to view footage, it was nice as it kept all recording for up to a defined point, and motion detected section where highlighted. This made it really easy to find the section of interest and export the video for evidence submission.

Being Windows and all it is of course more resource intensive then the linux counter parts, but if compute power is not a concern then I’d def say give this one a shot.

  Surveillance Station by Synology

OS: Embedded Linux

If you happen to use a Synology NAS, did you know it comes with 2 licenses for Surveillance Station. If you have any modern IP Cameras this is by far the best option.

Installation is a breeze, just look for the app in DiskStation Manager (DSM), install, done.

Given you don’t have any complex networks with firewalls blocking traffic (flat layer 2 switched is best), installation of IP Cameras is also unreal easy as you are more then likely to find your Camera in the provided device list.

For me this was the case with some more modern based IP cameras, then simple auth configuration, IP configurations and you’re off to the races. Configuring motion detection was also fairly straight forward with this application.

The thing is you only get two licenses for 2 IP cameras, if you have more you have to shell out a license for each one, they are perpetual, so there’s at least that.

Surveillance Station by QNAP

OS: Embedded Linux

If you happen to run a QNAP, they have similar software available under the exact same name.

I tested this out with a QNAP and some older cameras, I did manage to get them connected but still haven’t got motion recording to work, for some reason it seems to want to rely on FTP service on the host NAS, even though it’s running on it and could easily in theory save to a path the NAS itself can write to. This seems rather dumb, I’ll have to further test to find out but this one is nowhere near as nice as Synology’s version.

Blue Iris

OS: Windows

There’s also this one I’ve heard about and come across when searching for solutions, which is a product called Blue Iris. I personally have not had the chance to play with this software so I can’t comment on it’s installation, and ease of use.

If you’ve used this product, please leave a comment with your experiences.

That’s all for this old never posted post, that will now be posted. Cheers.

Fixing Vaultwarden 502 Bad Gateway

So anyway, the other day I updated the base OS for the instance of Vaultwarden I’m running. If you are interested in setting up your own you can follow this old guide, however you’ll have to note the YML config differences as noted in my other post upgrading to Vaultwarden, and this post.

It’s running on Ubuntu which was easy enough to update to the latest release build.

apt update
apt upgrade
reboot
do-release-upgrade

Simple enough, and everything went to plan. I made backups along each step too. The service was up, and life was good after a full complete system upgrade. Yay… or so I thought…. until I went to bring up a instance of pihole via docker compose and it errored out on me. When I looked up the error it seemed to be related to python.

So, I figured I’d install it, or try to?

Da faq? I remember this python/pip stuff being a pain intially too, what did I run again?

OK, maybe need to get the newer stuff? Old one no good?

Not now Kaa!!! let’s see…

apt install python3-pip

and…

pip install docker-compose

Looks like the command is working again. 🙂

But after pulling the latest build, and bringing it back up, there were no errors return to the command, but when I tried to access the service all I got was a 502 Gad Gateway from the loadbalancer. Since I knew it lived outside the container and was unaltered that it most likely was not the culprit, I ask on the #nginx channel and was told to check the container status with:

docker ps

OK, but why? then another helpful hint by a user:

docker-compose logs -f

This is when things get a bit weird/funny. I found this post about the SMTP Depreciated Warning, which stated that had nothing to do with the service not coming up. Which then linked to this issue post more likely to be the cause.

So, I kept trying, the log wouldn’t change from the snip above, I thought for sure, it has to be this “Rocket Address”, surely. I just wasn’t sure what .env was in that issue’s context. Another helpful hint from IRC:

docker inspect bitwardenzewwyca_app_1

When looking at it was already defined as 0.0.0.0.

This post, same exact problem, saying the exact same thing, but I don’t know what env.sh is in their context either, slowly losing hope, despair ensues.

I even try changing the log location, create a file, with cmod 777 on it:

Dang it! But this is when things take a strange turn…. I decided even though the SMTP_SSL wasn’t the root cause to change it anyway as it suggests:

changed SMTP_SSL=false to SMTP_SECURITY=false

Well, it finally shut up about the depreciated setting, but same dang issue, can I just get rid of the log file option? (since it’s just in the yml config file anyway…) Get rid of the log file entry in the YML file, and then…

Woah a different error message, wait the option is important, and I marked it wrong, ok final changed

changed SMTP_Security=false to SMTP_SECURITY=off.

bring down and up the container and…

Ehhhhhhhhh! My Vaultwardens back! Time to see if I can bring up ze PiHole!

I hope this post helps someone in the same boat.

Irssi on QNAP TS-212p

Back Story

As you may or may not know my ASUS RT-N16 shit the bed after I tried to beef up the cooling system on it; some unreal strong double-sided tape instead of regular thermal paste was used from factory. Anyway I loved it since it was almost always running and kept my chat history persistent in the channel’s I was in. I recently tried lubuntu, and while it was nice I didn’t like having a VM to manage, and sucking up resources for such a small requirement. It’s like using a sledgehammer to drive a frame mounting nail. Anyway, I still h ave this really old NAS kicking around that does a great job; a QNAP TS-212p. Looking at the available apps in the app center wasn’t exactly overwhelming. Googling I found this nice thread of someone asking the exact same thing…. over 10 years ago.

Not good, but like my original post of getting Optware on the ASUS -RT-N16 so I remained hopeful. The basic answer he came back with, after someone called him out for the usual useless “I fixed it myself answer”, was that they installed Optware then Irssi.

Oh Nice… OK…  What is Optware and how do you install Optware?

“OBSELETE: as of January 2019, Optware is no longer listed in the QNAP “App Center”. It appears that QNAP withdrew it sometime in 2015 or 2016. Entware is a non-QNAP QPKG which serves the same purpose of giving access to many command-line software tools used on a wide range of NAS systems.”

What kind of useless shit tits is this? FFS, ok so “ipkg” is Optware (defunct) and “opkg” is Entware. The link in the Wiki to Entware is a blank wiki page, great. OK, jesus, How do I install Entware?

Well, I googled; I found this one nice thread which asks what I was initially going for “Optware on TS-212“, which all comes down to what we already figured out, Optware is dead and Entware has taken over, and the only link in the thread to Entware is dead. Pricks. Here’s a reddit thread I found kind of discussing the different version of Entware, but again no help on installation.

Installing Entware

Searching some more I eventually found this link, which is apparently the source. It seems most downloads are based around the CPU architecture, while some are very specific based on the QNAP model. So, I searched for that as well and seems it’s ARM based.

So, I downloaded the ARM based image, and clicked into App Center in the QNAP Web MGMT, clicked manual upload and…

Holy crap it worked. Checking the console…

Nice! OK, but just before we move on, I have a couple questions…

Where are Apps going to be installed to? When I did this on the router it required /opt be mounted to a USB drive to store the data as the router has no storage of its own. Now a NAS does, but the firmware is one part, and the OS the other. Doing a df -h shows me a bit of info I may need to take note of:

As you can see / only has 16 MB of space, however doing a ls -la on the root showed me that opt is linked to the primary NAS’s storage:

Add User

Now like mentioned in my ASSU post running Tomato that I’m not a fan running things in admin space, let’s see if I can do the same and make a standard user for running irssi. In that post there seemed to have been a bug/logical design issue when attempting to use adduser, quickly googling I see a post all the way back from 2008 showing code using adduser (*Note the difference between useradd and adduser) and no complaints, so let’s try the simple thing first.

adduser {username}

My concern was the home path.

As you can see I checked and since /home is linked to /mnt/ext/home and /mnt is mounted to root, there’d only be 16M available on this user home path. Switching to the user,changing to the home path, and checking it shows its actually under /opt, so we’re fine.

Can I SSH in as this user? Appears that’s a no, mhmmmm what did I miss. Searching the interwebs I came across this interesting thread

First suggestion is to use the Web UI to provide the permission, but I could only see the user that was created via the UI, and the user created in the above snippet was not showing to grant permission to… someone in the thread states:

“The ‘Edit Access Permission’ page only gives you a list of administrators, not all users.

To allow other than administrators access you need to install your own version of ssh server. If you really want to do this then search the forum as it has been done before.” -Don

Why? Who knows, what a PITA, the OP apparently went the extra distance to do it just to have it fail on him anyway. Trying telnet the putty window just closes instantly when I try, now I can try a couple things which is can do as Don suggested and the OP tried running OpenSSH server via Entware which we just got installed.

Mhmmm when I click on user within the UI, it does see the account. *thinking….* no way it worked…..

So, since I did see the account in the UI, and as Don mentioned, and the final comment by chrisonnas. I added the account above to the administrators group, then went back into the edit access permission and the zewwy account was there, granted access to ssh (my exiting connection drop, indicative of the change applying and the service restarting). SSH in as the newly craeted account and success! Yes.

I then went back in the UI and removed Administrative rights, and was still able to SSH in, boo yeah.

OK, now Irssi finally!

Installing Irssi

opkg install irssi

Da faq?

What packages exist?

Uhhh, cause I didn’t update from source?

FFS man… No way… This worked?!?!

“OK, fixed by opkg install opkg …”

opkg install opkg

This isn’t going to work, cause it’s already poo…..

Sweet Jesus Murphey… ok.. now install Irssi?

opkg install irssi

Alright! Wo-wo-wo-wo! Now can the standard Zewwy user do a screen instance, and run Irssi??!?!?

SSH in: Check
Screen session: Check
Irssi:

sometimes… man…  I was about to give up when I spun up lubuntu to hope on IRC (LOL) to ask for help, I wasn’t sure where to ask, the #qnap channel in libera.chat was dead, I knew #linux was a busy place and the QNAP runs on linux. So I asked for help there. There was a friendly guy by the name of DLange who was nice enough to tell me the “Entware ship had set sailed 5 years ago”. Which kind of matches the time frame. Then out of nowhere another friendly chap by the name of Nei shared this QNAP thread with someone having the same issue but for nano instead of irssi.

checking the version, he motioned was the exact one I linked and downloaded. The only diff was the update/ upgrade commands…

so…

opkg update
opkg upgrade

Irssi:  CHECK! (finally dang nabbit)

Then do your basic Irssi setups like auto network joining, and the likes. 🙂

See you on IRC. 😀

/ignore -channels #channel * JOINS PARTS QUITS NICKS

ASUS calling Microsoft

Back Story

I’ll try to keep this post short as I’m behind on many other posts I have to finish. hahah :S

Anyway, I was thinking it’s time to update my pihole, when I checked the admin web interface to check for clients to see who’d still be using it for DNS, and then I’d make a list and be prepared to change them as required (any outside of DHCP of course, as I’d simply change the IP there). Now you might be wondering, why change the IP address? Which is a fair question, I could just update the one in question, but I had bigger plans to move it to another server, I didn’t want to give the other server multiple IPs, so I figured it be easier to spin up the new service on that server and simply change the DNS on the DHCP server/service. Anyway… where was I, oh right, checking the web admin I noticed the top client was my new ASUS RT-AX88U. I was hoping to get a model that supported Tomato like the old RT-N16 I had for so many years which I recently broke and so replaced it with this unit. It currently can’t run Tomato like I managed to do with the RT-N16. So, I just had configured it for AP mode. Figured it doesn’t need to do much else for now besides serve unreal good WiFi.

Yet it’s calling home to “dns.msftncsi.com”, when I looked up this domain it seems to be used mostly by windows machines to check to make sure they are online.

Fix This

Looking a bit further into it I managed to find this magical Reddit post (I really love reddit, I’ve found so many helpful posts there). Anyway let’s see if we can follow the steps on this router.

Step 1 – Enable Access

The source uses telnet, but I’m not a fan of transferring creds in cleartext, unless I know for certain it’s a completely isolated network. Since the router supports SSH, I enabled that instead and logged in. *note* I had to remove the fingerprint from the old RT-N16 I used to SSH into.

Step 2 – Gain Shell Access to your Router

login & password is the same as the web interface.

K, with that done, let’s see if we can edit the nvram, but let’s take a look as the OP suggests.

Step 3 – Look deep into NVRAM

nvram show | sort | less

I used the less command instead, as my old linux instructor once said “less is more” using less you can use the up and down arrow keys to scroll through the results, and look-e-here: (Press Q to exit less)

Step 4 – Finding the Droids

The droids I was after. Time to eliminate them.

Step 5 – Kill the Probe Content Droid

nvram set dns_probe_content=127.0.0.1

Step 6 – Kill the Probe Host Droid

nvram set dns_probe_host=""

Step 7 – Prevent Droid Resurrection

nvram commit

Step 8 – Fully Enforce Your New Empire

reboot

Verify:

Noice!

Logging out equals deletion of backups
According to Google

I’m going to keep this one really short. I went to add my device to MDM. Required a factory wipe, I wanted to save my Text messages. So, I followed the steps to go into my Android device, settings, system, backups. I checked the items selected SMS, click backup now. It finishes.

Instead of just factory wiping I decided to sign out of the phone first, before factory wiping. BIG MISTAKE, this deleted the very backup I created.

Check this Google Issue tracker for details, Google has known about it for well over a year and has not fixed it.

So, did the best due diligence I could just to have a logical design flaw destroy my backups. Thank you Google, you taught me a valuable lesson. What’s that you ask. Well, that’s to be like a tree, and woooooooooosh! *Anger management joke*, what can I say, this pissed me off.

When easy becomes hard; Go MacGyver

Today I had to install a switch in a rack, sounds easy right 🙂

The first issue was that there was only 1u of space available and the slot did not have cage nuts installed. Even with the sides off the rack ears were still in the way, and if you ever installed cage nuts you know they are installed from behind. Then I watched this nice trick on YouTube using this tool “Cage nut puller”.

As you watch the video @ the 9 second mark you can see installing the nut and his hands are taking up roughly 3u of rack space, and even then, he mentions that it’s not recommended and difficult. However, I don’t have this tool.

I figured I would just unmount the old switch (as it was being replaced) and use the existing cage nuts there. When I went to remove it, there was a PDU in the way, and I didn’t have a stubby Robinson available, ended up using the bit and a wrench, but the head was stripped. After a while ended up having to use the wrench right on the screw head to get it off, how did the head get stripped you make ask? Well, I guess when it was installed by the previous tech the screws were cross threaded into the nuts (not proper thread screw). When I went to remove the last screw right before the screw got loose, the cage nut popped out of the rack ear…. So, I had to get a colleague to use the plyers to hold the old cage not in place, while I finished unscrewing it. Pretty crazy how long this took considering how long it should have taken.

So even the plan to use the existing cage nuts was useless since they had been cross threaded. I still didn’t have the tool I needed, so I ended up looking around the filing room, and I found a lanyard with a metal card clip, the metal “arms” that hold the card looked exactly like the end of the tool mentioned in the YT video. So I ended up using the concrete in the stairwell to grind down the pivot arm that was holding both parts together, then used plyers to flatten the ends to make the base of the cage nut puller tool.

Here’s a clip of me using this MacGyver’d tool to replace the cage nuts, well the clip is using it to install the cage nut after the old one had been removed. The snaping sound is soooo satisfying.

3TB Drive Shows up as 750GB

There’s a lot of stuff on this, so I’ll keep it short.

On windows, check Intle RST drivers (assuming there storage controller the hard drive is connected to is Intel based).

In my case it was behind a USB Enclosure. The drive showed properly as 3TB, but it didn’t recognize the File Systems.

Figuring I could see the files in linux that’s when the problem presented itself.

Lucky for me I had another machine that was 64 bit and had sata ports, plugged it into that and checked there (the storage controller was old nvidia nforce4, if anyone remembers that lol)

and it worked it saw the drive. When I went to mount the partition though it stated “unknown filesystem type ‘linux_raid_member’

So I did the same thing and mounted it using mdadm, I also had to do “mdadm –stop /dev/md0” or else it always say the /dev/sdb3 was busy.  Strange.

This was cause the drive was from a RAID 1 member, so all files were accessible.

Never seen this one before, and yes I’m aware of 2TB limit of 32 bit systems, So I knew that was not the issue. This was good to know though in case of future file recovery attempts. 🙂

TPM security on a ESXi VM

Great part about vSphere 7 is it introduced the ability to add a TPM based hardware to a VM.

Let’s see if we can pull it off in our lab.

What I need a Key Provider, Lucky for use with 7.0.3 VMware provides a “Native Key Provider

During my deployment of the NKP, one requirement is to make a backup of the key I guess, which was failing for me. I found this VMware thread with someone having the same issue.

Sure enough, the comment by “acartwright” was pretty helpful, as I too opened the browser console and noticed the CORS errors. The only diff was I wasn’t using CNAMEs, per say, but I had done a pilot of vCenter renaming. the fact the names showing up as not matching and the ones that were listed in the console reminded me of that. When I went to check the hostname, and local host file, sure enough they had the incorrect name in there.

So, after following the steps in my old blog post to fix the hostname and the localhosts file, I tried to backup the NKP and it worked this time. 😀

So, sure there after this I went to add the TPM and I couldn’t find it, oh right it’s a newer feature, I’ll have to update the VM’s compatibility mode.

Made snapshot, updated to latest hardware ID, boots fine, lets add the TPM hardware, error can’t add TPM with snapshots. Ugh, fine delete snapshot (tested VM boots fine before doing this), add TPM success.

Before changing the VM boot option to EFI, boot the VM and boot the OS into Windows RE, use mbr2gpt command to convert the boot partitions to the proper type supported by EFI.

Once completed, change VM boot options to EFI, and check off secure boot.

Congrats you just configured a ESXi VM with a vTPM module. 🙂

 

Updating Power CLI 12

If you did an offline install, you may need to grab the package files from an online machine. Otherwise, you may have come across a warning error about an existing instance of power CLI when you go to run the main install cmdlet.

When I first went to run this, it told me the version would be installed “side-by-side” with my old version. Oh yeah, I forgot I did that…

Alright, so I use the force toggle, and it fails again… Oi…

Lucky for me the world is full of blogger these days and someone else had also come across this problem for the exact same reason.

VMware.PowerCLI install update error – Install-Package: Authenticode issuer | vGeek – Tales from real IT system Administration environment (vcloud-lab.com)

If you want all the nitty details check out their post, the main part I need was this one line, “This issue can be resolved deleting modules from the PowerShell modules folder inside Program Files. Once the modules folder for VMware are deleted try installing modules again, you can also mention the modules installation scope.”

AKA, Delete the old one, or point install to other location. He states he needed the old version but doesn’t specify for what. Anyway, I’ll just delete the old files.

So, at this point I figured I was going to have a snippet of a 100% clean install, but no, again something happened, and it is discussed here.

If I’m lucky I will not need to use any of the conflicting cmdlets and if I do; I’ll follow the suggestions in that thread.

OK let’s move on. Well, the commands were still not there, looks this has to succeed, and there’s no prefix option during install only import, which you can only do after install, the other option was to clobber the install. Not interested, so I went into Windows add/remove features, and removed the PowerShell module for Hyper-V. No reboot required, and the install worked.

the Hyper-v MMC snap in still works for most of my needs. Now that I finally have the 2 required pre-reqs in place.

Step 2a) connect to server via Power CLI

Why did this happen?

A: Cause self signed certificate on vCenter, and system accessing it doesn’t have the vCenter’s CA certificate in its own trusted ca store.

How can it be resolved?

A:  Option 1) Have a proper PKI deployed, get a proper signed cert for this service by the CA admin, assign the cert to the vCenter mgmt services. This option is outside the scope of this post.

Option 2) Install the Self Sign CA cert into the machine that’s running PowerCLI’s machine store’s trusted CA folder.

Option 3) Set the PowerCLI parameter settings to prompt to accept untrusted certificates.

I chose option 3:

Make sure when you set your variable to use single quotes and not double quotes (why this parameter takes system.string instead of secureString is beyond me).

While I understand the importance of PowerShell for scripting and automation and mass deployment situations, requiring it to apply a single toggle setting is a bit redic, take note VMware; Do better.

ACME HTTP Validation with HTTPs redirection

I had this got this to work with this requirement for an external A host record, redirects, negate rules. It was quite complex, and, in the end, it did work. I was excited, I got ready to write this long post, then I realized, I had somehow missed the obvious. I found this post on the forms with someone having the exact same issue what amazed me the most, was how simple their solution was.

So, I tested it…

The HTTP to HTTPS redirect condition:

and this will take any HTTP request and convert them into HTTPS.  If you configured HTTP validation though this will be a problem when the request from ACME comes in to hit the backend created by the ACME plugin.

As stated by the guy, he simply made a clone of the condition, and made it a negate.

then apply it to the redirect rule…

then apply this to the http listener

Test a cert renewal… it worked

That was way simpler than I thought up. lol

Hope this helps someone.