JTK – Notes and Ramblings Things we have found …

6/3/2019

Unifi vs Java

Filed under: General,Router/PC Config — taing @ 10:05 pm

For version 5.10.24 of Unifi Controller software on Ubuntu 18.04 LTS with Java jdk 8u211 Unifi was unable to locate java home.

My solution was to edit /etc/init.d/unifi. In the function set_java_home() change the entire contents to:

JAVA_HOME=type -p java|xargs readlink -f|xargs dirname|xargs dirname

This is based on a discussion at https://community.ubnt.com/t5/UniFi-Wireless/Java-Home-Directory-Fail-Issue-on-Ubuntu-RESOLVED/td-p/474037.

This, strangely, was not an issue on a separate install. The difference seems to be IBM Java vs OpenJDK. Only the IBM Java system had the issue.

1/6/2019

Nut vs my UPS

Filed under: General,Router/PC Config — taing @ 1:38 am

Nut has been setup and running mostly successfully on the LAN for a few years. Most of the small units are APC, larger unit in the basement is a CyberPower. I replaced one of the units with a small CyberPower CP1500AVR. It refused to cooperate via usb. According to the everything I could find online it should use the same usbhid-ups driver the previous unit had. Instead, I get a myriad of usb errors in dmesg.

I followed the recommendations of several online guide for configuring nut to see what I had missed previously to no avail. Several writer indicated they had similar and other issues with CyberPower usb connections.

Both http://tedfelix.com/software/nut-network-ups-tools.html and https://nmaggioni.xyz/2017/03/14/NUT-CyberPower-UPS/ had helpful pointers.

The most significant being the proper udev rules(from /lib/udev/rules.d/52-nut-usbups.rules) and the potential need to increase the pollinterval and deadtime.

Refer to my earlier post for configuring Nut on Windows.

1/5/2019

Centos FTP server – vsftpd

Filed under: General,Router/PC Config — taing @ 9:33 pm

Using tutorials from https://linuxize.com/post/how-to-setup-ftp-server-with-vsftpd-on-centos-7/ and https://www.tecmint.com/install-ftp-server-in-centos-7/.

Install vsftpd:

yum install vsftpd

Edit /etc/vsftpd/vsftpd.conf:

anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_std_format=YES
listen=YES
listen_address=192.168.0.1
# ip address of the server
listen_ipv6=NO
pam_service_name=vsftpd
userlist_enable=YES
userlist_file=/etc/vsftpd/vsftpd.userlist
userlist_deny=NO
chroot_local_user=YES
user_sub_token=$USER
local_root=/home/$USER/ftp
tcp_wrappers=YES

Create a ftp user, add it to /etc/vsftpd/vsftpduserlist and create directories:

adduser newftpuser
passwd newftpuser

echo "newftpuser" | sudo tee -a /etc/vsftpd/user_list

mkdir -p /home/newftpuser/ftp/upload
chmod 550 /home/newftpuser/ftp
chmod 750 /home/newftpuser/ftp/upload
chown -R newftpuser: /home/newftpuser/ftp

usermod newftpuser -s /bin/nologin

Start the server and enable it to run as a daemon at startup:

systemctl start vsftpd
systemctl enable vsftpd

Things should be up and running. This is not a secure server. We did not create a certificate or enable TLS. User credentials will be sent as plain text. The server is only listening on the one specified interface. We did not make any firewall adjustments.

12/23/2018

Can’t access c$

Filed under: General,Router/PC Config — taing @ 5:54 pm

Recently I found on one of my systems that I was unable to access c$ even when using admin credentials. The solution can be found at https://support.microsoft.com/en-us/help/951016/description-of-user-account-control-and-remote-restrictions-in-windows The Fix It For Me feature of the article is no longer supported but the description of the manual fix via regedit works:

  1. Click Start, click Run, type regedit, and then press ENTER.
  2. Locate and then click the following registry subkey:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System
  3. If the LocalAccountTokenFilterPolicy registry entry does not exist, follow these steps: 
    1. On the Edit menu, point to
      New, and then click DWORD Value.
    2. Type
      LocalAccountTokenFilterPolicy, and then press ENTER.
  4. Right-click LocalAccountTokenFilterPolicy, and then click
    Modify.
  5. In the Value data box, type
    1, and then click OK.
  6. Exit Registry Editor.

8/14/2016

mythbuntu 16.04 on the NUC

Filed under: General,MythTV,Router/PC Config — taing @ 1:33 am

The Gigabyte NUC GB-BXBT-1900 and Mythbuntu 16.04 have a few minor issues.

The first and biggest problem is the HDMI port shuts down after the monitor powers down. When the monitor is turned back on there is no display. Yikes.

The first part of the solution is a short shell script ~/screenfix.sh :

#!/bin/sh

export DISPLAY=:0
export XAUTHORITY=/home/taine/.Xauthority
sleep 8
/usr/bin/xrandr --verbose --display :0 --output HDMI1 --mode 1920x1080

Be sure to make the script executable with chmod u+x screenfix.sh

The second step is to make this a keyboard shortcut in the Keyboard Settings Shortcut tab. I chose Windows-S for my shortcut. The short cut command is:

xrandr --verbose --display :0 --output HDMI1 --mode 1920x1080

The final step is to automate this based a UDEV rule triggered when the display connects. Create /etc/udev/rules.d/95-monitor-hotplug.rules :

ACTION=="change", SUBSYSTEM=="drm", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="/home/youruser/.Xauthority", RUN+="/home/taine/screenfix.sh"

The sleep line in the shell script was required to give the display time to actually be seen as “connected”.

The connected status of the display can be found with cat /sys/class/drm/card0-HDMI-A-1/status

The triggering UDEV event can be seen with udevadm monitor

Use xrandr -d :0 to display current display info.

Another minor annoyance was the failure of the CTRL-Escape keyboard shortcut to bring up the application menu. The shortcut appears to be set for xfce4-popup-menu. This has been around for quite a while. Change CTRL-Escape to run xfce4-popup-applicationsmenu in the Keyboard Settings Shortcut tab.

5/7/2016

Ubuntu 14.04LTS and Dropbox

Filed under: General,Router/PC Config — taing @ 11:08 pm

After recent update to 14.04LTS the dropbox status icon was gone. The installed version of dropbox is 2015.10.28.

After reading http://askubuntu.com/questions/732967/dropbox-icon-is-not-working-xubuntu-14-04-lts-64 I decided to use the option of editing /usr/bin/dropbox.

I added the line
os.environ['DBUS_SESSION_BUS_ADDRESS'] = ""
after the “import os” line.

Also of note is the dropbox command line interface. Simply type dropbox at the shell prompt for more info.

4/10/2016

NUT for Windows

Filed under: General,Router/PC Config — taing @ 1:27 am

I use NUT for all of my UPS on Linux machines. There is a beta Windows port available. I have it working for two Windows 7 Pro 64 bit boxes.

Documentation on getting it working under Windows is sparse.

Downloaded NUT Windows MSI installer 2.6.5-6. Installed.

Copy libgcc_s_dw2-1.dll from bin to sbin. it is required for upsmon to run.

Grabbed a copy of libeay32.dll and ssleay32.dll from my Nmap install and copied these to the bin and sbin folders. Without these two files upsc, upsd and upsmon throw error (0xc000007b).

Downloaded libusb-win32-bin-1.2.6.0.zip from SourceForge.

Used usb-lib bin/inf_wizard.exe to create the proper .inf file for the UPS and installed.

You can use bin/nut-scanner.exe to see is the UPS is detected.

Edit the config files: nut.conf, ups.conf, upsd,conf, uspd.users and upsmon.conf.

To fully integrate into the network, I edited(on the appropriate systems):
/etc/nut/host.conf to add the new system to the list displayed in the web status display.
/etc/nut/upsmon.conf to add the system to the list monitored for status with email/text warnings.

6/11/2015

Brother HL-L2380DW

Filed under: General,Router/PC Config — taing @ 2:19 am

Linux Printer:

You will need two packages from the Brother website. The lpr and the CUPS .deb files. Install the lpr package first. After installing both, restart cupsd. The Printers dialog should now show the printer. You may want to confirm the IP settings and print a test page.

Ignore the instructions to edit /etc/printcap.This file is auto generated and it makes no sense to edit it.

The installable .deb packages can be downloaded from http://support.brother.com/g/b/downloadlist.aspx?c=us&lang=en&prod=hll2380dw_us_as&os=128. As of today the current version 3.2.0-1 dated 2015-02-12.

Linux Scanner:
Instructions

This can be summarized as:

brsaneconfig4 -a name=(name your device) model=HL-L2380DW ip=xx.xx.xx.xx

Once installed the scanner should show up in simple-scan or xsane.

Note the links on the instruction page does not point to the latest driver and the instructions on the download page do not mention network scanning.

The driver and brsaneconfig4 can be downloaded from http://support.brother.com/g/b/downloadlist.aspx?c=us&lang=en&prod=hll2380dw_us_as&os=128. As of today the current version is 0.4.3-1 dated 2015-05-19.

9/10/2013

PPTP – route UDP

Filed under: General,Router/PC Config — taing @ 10:13 am

Quick notes on adding BCP Bridging to PopTop PPTP server:

• We are using pptpd version 1.2.1 since it has better support for broadcasting than the earlier 1.1.4 version.
• When building pptpd use the following configure option: ./configure –with-bcrelay to enable the bcrelay module.
• In /etc/pptpd.conf, add bcrelay eth0 (replace eth0 with the name of your internal interface) This will enable broadcast forwarding between the ppp interfaces as well as the interface you specify.
• In /etc/ppp/options-pptp, make sure that the mppe required option is commented. Since we will be playing games over this VPN connection, encryption is not necessary.

More can be found at http://non-standard.net/freebsd/game-vpn/vpnfaq.html.

VMWare vs Multicast

Filed under: General,Router/PC Config — taing @ 10:02 am

Found this discussion where the problem of no multicast is solved by disabling the VMware adapters in the host.

http://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/4e5a4725-e1b7-4ea3-a1db-be8ad1a19f34/why-cant-vista-receive-multicast-but-xp-can

1/4/2012

Kies kill SyncToy

Filed under: General,Router/PC Config — taing @ 11:50 am

After installing Samsung Kies software for the Galaxy Tab SyncToy started giving a “failed to create provider” error. The solution is to “repair” the MS Sync Framework. This is easily done from “Add/Modify Programs”.

8/7/2011

AsteriskNOW Web Voicemail

Filed under: General,Router/PC Config — taing @ 11:13 pm

After all what’s the point of Asterisk Voicemail if you don’t enable a web interface. Unfortunately the web interface is not packaged with AsteriskNow.

We found some very useful instructions at http://www.voip-info.org/wiki/view/Asterisk+gui+vmail.cgi. The the biggest problem with those instructions is the need to download/install the asterisk source tree.

The instructions have you install apache, perl-suidperl with yum and the DBI module for perl(we used webmin for the perl module).

Then we found a copy of vmail.cgi and copied it directly to /var/www/cgi-bin. Once we made it executable and followed the rest of the instructions regarding Perl modules almost everything was ready to go.

You can grab a copy of what we used here: vmail.cgi

There is a broken image tag that can easily be resolved either by editting the .cgi file or downloading the file from the Asterisk source tree and copying it to the proper place in /var/www.

The remaining step was to make sure the apache cgi job had write access to the /var/spool/asterisk/voicemail tree. I’m sure there is a more complex and more secure means but simply adding the permissions og+rw to the tree made everything work.

Older Posts »

Powered by WordPress