Archive

Archive for the ‘Tyler B’ Category

KWLUG: Let’s Encrypt, Cryptocurrencies (2017-02)

February 11th, 2017 No comments

This is a podcast presentation from the Kitchener Waterloo Linux Users Group on the topic of Let’s Encrypt, Cryptocurrencies published on February 7th 2017. You can find the original Kitchener Waterloo Linux Users Group post here.

Read more…

Categories: Linux, Podcast, Tyler B Tags: ,

Setup your own VPN with OpenVPN

February 6th, 2017 No comments

Using the excellent Digital Ocean tutorial as my base I decided to setup an OpenVPN server on a Linux Mint 18 computer running on my home network so that I can have an extra layer of protection when connecting to those less than reputable WiFi hotspots at airports and hotels.

While this post is not meant to be an in-depth guide, you should use the original for that, it is meant to allow me to look back at this at some point in the future and easily re-create my setup.

1. Install everything you need

sudo apt-get update
sudo apt-get install openvpn easy-rsa

2. Setup Certificate Authority (CA)

make-cadir ~/openvpn-ca
cd ~/openvpn-ca
nano vars

3. Update CA vars

Set these to something that makes sense:

export KEY_COUNTRY=”US”
export KEY_PROVINCE=”CA”
export KEY_CITY=”SanFrancisco”
export KEY_ORG=”Fort-Funston”
export KEY_EMAIL=”me@myhost.mydomain”
export KEY_OU=”MyOrganizationalUnit”

Set the KEY_NAME to something that makes sense:

export KEY_NAME=”server”

4. Build the CA

source vars
./clean-all
./build-ca

5. Build server certificate and key

./build-key-server server
./build-dh
openvpn –genkey –secret keys/ta.key

6. Generate client certificate

source vars
./build-key-pass clientname

7. Configure OpenVPN

cd ~/openvpn-ca/keys
sudo cp ca.crt ca.key server.crt server.key ta.key dh2048.pem /etc/openvpn
gunzip -c /usr/share/doc/openvpn/examples/sample-config-files/server.conf.gz | sudo tee /etc/openvpn/server.conf

Edit config file:

sudo nano /etc/openvpn/server.conf

Uncomment the following:

tls-auth ta.key 0
cipher AES-128-CBC
user nobody
group nogroup
push “redirect-gateway def1 bypass-dhcp”
push “route 192.168.10.0 255.255.255.0”
push “route 192.168.20.0 255.255.255.0”

Add the following:

key-direction 0
auth SHA256

Edit config file:

sudo nano /etc/sysctl.conf

Uncomment the following:

net.ipv4.ip_forward=1

Run:

sudo sysctl -p

8. Setup UFW rules

Run:

ip route | grep default

To find the name of the network adaptor. For example:

default via 192.168.x.x dev enp3s0  src 192.168.x.x  metric 202

Edit config file:

sudo nano /etc/ufw/before.rules

Add the following, replacing your network adaptor name, above the bit that says # Don’t delete these required lines…

# START OPENVPN RULES
# NAT table rules
*nat
:POSTROUTING ACCEPT [0:0]
# Allow traffic from OpenVPN client to eth0
-A POSTROUTING -s 10.8.0.0/8 -o enp3s0 -j MASQUERADE
COMMIT
# END OPENVPN RULES

Edit config file:

sudo nano /etc/default/ufw

Change DEFAULT_FORWARD_POLICY to ACCEPT.

DEFAULT_FORWARD_POLICY=”ACCEPT”

Add port and OpenVPN to ufw, allow it and restart ufw to enable:

sudo ufw allow 1194/udp
sudo ufw allow OpenSSH
sudo ufw disable
sudo ufw enable

9. Start OpenVPN Service and set it to enable at boot

sudo systemctl start openvpn@server
sudo systemctl enable openvpn@server

10. Setup client configuration

mkdir -p ~/client-configs/files
chmod 700 ~/client-configs/files
cp /usr/share/doc/openvpn/examples/sample-config-files/client.conf ~/client-configs/base.conf

Edit config file:

nano ~/client-configs/base.conf

Replace remote server_IP_address port with the external IP address and port you are planning on using. The IP address can also be a hostname, such as a re-director.

Add the following:

cipher AES-128-CBC
auth SHA256
key-direction 1

Uncomment the following:

user nobody
group nogroup

Comment out the following:

#ca ca.crt
#cert client.crt
#key client.key

11. Make a client configuration generation script

Create the file:

nano ~/client-configs/make_config.sh

Add the following to it:

#!/bin/bash

# First argument: Client identifier

KEY_DIR=~/openvpn-ca/keys
OUTPUT_DIR=~/client-configs/files
BASE_CONFIG=~/client-configs/base.conf

cat ${BASE_CONFIG} \
<(echo -e ‘<ca>’) \
${KEY_DIR}/ca.crt \
<(echo -e ‘</ca>\n<cert>’) \
${KEY_DIR}/${1}.crt \
<(echo -e ‘</cert>\n<key>’) \
${KEY_DIR}/${1}.key \
<(echo -e ‘</key>\n<tls-auth>’) \
${KEY_DIR}/ta.key \
<(echo -e ‘</tls-auth>’) \
> ${OUTPUT_DIR}/${1}.ovpn

And mark it executable:

chmod 700 ~/client-configs/make_config.sh

12. Generate the client config file

cd ~/client-configs
./make_config.sh clientname

13. Transfer client configuration to device

You can now transfer the client configuration file found in ~/client-configs/files to your device.


This post originally appeared on my personal website here.

Categories: Open Source Software, Tyler B Tags: ,

Blast from the Past: Getting KDE on openSUSE is like playing Jenga

February 2nd, 2017 No comments

This post was originally published on October 16, 2009. The original can be found here.


As part of our experiment, everyone is required to try a different desktop manager for two weeks. I chose KDE, since I’ve been using GNOME since I installed openSUSE. However, I’ve found that while trying to get a desktop manager set up one wrong move can cause everything to fall apart.

Switching from GNOME:

This was fairly simple. I started up YaST Software Management, changed my filter from “Search” to “Patterns”, and found the Graphical Environments section. Here I right clicked “KDE Base System”, and selected install. Clicking accept installed the kdebase and kdm packages, with a slew of other KDE default programs. Once this was done, I logged out of my GNOME session, and selected KDE4 as my new login session. My system was slightly confused and booted into GNOME again, so I restarted. This time, I was met with KDE 4.1.

My Thoughts on KDE 4.1:

As much as I had hated the qt look [which I erronously call the ‘quicktime’ look, due to its uncanny similarity to the quicktime app], the desktop was beautiful. The default panel was a very slick, glossy black, which looked quite nice. The “lines” in each window title made the windowing system very ugly, so I set out to turn them off. Its a fairly easy process:

KDE Application Launcher > Configure Desktop > Appearance > Windows > Uncheck the “Show stripes next to the title” box.

Once completed, my windows were simple and effective, and slightly less chunky than the default GNOME theme, so I was content.

Getting rid of the openSUSE Branding:

openSUSE usually draws much ire from me – so its not hard to imagine that I’d prefer not to have openSUSE branding on every god damn application I run, least of all my Desktop Manager. From YaST Software Management I searched for openSUSE and uninstalled every package that had the words “openSUSE” and “branding”. YaST automatically replaces these packages with alternate “upstream” packages, which seem to be the non-openSUSE themes/appearances. Once these were gone, things looked a lot less gray-and-green, and I was happy.

Oh god what happened to my login screen:

A side effect of removing all those openSUSE packages my login screen took a trip back in time, to the Windows 3.1 era. It was a white window on a  blue background with Times New Roman-esque font. After a bit of researching on the GOOG, I found out that this was KDE3 stepping up to take over for my openSUSE branding. Uninstalling the package kde3base or whatever the shit it’s called forced KDE4 to take over, and everything was peachy again.

Installing my Broadcom Wirless Driver

In order to install my driver, I followed this guide TO THE LETTER. Not following this guide actually gave YaST a heart attack and created code conflicts.

KMix Being Weird

KMix magically made my media buttons on my laptop work, however it occasionally decided to change what “audio device” the default slider was controlling. Still, having the media buttons working was a HUGE plus.

Getting Compositing to Work

I did not have a good experience with this. Infact, by fucking around with settings, I ended up bricking my openSUSE install entirely. So alas, I ended up completely re-installing openSUSE. Regardless, to install ATI drivers, follow the guide here using the one-click install method worked perfectly. After finally getting my drivers, turning on compositing was simple:

KDE Application Launcher > Configure Desktop > Appearance > Desktop > Check the “Enable Desktop Effects” box.

From KDE4.1 to KDE4.3

While KDE was really working for me, the notifications system was seriously annoying. Every time my system had an update, or a received a message in Kopete  an ugly, plain, slightly off center, gray box would appear at the top of my screen to inform me. Tyler informed me that this was caused by the fact that I wasn’t running the most recent version of KDE4. A quick check showed me that openSUSE isn’t going to use KDE4.3 until openSUSE 11.2 launches, however you can manually add the KDE 4.3 repositories to YaST, as shown on the openSUSE KDE Repository page.

After adding these repositories, I learned a painful lesson in upgrading your display manager. Do not, under any circumstances, attempt a Display Manager upgrade/switch untill you have an hour to spare,  and enough battery life to last the whole time. I did not, and even though I cancelled the install about 60 seconds in, I found that YaST had already uninstalled my display manager. Upon restart, I was met with a terminal.

From the terminal, I used the command line version of YaST to completely remove kdebase4 and kdm from my system. After that, re-installing the KDE4.3 verison of  kdm from YaST in the terminal installed all the other required applications. However, there are a shitload of dependency issues you gotta sort through and unfortunately the required action is not the same for each application.

KDE4.3

KDE4.3 is absolutely gorgeous, I’ve had no complaints with it. KMix seems to have reassigned itself again, but it assigned itself correctly. Removing the openSUSE branding was the same, but by default the desktop theme used is Air. I prefer the darker look of Oxygen, so I headed over to my desktop to fix it by following these steps:

Desktop > Right Click > Plain Desktop Settings > Change the Desktop Theme from Air to Oxygen.

Concluding Thoughts

Now that all these things are sorted out, I’m surprisingly impressed with KDE, and I might even keep it at the end of this test period for our podcast.

Let me know if you’ve ever had to change desktop managers and your woes in the comments!

get rid of that openSUSE shit:

KDE4.1
uninstall openSUSE branding, except the KDM one maybe?

uninstall kde3base or whatever the shit it’s called. this makes stuff wicked.

KDE4.3
This might have all been unessecary. since installing KDE4.3, I did it all again to no avail. Rightclick desktop, plain desktop settings, theme: oxygen. Then hooray its fine?

Blast from the Past: The Search Begins

January 26th, 2017 No comments

This post was originally published on July 29, 2009. The original can be found here.


100% fat free

Picking a flavour of Linux is like picking what you want to eat for dinner; sure some items may taste better than others but in the end you’re still full. At least I hope, the satisfied part still remains to be seen.

Where to begin?

A quick search of Wikipedia reveals that the sheer number of Linux distributions, and thus choices, can be very overwhelming. Thankfully because of my past experience with Ubuntu I can at least remove it and it’s immediate variants, Kubuntu and Xubuntu, from this list of potential candidates. That should only leave me with… well that hardly narrowed it down at all!

Seriously... the number of possible choices is a bit ridiculous

Seriously… the number of possible choices is a bit ridiculous

Learning from others’ experience

My next thought was to use the Internet for what it was designed to do: letting other people do your work for you! To start Wikipedia has a list of popular distributions. I figured if these distributions have somehow managed to make a name for themselves, among all of the possibilities, there must be a reason for that. Removing the direct Ubuntu variants, the site lists these as Arch Linux, CentOS, Debian, Fedora, Gentoo, gOS, Knoppix, Linux Mint, Mandriva, MontaVista Linux, OpenGEU, openSUSE, Oracle Enterprise Linux, Pardus, PCLinuxOS, Red Hat Enterprise Linux, Sabayon Linux, Slackware and, finally, Slax.

Doing a both a Google and a Bing search for “linux distributions” I found a number of additional websites that seem as though they might prove to be very useful. All of these websites aim to provide information about the various distributions or help point you in the direction of the one that’s right for you.

Only the start

Things are just getting started. There is plenty more research to do as I compare and narrow down the distributions until I finally arrive at the one that I will install come September 1st. Hopefully I can wrap my head around things by then.

Blast from the Past: Installing Gnome Do with Docky on openSUSE

January 19th, 2017 No comments

This post was originally published on September 28, 2009. The original can be found here.


Before I switched to Windows 7 for my laptop, I used a a dock software called RocketDock to manage my windows and commonly used desktop shortcuts. I liked being able to see my whole desktop ever since I found a good wallpaper site. Back when I rolled Ubuntu, I installed this application called Gnome Do. It’s a Quicksilver like program that just works. However, the newest feature of Gnome Do that I loved was its Docky theme. It puts a dock similar to RocketDock on the bottom of your screen, and integrates it’s OS searching features right into the dock.

I decided to install the application from YaST, the default system administration tool. It indexes a fairly large number of repositories, and it did have Gnome Do. A few minutes later I had the app running, but unfortunately the version was way out of date. Gnome Do is on roughly version 0.8.x, and YaST gave me 0.4.x.

So off I went trying to find a .rpm for Gnome Do that would install. I was met with a lot of failure, with a ton of dependencies unable to be resolved and so on. Next I tried the openSUSE file from Gnome Do’s homepage, but for some reason the servers were down and I was unable to install that way either.

Frustrated and not knowing what to do next, I decided to hop on IRC and see if anyone in #SUSE on irc.freenode.net could help me out. They told me about this service called Webpin. There I found a .ymp [which is an openSUSE specific installer file like a .deb or .rpm] for Gnome Do, and a ymp for Gnome Do’s plugins. Downloading and opening the files installed the programs without any problems. The last step I had to take to enable Docky was to install compiz and enable desktop compositing. After that, a quick trip to Gnome Do’s preference dialog allowed me to use the Docky theme, and I was up and running!

Blast from the Past: The Distributions of Debian

January 12th, 2017 No comments

This post was originally published on August 21, 2009. The original can be found here.


Like many of the other varieties of Linux, Debian gives the end user a number of different installation choices. In addition to the choice of installer that Tyler B has already mentioned, the Debian community maintains three different distributions, which means that even though I’ve picked a distribution, I still haven’t picked a distribution! In the case of Debian, these distributions are as follows:

  1. Stable: Last updated on July 27th, 2009, this was the last major Debian release, codenamed “Lenny.” This is the currently supported version of Debian, and receives security patches from the community as they are developed, but no new features. The upside of this feature freeze is that the code is stable and almost bug free, with the downside that the software it contains is somewhat dated.
  2. Testing: Codenamed “Squeeze,” this distribution contains code that is destined for the next major release of Debian. Code is kept in the Testing distribution as long as it doesn’t contain any major bugs that might prevent a proper release (This system is explained here). The upside of running this distribution is that your system always has all of the newest (and mostly) bug free code available to users. The downside is that if a major bug is found, the fix for that bug may be obliged to spend a good deal of time in the Unstable distribution before it is considered stable enough to move over to Testing. As a result, your computer could be left with broken code for weeks on end. Further, this distribution doesn’t get security patches as fast as Stable, which poses a potential danger to the inexperienced user.
  3. Unstable: Nicknamed Sid after the psychotic next door neighbour in Toy Story who destroys toys as a hobby, this is where all of Debian’s newest and potentially buggy code lives. According to what I’ve read, Sid is like a developer’s build – new users who don’t know their way around the system don’t generally use this distribution because the build could break at any time, and there is absolutely no security support.

I’m currently leaning towards running the Testing distribution, mostly because I like new shiny toys, and (I think) want the challenge of becoming a part of the Debian community. Since we’ve been getting a lot of support from the various development communities lately, perhaps some of our readers could set me straight on any information that I might have missed, and perhaps set me straight on which distribution I should run.

KWLUG: Vigrant (2017-01)

January 11th, 2017 No comments

This is a podcast presentation from the Kitchener Waterloo Linux Users Group on the topic of Vigrant published on January 9th 2017. You can find the original Kitchener Waterloo Linux Users Group post here.

Read more…

Categories: Linux, Podcast, Tyler B Tags: ,

Shove ads in your pi-hole!

January 8th, 2017 No comments

There are loads of neat little projects out there for your Raspberry Pi from random little hacks all the way up to full scale home automation and more. In the past I’ve written about RetroPie (which is an awesome project that you should definitely check out!) but this time I’m going to take a moment to mention another really cool project: pi-hole.

Pi-hole, as their website says, is “a black hole for Internet advertisements.” Essentially it’s software that you install on your Raspberry Pi (or other Linux computer) that then acts as a local DNS proxy. Once it is setup and running you can point your devices to it individually or just tell your router to use that instead (which then applies to everything on the network).

Then as you’re browsing the internet and come across a webpage that is trying to serve you ads, pi-hole will simply block the DNS request for the ad from really resolving and instead return a blank image or web page meaning that the site simply can’t download the ad to show you. Voila! Universal ad blocker for your entire network and all of your devices! Even better – because you’re blocking the ads from being downloaded in the first place your browsing speeds can sometimes be improved as well.

Pi-hole dashboard

You can monitor or control which domains are blocked all from a really nice dashboard interface and see the queries come into pi-hole almost in real time.

After running pi-hole for a week now I’m quite surprised with how effective it has really been with removing ads. It’s legitimately pleasant being able to browse the web without seeing ads everywhere or having ad blockers break certain websites. If that sounds like something you too might be interested in then pi-hole might be worth taking a look.


This post originally appeared on my personal website here.

Blast from the Past: Of filesystems and partitions

January 5th, 2017 No comments

This post was originally published on August 25, 2009. The original can be found here.


Following from my last post about finalizing all of those small little choices I will now continue along that line but discuss the merits of the various filesystems that Linux allows me to choose from, as well as discuss how I am going to partition my drive.

Filesystem?

For a Windows or Mac user the filesystem is something they will probably never think about in their daily computing adventures. That is mostly because there really isn’t a choice in the matter. As a Windows user the only time I actually have to worry about the filesystem is when I’m formatting a USB drive. For my hard drives the choices are NTFS, NTFS, and.. oh yeah NTFS. My earliest recollection of what a filesystem is happened when my Windows 98 machine had crashed and I had to wait while the machine forced a filesystem check on the next start up. More recently FAT32 has gotten in my way with it’s 4GB file size limitation.

You mean we get a choice?

Linux seems to be all about choice so why would it be surprising that you don’t get to pick your own filesystem? The main contenders for this choice are ext2, ext3, ext4, ReiserFS, JFS, XFS, Btrfs and in special places Fat16, Fat32, NTFS, and swap.

Ext2

According to the great internet bible, ext2 stands for the second extended filesystem. It was designed as a practical replacement for the original, but very old, Linux filesystem. If I may make an analogy for Windows users, ext2 seems to be the Linux equivalent to Fat32, only much better. This filesystem is now considered mostly outdated and only really still used in places where journaling is not always appropriate; for example on USB drives. Ext2 can be used on the /boot partition and is supported by GRUB.

Ext2 Features

  • Introduced: January 1993
  • File allocation: bitmap (free space), table (metadata)
  • Max file size: 16 GiB – 64 TiB
  • Max number of files: 10^18
  • Max filename length: 255 characters
  • Max volume size: 2 TiB – 32 TiB
  • Date range: December 14, 1901 – January 18, 2038

Ext 3

Ext3 is the successor to ext2 and removed quite a few of the limitations and also added a number of new features, most important of which was journaling. As you might have guessed it’s full name is the third extended filesystem. While ext3 is generally considered to be much better than ext2 there are a couple of problems with it. While ext3 does not have to scan itself after a crash, something that ext2 did have to do, it also does not have a an online defragmenter. Also because ext3 was primarily designed to shore up some of ext2’s faults, it is not the cleanest implementation and can actually have worse performance than ext2 in some situations. Ext3 is still the most popular Linux filesystem and is only now slowly being replaced by its own successor ext4. Ext3 can be used on the /boot partition and is fully supported by GRUB.

Ext3 Features

  • Introduced: November 2001
  • Directory contents: Table, hashed B-tree with dir_index enabled
  • File allocation: bitmap (free space), table (metadata)
  • Max file size: 16 GiB – 2 TiB
  • Max number of files: Variable, allocated at creation time
  • Max filename length: 255 characters
  • Max volume size: 2 TiB – 16 TiB
  • Date range: December 14, 1901 – January 18, 2038

Ext4

Ext4 is the next in the extended filesystem line and the successor to ext3. This addition proved to be quite controversial initially due to its implementation of delayed allocation which resulted in a very long time before writes. However ext4 achieves very fast read time thanks to this delayed allocation and overall it performs very well when compared to ext3. Ext4 is slowly taking over as the defacto filesystem and is actually already the default in many distributions (Fedora included). Ext4 cannot be used on the /boot partition because of GRUB, meaning a separate /boot partition with a different filesystem must be made.

Ext4 Features

  • Introduced: October 21, 2008
  • Directory contents: Linked list, hashed B-tree
  • File allocation: Extents/Bitmap
  • Max file size: 16 TiB
  • Max number of files: 4 billion
  • Max filename length: 256 characters
  • Max volume size: 1 EiB
  • Date range: December 14, 1901 – April 25, 2514

ReiserFS

Created by Hans ‘I didn’t murder my wife’ Reiser, in 2001 this filesystem was very promising for its performance but has since been mostly abandoned  by the Linux community. It’s initial claim to fame was as the first journaling filesystem to be included within the Linux kernel. Carefully configured, ReiserFS can achieve 10 to 15x the performance of ext2 and ext3. ReiserFS can be used on the /boot partition and is supported by GRUB.

ReiserFS Features

  • Introduced: 2001
  • Directory contents: B+ tree
  • File allocation: Bitmap
  • Max file size: 8 TiB
  • Max number of files: ~4 billion
  • Max filename length: 4032 characters theoretically, 255 in practice
  • Max volume size: 16 TiB
  • Date range: December 14, 1901 – January 18, 2038

Journaled File System (JFS)

Developed by IBM, JFS sports many features and is very advanced for its time of release. Among these features are extents and compression. Though not as widely used as other filesystems, JFS is very stable, reliable and fast with low CPU overhead. JFS can be used on the /boot partition and is supported by GRUB.

JFS Features

  • Introduced: 1990 and 1999
  • Directory contents: B+ tree
  • File allocation: Bitmap/extents
  • Max file size: 4 PiB
  • Max number of files: no limit
  • Max filename length: 255 characters
  • Max volume size: 32 PiB

XFS

Like JFS, XFS is one of the oldest and most refined journaling filesystems available on Linux. Unlike JFS, XFS supports many additional advanced features such as striped allocation to optimize RAID setups, delayed allocation to optimize disk data placement, sparse files, extended attributes, advanced I/O features, volume snapshots, online defragmentation, online resizing, native backup/restore and disk quotas. The only real downsides XFS suffers from are its inability to shrink partitions, a difficult to implement un-delete, and quite a bit of overhead when new directories are created and directories are deleted. XFS is supported by GRUB, and thus can be used as the /boot partition, but there are reports that it is not very stable.

XFS Features

  • Introduced: 1994
  • Directory contents: B+ tree
  • File allocation: B+ tree
  • Max file size: 8 EiB
  • Max filename length: 255 characters
  • Max volume size: 16 EiB

Btrfs

Btrfs, or “B-tree FS” or “Butter FS”, is a next generation filesystem will all of the bells and whistles. It is meant to fill the gap of lacking enterprise filesystems on Linux and is being spearheaded by Oracle. Wikipedia lists its new promised features as online balancing, subvolumes (separately-mountable filesystem roots), object-level (RAID-like) functionality, and user-defined transactions among other things. It’s stable version is currently being incorporated into mainstream Linux kernels.

Btrfs Features

  • Introduced: 20xx
  • Directory contents: B+ tree
  • File allocation: extents
  • Max file size: 16 EiB
  • Max number of files: 2^64
  • Max filename length: 255 characters
  • Max volume size: 16 EiB

So what’s it all mean?

Well there you have it, a quick and concise rundown of the filesystem options for your mainstream Linux install. But what exactly does all of this mean? Well, as they say, a picture speaks a thousand words. Many people have done performance tests against the mainstream filesystems and many conclusions have been drawn as to what is the best in many different circumstances. As I assume most people would chose either XFS, ext3, ext4 or maybe even Btrs if they were a glutton for punishment I just happen to have found some interesting pictures to show off the comparison!

Rather than tell you which filesystem to pick I will simply point out a couple of links and tell you that while I think XFS is a very underrated filesystem I, like most people, will be going with ext4 simply because it is currently the best supported.

Links (some have pictures!):

EXT4, Btrfs, NILFS2 Performance Benchmarks

Filesystems (ext3, reiser, xfs, jfs) comparison on Debian Etch

Linux Filesystem Performance Comparison for OLTP with Ext2, Ext3, Raw, and OCFS on Direct-Attached Disks using Oracle 9i Release 2

Hey! You forgot about partitions!

No, I didn’t.

Yes you did!

OK, fine… So as Jon had pointed out in a previous post the Linux filesystem is broken down into a series of more or less standard mount points. The only requirements for Fedora, my distribution of choice, and many others are that at least these three partitions exist: /boot for holding the bootable kernels, / (root) for everything else, and a swap partition to move things in and out of RAM. I was thinking about creating a fourth /home partition but I gave up when I realized I didn’t know enough about Linux to determine a good partition size for that.

OK, so break it down

/boot

Fedora recommends that this partition is a minimum of 100MB in size. Even though kernels are each roughly 6MB in size it is better to be safe than sorry! Also because ext4 is not supported by GRUB I will be making this partition ext3.

LVM

I know what you’re thinking, what the hell is LVM? LVM stands for Logical Volume Manager and allows a single physical partition to hold many virtual partitions. I will be using LVM to store the remainder of my partitions wrapped inside of a physical encrypted partition. At least that’s the plan.

swap

Fedora recommends using the following formula to calculate how much swap space you need.

If M < 2
S = M *2
Else
S = M + 2

Where M is the amount of memory you have and S is the swap partition size in GiB. So for example the machine I am using for this experiment has 4 GiB of RAM. That translates to a swap partition of 6 GiB. If your machine only has 1 GiB of RAM then the formula would translate to 2 GiB worth of swap space. 6 GiB seems a bit overkill for a swap partition but what do I know?

/ (root)

And last but not least the most important part, the root partition. This partition will hold everything else and as such will be taking up the rest of my drive. On the advice of Fedora I am going to leave 10 GiB of LVM disk space unallocated for future use should the need arise. This translates to a root partition of about ~300 GiB, plenty of space. Again I will be formatting this partition using ext4.

Well there you go

Are you still with me? You certainly are a trooper! If you have any suggestions as to different disk configurations please let me know. I understand a lot of this in theory but if you have actual experience with this stuff I’d love to hear from you!

Download YouTube videos with youtube-dl

December 31st, 2016 No comments

Have you ever wanted to save a YouTube video for offline use? Well now it’s super simple to do with the easy to use command line utility youtube-dl.

Start by installing the utility either through your package manager (always the recommended approach) or from the project GitHub page here.

sudo apt-get install youtube-dl

This utility comes packed with loads of neat options that I encourage you to read about on the project page but if you just want to quickly grab a video all you need to do is run the command:

youtube-dl https://www.youtube.com/YOUR_REAL_VIDEO_HERE

So for example if you wanted to grab this year’s YouTube Rewind you would just run:

youtube-dl https://www.youtube.com/watch?v=_GuOjXYl5ew

and the video would end up in whatever directory your terminal is currently in. Can’t get much easier than that!

Categories: Linux, Tyler B Tags: ,

Happy New Year!

December 31st, 2016 No comments

Yeah I know technically this is going up a day early but so what? 😛

From all of us at The Linux Experiment we want to wish you all the best in 2017!

 

Categories: Tyler B Tags:

Fixing Areca Backup on Ubuntu 16.04 (and related distributions)

December 30th, 2016 No comments

Seems like I’m at it again, this time fixing Areca Backup on Ubuntu 16.04 (actually Linux Mint 18.1 in my case). For some reason when I download the current version (Areca 7.5 for Linux/GTK) and try and run the areca.sh script I get the following error:

tyler@computer $ ./areca.sh
ls: cannot access ‘/usr/java’: No such file or directory
No valid JRE found in /usr/java.

This is especially odd because I quite clearly do have Java installed:

tyler@computer $ java -version
openjdk version “1.8.0_111”
OpenJDK Runtime Environment (build 1.8.0_111-8u111-b14-2ubuntu0.16.04.2-b14)
OpenJDK 64-Bit Server VM (build 25.111-b14, mixed mode)

Now granted this may be an issue exclusive to OpenJDK, or just this version of OpenJDK, but I’m hardly going to install Sun Java just to make this program work.

After some digging I narrowed it down to the look_for_java() function inside of the areca_run.sh script located in the Areca /bin/ directory. Now I’m quite sure there is a far more elegant solution than this but I simply commented out the vast majority of this function and hard coded the directory of my system’s Java binary. Here is how you can do the same.

First locate where your Java is installed by running the which command:

tyler@computer $ which java
/usr/bin/java

As you can see from the output above my java executable exists in my /usr/bin/ directory.

Next open up areca_run.sh inside of the Areca /bin/ directory and modify the look_for_java() function. In here you’ll want to set the variable JAVA_PROGRAM_DIR to your directory above (i.e. in my case it would be /usr/bin/) and then return 0 indicating no error. You can either simply delete the rest or just comment out the remaining function script by placing a # character at the start of each line.

#Method to locate matching JREs
look_for_java() {
JAVA_PROGRAM_DIR=”/usr/bin/”
return 0
# IFS=$’\n’
# potential_java_dirs=(`ls -1 “$JAVADIR” | sort | tac`)
# IFS=
# for D in “${potential_java_dirs[@]}”; do
#    if [[ -d “$JAVADIR/$D” && -x “$JAVADIR/$D/bin/java” ]]; then
#       JAVA_PROGRAM_DIR=”$JAVADIR/$D/bin/”
#       echo “JRE found in ${JAVA_PROGRAM_DIR} directory.”
#       if check_version ; then
#          return 0
#       else
#          return 1
#       fi
#    fi
# done
# echo “No valid JRE found in ${JAVADIR}.”
# return 1
}

Once you’ve saved the file you should be able to run the normal areca.sh script now without encountering any errors!


This post originally appeared on my personal website here.

Blast from the Past: Linux Media Players Suck – Part 1: Rhythmbox

December 30th, 2016 No comments

This post was originally published on May 5, 2010. The original can be found here.


The state of media players on Linux is a sad one indeed. If you’re a platform enthusiast, you may want to cover your ears and scream “la-la-la-la” while reading this article, because it will likely offend your sensibilities. In fact, the very idea behind this series is to shake up the freetards’ world view, and to make them realize that a decent Winamp or iTunes clone need not be the end of the story for media management and playback on Linux.

This article will concentrate on lambasting Rhythmbox, the default jukebox software of the GNOME desktop environment. Subsequent posts will give the same treatment to other players in this sphere, including Banshee, Amarok, and Songbird (if I can find a copy that will still build on Linux). If you’re a user of media players on Linux, keep your own annoyances firmly in mind, and if I don’t mention them, please share in the comments. If you’re a developer for one of these fine projects, try to keep an open mind and get inspired to do better. A media player is not a hard thing to build, and I do believe that together, we can do better.

For the remainder of this article, please keep in mind that I am currently running Rhythmbox under Kubuntu 9.10, so you’ll see it rendered with qt widgets in all of my screen shots. This doesn’t affect the overall performance of the app, but leads nicely into my first complaint:

  1. Poor Cross-Platform Support: There are basically two desktop environments that matter in the Linux world, GNOME and KDE. Under GNOME, Rhythmbox has a reasonably nice icon set that is comparable to other media players. Under KDE, the qt re-skinning replaces those icons with a horrible set of mismatched images that really make the program look second-rate:
    Isn't this shit awful?

    As you can see, these icons look terrible. Note that there isn’t even an icon for ‘Burn’ and the icon for ‘Browse’ is a fucking question mark.

    This extends to the CD burning and help features too. They rely on programs like gnome-help and brasero to work, but don’t install them with the media player, so when I try to access these features under KDE, I just get error messages. Nice.

    Honestly, who packaged this thing?

    This is just plain stupid. Every package manager has the concept of dependencies, so why doesn’t Rhythmbox use them?

  2. The Player Starts in the Tray: Under what circumstances would it be considered useful for a media player to automatically minimize itself to the system tray on startup? It doesn’t begin to play automatically. The first thing that I always do is click on the tray icon to maximize it so that I can select some music to start playing. Way to start the user experience off on the wrong foot.
  3. Missing Files View: This one is just plain stupid. Whenever I delete a file from my hard drive, it shows up under the ‘Missing Files’ view, even though my intent was clearly to remove the file from my library. Further, I use Rhythmbox to put music on my BlackBerry. Whenever I fill it with music, I first delete the files on it. Those files that I deleted from my mobile device? Yeah, they show up under ‘Missing Files’ too, as if they were a legitimate part of my library! So this view ends up being like a global garbage bin that I have to waste my precious time emptying on occasion, and serves no useful purpose in the mean time. Yeah, I deleted those files. What are you going to do about it?

    Seriously, why the hell are these files in here?

    As you can see, I’ve highlighted the fact that Rhythmbox is telling me that these files are missing from my mobile device. No shit.

  4. Shared Libraries that I can’t Play: So we’ve known for awhile now that Apple broke the ability to connect to iTunes via the DAAP protocol, and that it’s not possible to connect to a shared iTunes library from Linux. If that’s the case, why does Rhythmbox still show these libraries as available? And how come it shows my library under this node? Why would I listen to my own shared library? Finally, I’ve found that even if I’m running Rhythmbox on another machine, I still can’t connect to my shared library. This feature seems to be downright broken – so why is it still in the build?
  5. The GUI and Backend are on One Thread: I keep about half of my music collection as lossless FLAC files. When I want to rip these files to my portable media device, they need to be converted to the Mp3 format. Turns out that Rhythmbox thinks it appropriate to transcode these files on the same thread that it uses to update its GUI, so that while this process is taking place, the app becomes laggy, and at times, downright unusable. Further, the application doesn’t seem to give me any control over the bitrate that my songs are transcoded to. Fuck!
  6. Lack of Playlist Options: Smart playlists in Rhythmbox are missing a rather key feature: Randomness. When filling the aforementioned mobile device with music, I would like to select a random 4GB of music from my top rated playlist. But I can’t. I can select 4GB of music by most every criteria except randomness, which means that I get the same 600 or so songs on my device every time I fill it. This is strange, because I can shuffle the contents of a static playlist; But I cannot randomly fill a smart playlist. Great.

    If you have a device that has a small amount of memory, this feature is essential

    It’s funny; I really want to like Rhythmbox, but it’s shit like this that ruins the experience for me

  7. Columns: What the fuck. Who wrote this part of the application? When I choose the columns that are visible in the main window, I can’t re-order them. That’s right. So the only order that I can put my columns in is Track, Title, Genre, Artist, Album, Year, Time, Quality, Rating. Can’t reorder them at all, and I have to go into the preferences menu to choose which ones are displayed, instead of being able to right-click on the column headers to select them like I can in every other program written in the last 10 years. This is just ridiculous. I know that the GTK+ toolkit allows you to create re-order-able columns, because I’ve seen it done.

    This is just so incredibly backward. I mean, columns are a standard part of the GTK+ toolkit, and I've seen plenty of other apps that do this properly.

    Why, for the love of God, can’t these be re-ordered?

  8. The Equalizer is Balls: No presets, and no preamp. So I can set the EQ, and my settings are magically saved, but I can only have one setting, because there doesn’t appear to be a way to create multiple profiles. And louder music sounds like balls, because I can’t turn down the preamp, so I get digital distortion throughout my signal. It would be better to just not have an equalizer at all.

    I mean, it works. But...

    I mean, it works. But…

  9. Context Menus Don’t Make Sense: Let’s just take a look at this context menu for a moment. There are three ways to remove a song from a playlist. You can Remove the song, which just removes it from the playlist, but not from your library or your hard drive. Alternatively, you can select Move to Trash, which does what you might expect – it removes the song from the playlist, the library, and your computer. I’ve got a problem with the naming conventions here. The purpose of Remove isn’t well explained, and confused the hell out of me at first. In addition, when browsing a mobile device that you’ve filled with music, the GUI breaks down even further. In this case, you can still hit Remove, which seems to remove the song from Rhythmbox’s listing, but leaves the file on the device. So now I have a file on my device that I can’t access. Great. The right-click menu also has the ability to copy and cut the song, even though there is no immediately obvious way to paste it. For that functionality, you’ll have to head up to the Edit menu.

    The right-click context menu

    I’m starting to run out of anger. The 10,000 papercuts that come along with this app are making me numb to it.

  10. No Command Line Tools: Now, normally, this wouldn’t bother me too much. A music library is something that’s meant to have a GUI, and doesn’t generally lend itself to working from the command line. In this case however, command line access to Rhythmbox would be really handy, because I’d like to set up a hot key on my keyboard that will skip songs or pause playback. Unfortunately, there’s no way to do that within the software, and it doesn’t have any command line arguments that I can call instead. Balls.

There you have it, 10 things that really ruin the Rhythmbox experience. While using this piece of software, I felt like the developers worked really hard to build something that was sort of comparable to Apple’s iTunes, and then stopped trying. That isn’t good enough! If we want to attract users to our platform of choice, and keep them here, we need to give them reasons to check it out, and even more to stick around. If I say to you that I want to have the best Linux media player, you tend to put the emphasis on the word Linux. Why not just make the best media player? GNOME is on at least half of all Linux desktops, if not more. Why hinder it with software that gives people a poor first impression of what Linux is capable of? Seriously guys, let’s step it up.

 

vi(m) or emacs? Neither, just use nano!

December 29th, 2016 No comments

There is quite a funny, almost religious, debate within the Linux community between the two venerable command line text editors vi or Vim and Emacs. Sure they have loads of features and plugins but do you really need that from a command line editor? I think for the most part, or perhaps for most people at least, the answer is no. Instead I’m going to do something really stupid and publicly state, on a Linux related website, that you should ignore both of those text editors and instead use what many consider an inferior, more simplistic one instead: nano.

Sure it doesn’t have all of the fancy bells and whistles but honestly half the time I’m using a command line editor it’s just to change one line of text. I don’t generally need the extra fluff and when I do I can always use a graphical editor instead. Besides it’s so easy to use… just look at how easy it is to use:

Create/edit a file:

  1. Open the file in nano
  2. Make your changes
  3. Save the changes

Open the file:

nano doc.txt

Make your changes:

Admit it, it's true!

Admit it, it’s true!

 

Save your changes:

No complicated key combinations to remember – it’s all listed at the bottom of the screen. Want to save, “Write Out,” your changes? Easy as Ctrl+O and then Enter to confirm.

Sooooooooo easy to use

Sooooooooo easy to use

So let’s all come together, stop the fanboy wars, and all embrace nano as the best command line text editor out there! 😛

 

Categories: Linux, Open Source Software, Tyler B Tags: , , ,

Going Linux Podcast (Still Going)

December 28th, 2016 No comments

Way back in the early days of The Linux Experiment I came across an excellent podcast called Going Linux which offered beginners advice for those people trying out Linux for the first time or just wanting to know more about Linux in general. I so happy to see that the podcast is still going strong (now at over 300 episodes!) and wanted to mention them again here because they were very helpful in our original experiment’s goal of Going Linux.

Their mascot might actually be better than ours!

Please do check them out at http://goinglinux.com/ or subscribe to their podcast by following the steps here.

 

Categories: Podcast, Tyler B Tags: ,

Blast from the Past: Going Linux, Once and for All

December 28th, 2016 No comments

This post was originally published on December 23, 2009. The original can be found here.


With the linux experiment coming to an end, and my Vista PC requiring a reinstall, I decided to take the leap and go all linux all the time. To that end, I’ve installed Kubuntu on my desktop PC.

I would like to be able to report that the Kubuntu install experience was better than the Debian one, or even on par with a Windows install. Unfortunately, that just isn’t the case.

My machine contains three 500GB hard drives. One is used as the system drive, while an integrated hardware RAID controller binds the other two together as a RAID1 array. Under Windows, this setup worked perfectly. Under Kubuntu, it crashed the graphical installer, and threw the text-based installer into fits of rage.

With plenty of help from the #kubuntu IRC channel on freenode, I managed to complete the Kubuntu install by running it with the two RAID drives disconnected from the motherboard. After finishing the install, I shut down, reconnected the RAID drives, and booted back up. At this point, the RAID drives were visible from Dolphin, but appeared as two discrete drives.

It was explained to me via this article that the hardware RAID support that I had always enjoyed under windows was in fact a ‘fake RAID,’ and is not supported on Linux. Instead, I need to reformat the two drives, and then link them together with a software RAID. More on that process in a later post, once I figure out how to actually do it.

At this point, I have my desktop back up and running, reasonably customized, and looking good. After trying KDE’s default Amarok media player and failing to figure out how to properly import an m3u playlist, I opted to use Gnome’s Banshee player for the time being instead. It is a predictable yet stable iTunes clone that has proved more than capable of handling my library for the time being. I will probably look into Amarok and a few other media players in the future. On that note, if you’re having trouble playing your MP3 files on Linux, check out this post on the ubuntu forums for information about a few of the necessary GStreamer plugins.

For now, my main tasks include setting up my RAID array, getting my ergonomic bluetooth wireless mouse working, and working out folder and printer sharing on our local Windows network. In addition, I would like to set up a Windows XP image inside of Sun’s Virtual Box so that I can continue to use Microsoft Visual Studio, the only Windows application that I’ve yet to find a Linux replacement for.

This is just the beginning of the next chapter of my own personal Linux experiment; stay tuned for more excitement.

This post first appeared at Index out of Bounds.

 

Help out a project with OpenHatch

December 27th, 2016 No comments

OpenHatch is a site that aggregates all of the help postings from a variety of open source projects. It maintains a whole community dedicated to matching people who want to contribute with people who need their help. You don’t even need to be technical like a programmer or something like that. Instead if you want to lend your artistic talents to creating icons and logos for a project, or your writing skills to help them out with documentation – both areas a lot of open source projects aren’t the best with – I’m sure they would be greatly appreciative.

So what are you waiting for? Get connected and give back to the community that helps create the applications you use on a daily basis!

Blast from the Past: Automatically put computer to sleep and wake it up on a schedule

December 26th, 2016 No comments

This post was originally published on June 24, 2012. The original can be found here.


Ever wanted your computer to be on when you need it but automatically put itself to sleep (suspended) when you don’t? Or maybe you just wanted to create a really elaborate alarm clock?

I stumbled across this very useful command a while back but only recently created a script that I now run to control when my computer is suspended and when it is awake.

#!/bin/sh
t=`date –date “17:00” +%s`
sudo /bin/true
sudo rtcwake -u -t $t -m on &
sleep 2
sudo pm-suspend

This creates a variable, t above, with an assigned time and then runs the command rtcwake to tell the computer to automatically wake itself up at that time. In the above example I’m telling the computer that it should wake itself up automatically at 17:00 (5pm). It then sleeps for 2 seconds (just to let the rtcwake command finish what it is doing) and runs pm-suspend which actually puts the computer to sleep. When run the computer will put itself right to sleep and then wake up at whatever time you specify.

For the final piece of the puzzle, I’ve scheduled this script to run daily (when I want the PC to actually go to sleep) and the rest is taken care of for me. As an example, say you use your PC from 5pm to midnight but the rest of the time you are sleeping or at work. Simply schedule the above script to run at midnight and when you get home from work it will be already up and running and waiting for you.

I should note that your computer must have compatible hardware to make advanced power management features like suspend and wake work so, as with everything, your mileage may vary.

This post originally appeared on my personal website here.

 

Blast from the Past: Linux from Scratch: I’ve had it up to here!

December 23rd, 2016 No comments

This post was originally published on November 27, 2011. The original can be found here.


As you may be able to tell from my recent, snooze-worthy technical posts about compilers and makefiles and other assorted garbage, my experience with Linux from Scratch has been equally educational and enraging. Like Dave, I’ve had the pleasure of trying to compile various desktop environments and software packages from scratch, into some god-awful contraption that will let me check my damn email and look at the Twitters.

To be clear, when anyone says I have nobody to blame but myself, that’s complete hokum. From the beginning, this entire process was flawed. The last official LFS LiveCD has a kernel that’s enough revisions behind to cause grief during the setup process. But I really can’t blame the guys behind LFS for all my woes; their documentation is really well-written and explains why you have to pass fifty --do-not-compile-this-obscure-component-or-your-cat-will-crap-on-the-rug arguments.

Patch Your Cares Away

CC attribution licensed from benchilada

Read more…

5 apt tips and tricks

December 22nd, 2016 No comments

Everyone loves apt. It’s a simple command line tool to install new programs and update your system, but beyond the standard commands like update, install and upgrade did you know there are a load of other useful apt-based commands you can run?

1) Search for a package name with apt-cache search

Can’t remember the exact package name but you know some of it? Make it easy on yourself and search using apt-cache. For example:

apt-cache search Firefox

It lists all results for your search. Nice and easy!

It lists all results for your search. Nice and easy!

2) Search for package information with apt-cache show

Want details of a package before you install it? Simple just search for it with apt-cache show.

apt-cache show firefox

More details than you probably even wanted!

More details than you probably even wanted!

3) Upgrade only a specific package

So you already know that you can upgrade your whole system by running

apt-get upgrade

but did you know you can upgrade a specific package instead of the whole system? It’s easy, just specify the package name in the upgrade command. For example to upgrade just firefox run:

apt-get upgrade firefox

4) Install specific package version

Normally when you apt-get install something you get the latest version available but what if that’s not what you wanted? What if you wanted a specific version of the package instead? Again, simple, just specify it when you run the install command. For example run:

apt-get install firefox=version

Where version is the version number you wish to install.

5) Free up disk space with clean

When you download and install packages apt will automatically cache them on your hard drive. This can be useful for a number of reasons, for example some distributions use delta packages so that only what has changed between versions are re-downloaded. In order to do this it needs to have a base cached file already on your hard drive. However these files can take up a lot of space and often times don’t get a lot of updates anyway. Thankfully there are two quick commands that free up this disk space.

apt-get clean

apt-get autoclean

Both of these essentially do the same thing but the difference here is autoclean only gets rid of cached files that have a newer version also cached on your hard drive. These older packages won’t be used anymore and so they are an easy way to free up some space.

There you have it, you are now officially 5 apt commands smarter. Happy computing!