sudo – what is it?

If you’ve been following my posts for a while, you will have also noticed the use of the sudo command in a lot of the Unix/Linux configuration and setup instructions. This is because of the security model used by these operating systems. Users generally have limited access, and only the ‘root’ or admin accounts has greater access. A common convention is to use the sudo command to allow for temporary (usually 5 minutes at a time) permission to make changes, using escalated rights for an existing non root user.

It’s often best to think of “sudo” as “mother may I”, as the server administrator can give users access to some (but not all) commands.

Permissions are stored in a file that can be edited in a variety of manners (do so carefully):
/etc/sudoers

To give an existing user permission to use sudo…

sudo adduser USERNAME sudo

REFERENCES:

Install Netflix on Ubuntu via Wine

UPDATE: (Sept. 2014) – Netflix will soon natively support Ubuntu, there are only a few small hurdles remaining, likely to be resolved by the NSS update expected in Ubuntu 14.10 (Utopic). A workaround is available for the impatient… http://www.omgubuntu.co.uk/2014/08/netflix-linux-html5-support-plugins.

For various reasons primarily related to DRM, there is not a native Ubuntu/Linux viewer for Netflix… this is one of the cases where WINE can help you out by providing (not emulating) a Windows environment.

These commands are for the Ubuntu setup, similar steps for other Linux distributions are available in the references.

I’ve found that it is better to pre-install the Wine Gecko and Wine Mono packages on Ubuntu.


sudo apt-get install wine-gecko
sudo apt-get install wine-mono

Then…

sudo apt-add-repository ppa:ehoover/compholio
sudo apt-get update
sudo apt-get install netflix-desktop

If you’ve never used WINE before within your Ubuntu/Linux environment, you’ll likely need to let it download the extensions for Windows, I believe that it will request to download and install the Gecko and Mono packages described above, click "Yes" if asked and all should go well!

REFERENCES:

Ubuntu fixing screen backlight brightness toggle

For quite some time, my primary Ubuntu laptop has had a problem with the keyboard keys used to adjust the screen brightness. This had been an annoyance on some of my travels where I’d wanted to extend battery life, as well as when I prefer to work in a darker space. I knew that it had to be a software driver issue of some sort, as it worked in my sometimes used dual boot Windows environment, but I’d never been bothered enough to look for a solution.

Truth is, it only took a minute or two to fix this!

  1. Modify the grub boot loader.
    sudo vi /etc/default/grub
  2. Change the line from:
    GRUB_CMDLINE_LINUX=""
    to
    GRUB_CMDLINE_LINUX="quiet splash acpi_osi=Linux acpi_backlight=vendor"
  3. Update the loader:
    sudo update-grub
  4. Reboot and you should be good to go!

REFERENCES:

Install Plex Media Server on Ubuntu

You can find the latest release listed here and either download the file to your server directly or use the path to update the wget in the commands listed below…
https://plexapp.zendesk.com/hc/en-us/articles/201181647-Plex-Media-Server-Linux-nix-

Pre-requisite, you need to have avahi installed first or the script will later prompt you to do so…
sudo apt-get install avahi-daemon

i386 install:
wget -c downloads.plexapp.com/plex-media-server/0.9.8.18.290-11b7fdd/plexmediaserver_0.9.8.18.290-11b7fdd_i386.deb
sudo dpkg -i plexmediaserver_0.9.8.18.290-11b7fdd_i386.deb

amd64 install:
wget -c downloads.plexapp.com/plex-media-server/0.9.8.18.290-11b7fdd/plexmediaserver_0.9.8.18.290-11b7fdd_amd64.deb
sudo dpkg -i plexmediaserver_0.9.8.18.290-11b7fdd_amd64.deb

Then a series of commands, they should all be relatively straight forward. As the installer creates and runs the software under a user named ‘plex’, I create the user folders and change the default password in these steps… do what you are comfortable with!

sudo apt-get -f install
sudo mkdir /home/plex
sudo mkdir /home/plex/Music
sudo mkdir /home/plex/Videos
cd /home/plex
sudo chown plex * -R
sudo chmod 777 * -R
sudo passwd plex

Now you should be able to access the app with your browser, change the IP if you are not on localhost.
http://{ip}:32400/manage/index.html

WARNING: An installation using these steps could leave your server open to the general public, you
will want to password protect your server to secure any sensitive content, I’ll leave that for a separate topic.

REFERENCES:

Setup of Static IP addresses on Ubuntu

In these examples, I have used the OpenDNS servers, please change as appropriate.


sudo vi /etc/network/interfaces

Example contents:

auto l0 eth0
auto lo
iface lo inet loopback
iface eth0 inet static
address 10.1.10.xxx
netmask 255.255.255.0
network 10.1.10.0
broadcast 10.1.10.255
gateway 10.1.10.1
dns-nameservers 208.67.222.222 208.67.220.220
dns-search home


sudo vi /etc/resolv.conf

NOTE: I’m not 100% sure if this is required!
Add appropriate content, example:

nameserver 208.67.222.222
nameserver 208.67.220.220
search home

sudo restart networking
ifconfig
sudo ifdown eth0 && ifup eth0
sudo restart

REFERENCES:

Install Docky on Ubuntu Linux

One of the most immediate differences that typical computers notice between an Apple and other operating systems is the Dock Bar. This is a possible addition to any operating system (such as Windows or Linux). On Ubuntu Linux you can easily install Docky in just a few minutes.

sudo add-apt-repository ppa:docky-core/ppa
sudo apt-get install docky

REFERENCES:

Remove old Ubuntu kernels

If you update your Ubuntu kernel frequently, eventually you will come to the realization that it is taking a lot of space to keep the old versions around on disk. Another annoyance is that your Grub loader will show a very long list. Sure, you can keep them around forever, should you need to recover them, but for most people it’s safe to remove them. You can manually select and remove the packages in Synaptic, but the easiest way I’ve found is to sun the following script instead. It will remove all old kernel version (except the current one!):

dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge

Occasionally, you might also want to follow that with the following to clean up other artifacts too…
sudo apt-get autoremove

REFERENCES:

Automatically update Java on Ubuntu Linux

With the rate of updates and security patches for Java, administration of your Ubuntu machines can become tedious. There’s a better way… allow it to check for and update with your other software. The steps are easy…


sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer

NOTE: You can also install java8 in the same manner with:
sudo apt-get install oracle-java8-installer

NOTE: The Java Control Panel can sometimes be hard to locate, it will be at the following:
/usr/lib/jvm/java-7-oracle/bin/ControlPanel

REFERENCES: