Simple Login Manager (SLIM) Theme – nsa-parody

A friend of mine asked me if I can create a simple custom theme for SLIM with the NSA logo in it, so I did and call it nsa-parody. You guys might like to try it as well. Here’s a preview (image is cropped):

preview-small

You can download and try this slim theme in FreeBSD using these commands:

cd /usr/local/share/slim/themes/
sudo git clone https://github.com/greencloud/nsa-parody.git

Then open up your /usr/local/etc/slim.conf file and look for the line that starts with:

current_theme        <YOUR-CURRENT-THEME>

and change it’s value to nsa-parody so that it would look similar to this:

current_theme        nsa-parody

That’s it. You can check all the files for this theme by going to https://github.com/greencloud/nsa-parody. Enjoy!

svn: E170013: Unable to connect to a repository (work-around)

Scenario: Some files in my /usr/src directory are either missing or causing errors whenever I try to recompile a new custom kernel after upgrading from FreeBSD 11.02 to 12.0-Release. So I’ve decided to just delete everything that’s in /usr/src directory and start all over again. But, when I try to run:

svn co https://svn.freebsd.org/base/releng/12.0 /usr/src/

I get this error message:

svn: E170013: Unable to connect to a repository at URL 'https://svn.freebsd.org/base/releng/12.0'
svn: E000047: Error running context: Address family not supported by protocol family

It says about protocol so I tried both http and https but still the same problem. I’ve also checked my configuration files on both /root/.subversion/ and ~/.subversion/ and I did not see any problem. Also, I tried uninstalling subversion and reinstalled it again via /usr/ports and made sure that I have SERF module in it. Same problem.

There is one file though within /root/.subversion/auth/svn.ssl.server/ that has a line at the bottom that says:

...
svn:realmstring
V 23
https://8.8.178.107:443
END

That second from the last line before the ‘END’ caught my attention. So I look for the svn.freebsd.org’s IP address using nslookup:

nslookup svn.freebsd.org

The IP address that came up was 213.138.116.72. So I tried it again using the svn command, this time replacing the svn.freebsd.org domain name with its IP address and adding the 443 port, like so:

svn co https://213.138.116.72:443/base/releng/12.0 /usr/src/

And it worked! I was able to get all the source files I need and I was able to compile a new custom kernel.

I need to dig deeper to see why subversion didn’t work normally the way it should. This could be just a simple DNS issue somewhere or an A Record problem on FreeBSD’s end, but that’s very unlikely. I’ve checked some forum threads but most suggestions seem to be irrelevant to the problem I had. I will do more research but that would be for later.

Is FreeBSD Better Than Linux?

Asking me this question is like asking whether your breakfast is better than mine. Does it really matter? Anyway, FreeBSD is basically a derivative of UNIX while Linux is built as an open-source alternative to UNIX. FreeBSD is known for its raw performance, especially when it comes to system load per packet. That is the reason why Netflix chose FreeBSD over Linux for its online video streaming services. Linux on the other hand is best for servers and mobile devices. Some people say Linux is also better on desktop, unlike FreeBSD. In other words, for me, I think they both have their own chunks of strengths and weaknesses.

I’ve explored quite a number of desktop and server operating systems from MS Windows, several GNU/Linux distros, Mac OS, and variants of BSD. Right now I’m using FreeBSD 11.2-Release with a custom kernel. The main reason why I use FreeBSD is that compared to the other OS’ I’ve used, in FreeBSD I feel more in control from the ground up and it’s also faster and more stable. Before I switch to FreeBSD some years ago, I was using Archlinux and I had it as my primary OS for several years. Prior to that, I’ve tried a lot of other distributions as well such as Debian, Ubuntu, Mint, and many others.

I’m not trying to promote FreeBSD here nor I’m trying to persuade you to switch to FreeBSD (or Linux). I’m not. It’s just that FreeBSD is the one that works for me, exactly the way how I need things to work for me. So, if you’re a Windows person and Windows works for you, why bother? If you’re a Mac person, the same. At the end of the day, let’s just say it all boils down to preference.

A good 70% of my friends use Windows, some 20% uses Linux, and 10% Mac. Windows and Mac users are just quiet folks and they usually come to me for repair whenever they are having issues with their machine. The 20% would move heaven and earth to prove that their Linux distribution of choice is better than the other. Me, I’m always in the middle laughing my hearts out. I’m the only one using FreeBSD anyway, yee hah!

How about you? Which operating system works best for you?

Troubleshoot FreeBSD Using A LiveCD

The scenario: You made some changes on your /boot/loader.conf file or any configuration file for that matter. Then you restarted your computer and all of a sudden while booting up computer stops and restarted itself again. You tried single-user mode but it’s the same thing, the computer just keeps on restarting halfway through the boot process.

No worries, luckily with the help of a LiveCD (or memstick in USB drive) you can still undo any changes that you’ve made to any configuration file that made your computer non-workable. To do so just boot up using your LiveCD and then log in, which will be as root by default. Once logged in, mount your actual root partition in /mnt:

# mount /dev/ada0p1 /mnt

Here we assume /dev/ada0p1 is your actual root partition where you have all your configuration files.

If you forgot where your root partition is, just run this command to check:

# gpart show

Once mounted, chroot to /mnt:

# chroot /mnt

Your prompt should change to your actual root prompt. You can now do troubleshooting and undo the changes you’ve previously made. Once you’re done just type exit on the command line to exit chroot and do umount /mnt before rebooting your computer. ¡Suerte!

Show Public IP in Conky System Monitor

This is a simple way to show your public IP address in Conky within FreeBSD (it should on any GNU/Linux distribution as well). Here we’re going to create a shell script called PublicIP.sh. To make this shell script run properly both bash and bind-tools packages should be installed first.

sudo pkg install bash bind-tools

Create The Script

#!/usr/bin/env bash

BindTools="/usr/local/bin/dig"

if [[ ! -f "${BindTools}" ]]; then
    PublicIP="bind-tools-9.x required"
else
    PublicIP=$(dig +short myip.opendns.com @resolver1.opendns.com)
fi

if [[ ! -z "${PublicIP}" ]]; then
    echo "$PublicIP"
else
    echo "DISCONNECTED!"
fi

Save it into your ~/.config/conky/ directory, then make the script executable:

chmod a+rx ~/.config/conky/PublicIP.sh

Run the Script in Conky

To use this script simply add this line within conky.text = [[ … ]] in Conky:

conky.text = [[
Public IP: ${texeci 300 ./PublicIP.sh}
]]

This will execute the script inside Conky once every 5 minutes. Enjoy!

Install Apache, PHP, MySQL, phpMyAdmin – FreeBSD 11.2-Release

This post is a little longer than usual so please bear with me. Here in this tutorial, I’m going to walk you through (with only the essentials) on how to set up a web server in FreeBSD 11.x.

The following are the set of packages that we are going to install:

  • apache24 – Version 2.4.x of Apache webserver
  • php70 – Version 7.0 of PHP scripting language
  • mysql57-server – Version 5.7.x of MySQL database server
  • phpMyAdmin-php70 – Set of PHP-scripts to manage MySQL over the web

Disclaimer: This setup is intended as a development server only and should NOT be considered for production use.

Let’s get started!

Read More »

Access Android Devices in FreeBSD 11

I know a couple of ways to do this, both on CLI and via a GUI based application. The GUI based app is called GMTP but here we’re going to use simple-mtpfs(1). As what the name of the programs says it’s simple so let’s just dive into it.

Install and Configure MTPfs

First, we need to install a package called fusefs-simple-mtpfs. To install its binary package via pkg(8), just type in your terminal:

sudo pkg install fusefs-simple-mtpfs

To install it via ports:

Read More »