Categories
Linux Random

Dreamhost & Favicons

So I had a directory that I wanted listed on Dreamhost. It appears more recent than the last time I have done this that you have to disable the default coming soon template.

You can easily do this by creating a .htaccess file in the root of the directory you would like to list with the following content:

DirectoryIndex disabled
Options +Indexes

The next hurdle was dreamhost automatically generates blank favicon files so even if you delete them, they will be regenerated.

We can mitigate this as well in our newly created .htaccess by adding this final line. It will hide the files from our users browsing the directory.

IndexIgnore favicon.gif favicon.ico

-Mike

Categories
CentOS Linux Random Storage

NFS Setup for RHV and Ovirt

Today I will detail how to configure a NFS server to be used as a storage domain provider for Red Hat Virtualization (RHV) or Ovirt. I will be using CentOS as my NFS OS but this will also work with RHEL.

After we have our base OS installed we want to go ahead and update to the latest verison. Followed by installing nfs-utils for get our NFS server up and going.

sudo yum update -y
sudo yum install nfs-utils -y
sudo reboot #if needed

Now let’s enable our nfs service and open our firewall ports.

sudo systemctl enable --now nfs-server
sudo systemctl enable --now rpcbind
sudo firewall-cmd --add-service=nfs --permanent
sudo firewall-cmd --add-service=rpc-bind --permanent
sudo firewall-cmd --add-service=mountd --permanent
sudo firewall-cmd --reload

From here we will want to create our directories we want to export. Normally there are 3 different domains you need; export, iso, and data. I will be making these in my users home directory to make it easy since the OS installer provisions more free space to /home.

mkdir ~/{export,iso,data}
chmod 0755 ~/{export,iso,data}
sudo chown 36:36 /home/<username>/{export,iso,data}

Because we are using the home directory for NFS we need to edit our SE Linux boolean value to allow this behavior.

sudo setsebool -P use_nfs_home_dirs 1

From here we just need to configure our exports and restart the nfs server and we are off to the races!

sudo vi /etc/exports

Add the following lines to the exports file, save the file, and restart the nfs service.

/home/<username>/export *(rw,sync)
/home/<username>/data *(rw,sync)
/home/<username>/iso *(rw,sync)


sudo systemctl restart nfs-server

Note you can replace the * in the above file with the IP of the server or even the subnet to only allow access to certain IPs/networks. See exports man page for more details.

Now because I don’t like typing long paths for my NFS server let’s create some symlinks for the directories we created above.

sudo ln -s /home/<username>/data /data
sudo ln -s /home/<username>/export /export
sudo ln -s /home/<username>/iso /iso

Tada your NFS server is ready to serve data for your virtualization platform!

-Mike

Categories
Linux Random Windows

Windows 10 + WSL + Cmder + neofetch = <3

Sometimes we have no choice of what operating system we have to run in our work environments. Many of us stick to our old ways using putty or cygwin to get by. I wanted something more so I went looking and this is what I have come up with. Multiple tabbed terminal sessions and all your native linux options at your fingers tips in windows with a little added rice. 😉

First you want to install WSL and a flavor of Ubuntu from the Windows store. Once we have our ubuntu environment ready, lets update it. Launch it and run the following commands:

sudo apt-get update && apt-get upgrade

Then you will want to install neofetch in our Ubuntu environment. Follow the correct instructions for your version of Ubuntu installed.

Conemu seems to do something weird with the title display in neofetch so lets fix that first.


neofetch
vi ~/.config/neofetch/config.conf

Add the following above info title
info line_break
:wq!

Now we need to set our distro logo and set it to run on launch.

vi ~/.bash_aliases
alias neofetch2="neofetch \
--ascii_distro windows10 \
--line_wrap off \
--bold on \
--uptime_shorthand on
"
:wq!

vi ~/.bashrc

At the very bottom of the file add the following:

cd ~
neofetch2
:wq!

Now lets wrap this up by configuring cmder. Download and extract the latest version of cmder from here. Run cmder, once open right click on the top bar and select settings. Change your default startup task to {WSL:bash} and save your settings. The end result will look like the image at the top of this post.

-Mike