Tue, 10 Sep 2019

fixing SMART Current_Pending_Sector count

I have a western digital 2.0TB Black hard drive that was returning a SMART error of "9 Currently unreadable (pending) sectors". This probably means the drive is on it's way out, but it was passing long smart tests ok, and it's in a raid so I've decided to try and fix it. I've read that writing to the drive can force the hard drive to reallocate those sectors, so I gave it a try with the dd command:

dd if=/dev/zero of=/dev/sdc

Before and after smart data:

# before
197 Current_Pending_Sector  0x0032   200   200   000    Old_age   Always       -       9

# after
197 Current_Pending_Sector  0x0032   200   200   000    Old_age   Always       -       0

And then I've partitioned the drive and have been using it without issues now for a few weeks. Time will tell if this ends up working I suppose.

posted at: 09:22 | path: /computers | permanent link to this entry


Sun, 21 Jul 2019

Wifi connection through network manager on debian stretch "DEAUTH_LEAVING"

Had an issue connecting to a wifi network on debian stretch. I would connect and then get then get the error:

wlp4s0: deauthenticating from b6:fb:e4:14:aa:f8 by local choice (Reason: 3=DEAUTH_LEAVING)

This would happen after a successful authentication where it would then timeout after 45 seconds trying to get an IP address.

I'm not entirely sure what this issue is, or why it's happening, but it was fixed after finding the following blog post:

https://lists.debian.org/debian-user/2017/06/msg01045.html

Which instructed me to do the following:

sudo ln -s /dev/null /etc/systemd/network/99-default.link

A reboot later and it works as expected...

posted at: 19:58 | path: /debian | permanent link to this entry


Mon, 24 Jun 2019

ImageMagick 6.x compile error on centos 6

I ran into some problems updating image magick on older centos6 systems. Specifically ImageMagick-6.9.10-50 which would error during the make compile with:

magick/.libs/libMagickCore-6.Q16.so: undefined reference to `clock_gettime'
collect2: ld returned 1 exit status
make[1]: *** [utilities/animate] Error 1
make[1]: Leaving directory `/usr/src/ImageMagick-6.9.10-50'
make: *** [all] Error 2

This can be fixed by adding compile time flags:

LDFLAGS=" -lrt " ./configure
LDFLAGS=" -lrt " make

posted at: 17:26 | path: /linux | permanent link to this entry


Mon, 13 May 2019

desktop notifications from websites in firefox

So this has been bothering me for a while now where I would sometimes get notifications on my desktop from reddit r/archlinux posts. I finally took some time to track down where they are coming from, and it looks like it's push notifications from firefox. I guess these come in even if you don't have those pages loaded in your browser, which is kind of confusing.

Anyways, this blog post explains how to turn them off, and there is an option to not allow them ever which is also handy (remove all websites and block new requests): https://blog.mozilla.org/firefox/no-notifications/

posted at: 12:56 | path: /linux | permanent link to this entry


Wed, 12 Dec 2018

Running latest firefox on debian installed as user

Debian packages the firefox-esr release which works quite well most of the time, but I find often the newest browser is often required for some functionality. I've put together a little script that basically sets this up with a local firefox install in ~/.opt

You can copy/paste this into a terminal and it will download the latest firefox, extract it to ~/.opt/firefox and setup a desktop file so that it will appear in the desktop menu

mkdir -p ~/.opt
cd ~/.opt

FFCHANNEL=latest
LIBDIRSUFFIX="64"
VER=${VER:-$(wget --spider -S --max-redirect 0 "https://download.mozilla.org/?product=firefox-${FFCHANNEL}&os=linux${LIBDIRSUFFIX}&lang=${FFLANG}" 2>&1 | sed -n '/Location: /{s|.*/firefox-\(.*\)\.tar.*|\1|p;q;}')}
echo $VER

wget https://ftp.mozilla.org/pub/firefox/releases/${VER}/linux-x86_64/en-US/firefox-${VER}.tar.bz2 -P /tmp
tar jxvf /tmp/firefox-${VER}.tar.bz2

mkdir -p ~/.local/share/applications
BASEDIR=`pwd`
cat <<EOF >> ~/.local/share/applications/firefox-stable.desktop
[Desktop Entry]
Name=Firefox
Comment=Web Browser
Exec=${BASEDIR}/firefox/firefox %u
Terminal=false
Type=Application
Icon=${BASEDIR}/firefox/browser/chrome/icons/default/default128.png
Categories=Network;WebBrowser;
StartupWMClass=Firefox
StartupNotify=true
EOF

sudo ln -sf ${BASEDIR}/firefox/firefox /usr/local/bin/firefox

More information in the debian wiki: https://wiki.debian.org/Firefox

posted at: 19:34 | path: /debian | permanent link to this entry


Tue, 11 Dec 2018

Adding a menu location for locally installed xdg .desktop application links

I ran into an issue recently trying to install a application menu link on a debian system (desktop was mate in this case, but I think it applies to any gnome based desktop). The issue was that I would install a new .directory file for a new menu entry along with the .desktop file, and when I did, the application would show up under "Other" and not under the menu category I was trying to add.

The processes being:

Running this as the local user, correctly installs the files in ~/.local/share/, but it does not write a menu file. And so the application will show up under Applications->Other

If you run the command as root, it will install system wide, and creates the menu for you under /etc/xdg/menus/applications-merged/company-company.menu

But if you don't want this installed system wide, it seems like the only way to fix this is to setup the .menu file manually? I feel like I'm doing this wrong, and there is a way to specify the menu in a user folder, but at the time I can't seem to figure this out.

To fix the issue I created the /etc/xdg/menus/applications-merged/company-company.menu file manually like this:

<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN"
  "http://www.freedesktop.org/standards/menu-spec/menu-1.0.dtd">
<Menu>
    <Name>Applications</Name>
<Menu>
    <Name>company-company</Name>
    <Directory>company-company.directory</Directory>
    <Include>
        <Category>Company</Category>
    </Include>
</Menu>
</Menu>

This added the menu entry, and the locally installed applications now show up in the correct location.

posted at: 23:43 | path: /linux | permanent link to this entry


Wed, 17 Jan 2018

Setting ip address of squeezeboxserver

I couldn't seem to find this information anywhere, and I just spend longer than I'd like to admit sorting this issue out. I use the Logitech Media Server (v7.9.1 as of now) and I just reinstalled it on my server. After doing that the "Server IP Address" was getting picked up as my public ip address on my gateway server, and not the local network address of 192.168.0.1. This was causing the settings interface to be inaccessible on the local network with an error in the server.log file of Access to settings pages is restricted to the local network or localhost.

Fixing this was as simple as editing the /etc/default/logitechmediaserver file and setting the following line:

SLIMOPTIONS="--playeraddr 192.168.0.1"

Not the httpaddr or cliaddr options which is what I was setting, because I didn't read the help page closely enough.

posted at: 23:49 | path: /debian | permanent link to this entry


Tue, 22 Aug 2017

solar eclipse as experienced by solar panels

/blogimages/20170822/chart.png

We had about 70% coverage of the sun where we were which actually seems to be about 70% less production on the graph (which is what you'd expect, but neat either way).

posted at: 10:25 | path: /energy | permanent link to this entry


Fri, 23 Jun 2017

getting canadian exchange rates in python

Simple script to get the current exchange rates from the bank of canada:

import requests

r = requests.get('http://www.bankofcanada.ca/valet/observations/group/FX_RATES_DAILY/json')
rates = r.json()
date = rates['observations'][-1]['d']
rate = rates['observations'][-1]['FXUSDCAD']['v']

posted at: 12:23 | path: /python | permanent link to this entry


Thu, 18 May 2017

wordpress plugin update error: PCLZIP_ERR_BAD_FORMAT

I was having some issues on a server where a particular plugin (bb-plugin) wouldn't update, and I'd just get this error:

PCLZIP_ERR_BAD_FORMAT (-10) : Invalid archive structure

After much poking around, I ended up installing the php5-curl package (on debian), and this ended up solving the problem. I think php was downloading the archive from the update server, but for whatever reason it was getting corrupted or not saving correctly. With curl the download seems to have saved the zip file correctly, and thus the error went away. It seems to have only been effecting this one plugin, as other plugins and wordpress auto updates were working just fine.

Anways, I didn't have much luck in googling a solution to this problem, so I thought I'd publish what I found.

posted at: 17:04 | path: /linux | permanent link to this entry


2019-Sep
2019-Jul
2019-Jun
2019-May
2018-Dec
2018-Jan
2017-Aug
2017-Jun
2017-May
2016-Nov
2015-Dec
2015-Nov
2015-Oct
2015-Jul
2015-Jun
2014-Dec
2012-Oct
2012-Sep
2012-Jun
2012-Feb
2012-Jan
2011-Dec
2011-Sep
2011-Aug
2011-May
2011-Feb
2010-Jun
2010-Apr
2010-Jan
2009-Sep
2009-Jul
2009-May
2009-Jan
2008-Oct
2008-Sep
2008-Jun
2008-May
2008-Jan
2007-Nov
2007-Oct
2007-Aug
2007-Jun
2007-May
2007-Mar
2007-Feb
2007-Jan
2006-Nov
2006-Oct
2006-Sep
2006-Aug
2006-Jun
2006-Apr
2006-Jan
2005-Dec
2005-Nov
2005-Oct
2005-Sep
2005-Aug
2005-Jul
2005-Jun
2005-May
2005-Apr
2005-Mar
2005-Feb
2005-Jan
2004-Dec
2004-Nov
2004-Oct
2004-Sep
2004-Aug
2004-Jul
2004-Jun
2004-May

Powered by PyBlosxom | RSS 2.0