Redirect apache to your wordpress install

We can redirect our ‘localhost’ site to ‘localhost/blog’ on the server using the Apache Redirect Directive.

First, create/edit the .htaccess file in your web root directory. This is usually “/var/www/html”.

sudo pico /var/www/html/.htaccess

Add this line, replacing ‘example’ with your domain name and ‘blog’ with the directory you want to redirect to:
Redirect / http://example.com/blog

Now, all you need to do is restart apache2:
sudo /etc/init.d/apache2 restart

Advertisement

Using a Raspberry Pi 4 as a daily driver

During the Covid lockdown, I have challenged myself to use a Raspberry Pi 4 as a daily driver computer and so far, it has lived up to the task.

The Pi 4 is using Raspberry Pi OS (formerly ‘Raspbian’) running off of an SSD. I have a DAC/ADC, CD-RW, external SD card reader, and several other accessories connected to it using a powered USB hub. This hub is connected to and taking full advantage of the USB 3.0 capabilities. The case it’s housed in has full HDMI ports and spreads the connections out in the back, so there’s no cables going in at all angles. I created a guide so you can build and of course, customize your own system.

I take a great deal of satisfaction knowing that I’m using a very inexpensive computer to do all of my tasks, even audio/video editing and CAD/3D modeling! There’s even a section telling you how to run Retropie on top of Raspberry Pi OS for all of your video gaming needs. Please check out the guide. There are plenty of great tips and tricks for using a Raspberry Pi 4 as a PC.  If you see anything I missed or any issues, leave a comment and I’ll make additions/corrections. Posted on Categories Linux, Raspberry Pi, Retro Games, Streaming MusicLeave a comment on Using a Raspberry Pi 4 as a daily driver

Telegram messenger CLI for Raspberry Pi OS

Telegram is a cloud-based mobile and desktop messaging app with a focus on security and speed.

Telegram Messenger CLI for Raspberry Pi OS

This guide likely works for other linux distros besides Raspberry Pi OS. It’s a tricky little bugger to install but rewarding nonetheless.

https://pimylifeup.com/raspberry-pi-telegram-cli/

If you want to go the GUI route:

Telegram Desktop for Raspberry Pi

sudo apt install snapd
sudo snap install telegram-desktop
telegram-desktop

Message me!
t.me/thinkzinc

Install SDR (Software Defined Radio) Software GQRX on a Mac

So, you are interested in using an SDR module and SDR software on your Mac?
Homebrew is the easiest install method I have found. The other method involves MacPorts. I was successful using this method on one Mac. On the other… nope.

GQRX is a great open-source program that will do the trick.

First you will need homebrew (if you don’t already have it). It’s a great source for open-source software!

xcode-select --install

The first command may not work in your system. If not, proceed to the second one.

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

Verify the install worked.

brew doctor

Then you will need to run the homebrew command in a terminal.

brew cask install gqrx

Install Spotify Connect on your Raspberry Pi with ‘raspotify” on Raspberry Pi OS

Setting up Spotify Connect on the Raspberry Pi

First update your Pi’s OS:

sudo apt update
sudo apt upgrade

Install ‘curl’ and ‘apt-transport-https’

sudo apt install -y apt-transport-https curl

Add the raspotify repository and the GPG key:

curl -sSL https://dtcooper.github.io/raspotify/key.asc | sudo apt-key add -v - 
echo 'deb https://dtcooper.github.io/raspotify raspotify main' | sudo tee /etc/apt/sources.list.d/raspotify.list

Install ‘raspotify’:

sudo apt update
sudo apt install raspotify

You should now be able to go into the Spotify app on your phone or tablet and select your pi from the device choices.

Tweaking:

You can change your Pi’s device name and the bit rate of the stream by editing the configuration file:

sudo nano /etc/default/raspotify

Look for the device name and bitrate strings and make any desired edits. Then save and restart the raspotify service:

DEVICE_NAME="raspotify"
BITRATE="160"
sudo systemctl daemon-reload
sudo systemctl restart raspotify

Troubleshooting:
raspotify – no sound even though phone is connected to Pi

Source for further investigation: https://github.com/dtcooper/raspotify/issues/31

Use aplay -l to see devices. Sample output:

pi@lab9:~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: b1 [bcm2835 HDMI 1], device 0: bcm2835 HDMI 1 [bcm2835 HDMI 1]
  Subdevices: 3/4
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3

card 1: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones]
  Subdevices: 4/4
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3

card 2: sndrpihifiberry [snd_rpi_hifiberry_dacplusadc], device 0: HiFiBerry DAC+ADC HiFi multicodec-0 [HiFiBerry DAC+ADC HiFi multicodec-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Edit the raspotify configuration:

sudo nano /lib/systemd/system/raspotify.service

Find the “ExecStart” line and add the device.
In this case (example above), desired device is sndrpihifiberry.
Card is 2 and Device is 0. Use “–device hw:2,0” in configuration.

ExecStart=/usr/bin/librespot --name ${DEVICE_NAME} $BACKEND_ARGS --bitrate ${BITRATE} $CACHE_ARGS $VOLUME_ARGS $OPTIONS --device hw:2,0

Restart the service:

sudo systemctl daemon-reload
sudo systemctl restart raspotify

Ubuntu 20.04 update and MSQL issues

My thinkzinc.com server was updated to 20.04 from 18.04 and the wordpress install was failing. Apparently there were issues with Mysql. I tried many things; it was so frustrating that I actually left it alone for over a week. Today I decided to try to fix the issue. So many things on the net would not work but at last I did find a solution here. If you find yourself in the same situation, try this – it might help:

$ sudo systemctl stop apparmor.service
$ sudo update-rc.d -f apparmor remove

$ sudo apt-get remove --purge mysql-server mysql-client mysql-common
$ sudo apt-get autoremove
$ sudo apt-get autoclean
$ sudo apt-get install mariadb-server

$ sudo systemctl start apparmor.service
$ sudo update-rc.d apparmor defaults