Friday, October 10, 2014

Watching Netflix with Linux Without Ubuntu

Ubuntu has just announced that you can use Ubuntu to watch Netflix. They make it seem like Ubuntu is something unique and is the only way you can watch Netflix on Linux.

I use the Mageia disto of Linux, so that Ubuntu-specific mojo won't work for me.

Thankfully, it's not Ubuntu, but the beta version of the Chrome browser that has implemented DRM extensions for HTML5 video (along with a recent version of the NSS library, which Mageia has). all one need do is spoof the Use agent in Chrome to make Netflix think it's serving the video on a Windows platform and you are watching Netflix!

1. Download and install Google Chrome beta form here.
2. Install the User-Agent Switcher from here.
3, Configure the User-Agent Switcher to spoof the user-agent as Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2049.0 Safari/537.36 by adding it to the Chrome profile like this:



4. Log in to your Netflix account and enjoy the show.
5. No Ubuntu needed, just thank Nathan VanCamp.

Monday, August 04, 2014

Configuring a Headless Transmission Torrent Server for Mageia4

This will describe how to install and configure the Transmission torrent application on Mageia 4 in a headless configuration, how to make it automatically download torrents by placing a .torrent file in a particular directory and admin the client remotely using both a cli (command line interface) and a GUI (graphical user interface) application.

Transmission has both a Homepage,  a Wiki and a Forum, so there's no lack of help and support. But as for installing it as a headless server on Mageia, all we found were HOWTOs for Debian/Ubuntu systems.


We're assuming that you have Mageia4 installed and have configured your user to use the sudo command.


INSTALL
Begin by installing the transmission daemon and the command-line client.

$ sudo urpmi transmission-daemon transmission-cli

This installs  transmission-daemon, transmission-cli and transmission-common (which is mostly the documentation). All the binaries will be found in /usr/bin. The transmission package also installs a Java-based web client at /usr/share/transmission/web/index.html.

CREATE A USER
For transmission-daemon, all settings are kept in $HOME/.config/transmission-daemon. We want to create a user named "transmission". Other distros make the "home" directory something like /usr/share/transmission or /var/lib/transmission; it can really be anything you want. For us, creating /home/transmission has a special benefit.

$ sudo adduser transmission
$ sudo passwd transmission


Having a password allows us to use scp to remotely send a .torrent file to /home/transmission/ on our remote server and the torrent will automatically start when we have properly configured the transmission-daemon to do so.

OBTAIN AN INIT.D SCRIPT
There is an Debian/ubuntu-specific init.d script available from the Transmission site, but it won't work for RedHat-derived distros like Mageia.

We can download an init.d script useful for RHEL and Fedora (and Mageia) written by Jason Friedlan. It's located at his website; you'll need to copy and paste it into a text editor.

We'll need to make some changes for Mageia:

- TRANSMISSION_HOME=/var/lib/transmission
+ TRANSMISSION_HOME=/home/transmission


Save the script as transmission-daemon, change the ownership to root and make it executable, then move it it /etc/init.d.

$ sudo chown root:root transmission-daemon
$ sudo chmod +x transmission-daemon
$ sudo mv transmission-daemon /etc/init.d/

To verify that our script is valid for init.d invoke:

$ sduo chkconfig --add transmission-daemon

Now set the runlevels for transmission-daemon with:

$ sudo chkconfig --level 345 transmission-daemon on

and verify it with:

$ sudo chkconfig --list transmission-daemon

CREATE THE BASIC FILES
Now that our service is configured, let's start and stop the daemon to make certain it works.

$ sudo service transmission-daemon start
$ sudo service transmission-daemon stop


Then invoke:

$ sudo ls -al /home/transmission

This will reveal that the .config directory has been created and we will find that /home/transmission/.config/transmission/settings.json has also been created.

CONFIGURE TRANSMISSION
The editable text file settings.json contains the default configuration for our daemon. It can be edited with a text editor and an explanation of the various options can be found at the Transmission Wiki.

Some suggested changes are (the trailing commas are important!):

Add a blocklist:
- "blocklist-url": "http://www.example.com/blocklist",
+ "blocklist-url": "http://list.iblocklist.com/?list=bt_level1&fileformat=p2p&archiveformat=gz",


Allow all users on the network to access the web interface:
- "rpc-whitelist": "127.0.0.1",.
- "rpc-whitelist-enabled": true,.

+ "rpc-whitelist": "*.*.*.*",
+ "rpc-whitelist-enabled": false,






Save the file and restart the service.

Setting a username and password to stop all users but us is important, but this must be done with the transmission-remote command because the password is hashed for security and not stored as plain-text.
$ su - transmission
$ transmission-remote --auth username:password


You can use transmission-remote to change any of the settings; look at the man page for details or at the Wiki page.

You'll need to set the home directory to auto-download any torrents. First, we'll need to enable it, then set the directory. As shown here, we'll do it on one line each:
$ su - transmission -c transmission-remote --watch-dir-enabled true
$ su - transmission -c transmission-remote --watch-dir /home/transmission


And, we'll have it keep downloaded torrents in /home/transmission/Downloads.
$ su - transmission  -c transmission-remote download-dir /home/transmission/Downloads

If you don't change a setting, transmission will use the default setting. You can see the default setting by examining the settings.json file or looking at the Wiki page referenced just above.

If you are GUI-centric and command-line-phobic, install the GTK or QT clients and as the user "transmission" use the transmission client GUI to change the settings. That's pretty easy.

NOW START TRANSMISSION
 $sudo service transmission-daemon start

  And you are ready to use it.

START TORRENTS AUTOMATICALLY

Instead of clicking on a torrent link, save the link instead and move it to the torrent user.

$sudo mv *.torrent /home/torrent/

Now the download starts automatically! You can even do this from a remote computer, so if your server is at home and you are at work, just copy the .torrent file over the Internet and the download will be done by the time you get home.

To admin your Transmission server, there's the provided Java web client, or a stand-alone application called

FEEDBACK
As always, I'd appreciate any feedback, especially if I made any errors in this.

Tuesday, May 27, 2014

Keep Updating Windows XP until 2019

Microsoft ended support for Windows XP on April 8th of 2014. But they will continue to support the Point Of Sale version of Windows XP, Windows Embedded POSReady 2009, for five more years.

To receive these updates for your Windows XP computer, you need to alter a registry entry to fool the Microsoft Update server into thinking that you are using Windows Embedded POSReady 2009.

Here is a .reg file that looks like this if you view it in a text editor:

 [HKEY_LOCAL_MACHINE\SYSTEM\WPA\PosReady]
"Installed"=dword:0000000

Download and double-click on the file file, then just run Windows Update.

NOTE: You may need to rename the file from WinXP_Update.reg.txt to WinXP_Update.reg first.

Not all the available updates are useful for you; don't select the updates for Windows Server 2003. However, if you do they will just fail to install. This means that Automatic Update will continue to work as before until 2019 (You do have that turned on, right?) and Microsoft Security Essentials will continue to update (you do have that installed, right?). You should be ready for a new computer by 2019 anyway.

If you have a 64-bit Windows XP installation, look here.

One last note. It's not likely that any of the future updates of Windows Embedded POSReady 2009 will update the Internet Explorer web browser. Unfortunately, Internet Explorer is the source (or the vector) of most all of the attacks. Here's how to protect yourself: DO NOT UNDER ANY CIRCUMSTANCES CONTINUE TO USE INTERNET EXPLORER. Replace it with the most recent edition of the Firefox browser and install the AdBlock extension. Most malware nowadays is installed through Internet Explorer via malicious ads that you are completely unaware of.

There are also attack vectors through Microsoft Office. A free and capable alternative is LibreOffice.

An excellent free and capable email application and alternative to Outlook Express is Thunderbird.

I also highly recommend three additional programs for Windows XP:

Piriform's CCleaner to clean up unnecessary files on your drive, since Windows loves lot's of free space on the drive. Get the Free Download version and DO NOT install any toolbars if prompted.

Piriform's Defraggler to defragment your drive after you clean it up, since Windows loves a defragmented drive. Get the Free Download version and DO NOT install any toolbars if prompted.

The free Microsoft utility Page Defrag. This authentic Microsoft utility will defrag the special system files that a regular defrag application like Defraggler can't touch.

Try them all; you'll be happy you did.


Saturday, February 08, 2014

The first release of Mageia 4 is out.



The first release of Mageia 4 is out. You can download it from here and read the release notes here.



If you've used Mandriva Linux, you'll feel right at home with Mageia. Mageia has quickly established a reputation of working well for both the novice user and the power user. Installation is typically easy and hardware support is among the best of any distro. The user and administrative tools are comprehensive and easy to use. Of course, under the hood, it's all Linux and all configuration files are plain text files and all a competent administrator needs do is to choose a shell and a text editor.

If you've used Red Hat or Fedora, the differences with Mageia are examined here.

Just like Mandriva, Mageia is known for excellent default fully-featured configurations of the KDE4, GNOME2, LXDE and other desktop environments as well as a broad range of available applications.

For the average user, the changes in Mageia4 are mostly cosmetic. The Mageia art, colors and graphics are very well done (and contributed by the Mageia user community). But if it's just a pretty Mandriva or prettier Magia3, why is there a need for a newer Mageia distro?

These changes are mostly "under the hood", but are done to keep pace with improvements in technology and compatibility with standards and interoperability.
Most tools have been ported to Gtk+-3which will allow the use of the Broadway technology. For improved security, all admin tools have been ported from to polkit when needing root privileges. Mageia 4 still comes with GRUB as a default but also provides GRUB2 for forward compatibility. For GNOME2 fans, the MATE desktop is available; it is a updated version of GNOME2. All software packages are the most recent stable versions (a few are stable beta releases).


Mageia began life as Mandriva. Mandriva began life as Mandrake Linux, based on Red Hat 5.2; Mandrake was essentially "Red Hat Done Better". It offered a well-configured KDE as the default desktop as well as its own administrative tools that provided more flexibility than those tools offered by Red Hat. The under-the-hood difference in these tools was that they were (and continue to be) written in perl language rather than the python language as used by Red Hat. Mandrake/Mandriva also spent considerable effort on its unique urpmi package management tool, essentially an intelligent, powerful console/gui wrapper around the RPM system of package management.


At some point, the business management of Mandrake/Mandriva lost its way, rallied, re-grouped and then lost its way again. The first time, they lost focus on Linux and the second time, they lost focus on their community. Mageia stepped in to fill the void in the community so that all the good things that were represented by the Mandriva distro would not be lost in the corporate buyout.


Which is why the software is so similar and the community is so different; you only need to fix what is broken.


Mageia4 offers the most recent version of your favorite application software and all the major software you expect to be there is there.

Both 32-bit and 64-bit installation DVDs as well as a Live CD are available. Migration from existing Mageia3 installations is easily done. A large on-line software repository is available and provides a wide range of software of both free licensed and other licensed  categories (the latter is not enabled by default, but is opt-in). Third-party Repositories are also available.

As with any initial release, you're likely to find a few minor bugs, but the Mageia community is there to help you. As a long-time user of Mandrake/Mandriva and co-author with Bill Ball of the Red Hat/Fedora Unleashed series, I believe you'll find Mageia a full-featured and easy-to-use Linux distro.

A guide to update from Mageia 3 can be found here.

A Faster System

I'm always looking for ways to speed up my computer, especially when it comes to the boot process and loading applications. A good overall discussion or improving system performance is at https://wiki.archlinux.org/index.php/Maximizing_Performance, just remember that it focuses on the ArchLinux distro, not the Mandriva distro I use.


READAHEAD
A useful utility is readahead. According to its manpage, readahead populates the page cache with data from a file so that subsequent reads from that file will not block on disk I/O. On my Mandriva 2101.2 system, the default installation of readahead places a default file at /var/lib/readahead/default.early. To create custom files based on your system, you should reboot the system and pause the GRUB menu and add the following to the command line.

init=/sbin/readahead-collector

This will examine your system as it boots and create a list of what files are to be loaded in the order that they are loaded.

The configuration file is found at /etc/readahead.conf and this is where you can turn on debugging if you're experiencing problems and can add excluded directories.

PRELINK
Next is the prelink utility. According to the man page, prelink is a program that modifies ELF shared libraries and ELF dynamically linked binaries in such a way that the time needed for the dynamic linker to perform relocations at startup significantly decreases. Due to fewer relocations, the run-time memory consumption decreases as well (especially the number of un-sharable pages).

The file /etc/prelink.conf contains a list of files and directories that prelink uses to determine where it should look and what files to avoid. Prepending -l (or -h if on a networked filesystem) to a path makes prelink search that directory for ELF binaries or shared libraries. You can prepend -b to blacklist a directory or a file to avoid which will speed up the search or deliberately avoid prelinking certain binaries.

Mandriva provides a directory to keep your customizations separate at /etc/prelink.conf.d/; just create a file there ending in .conf and your customizations will be included. The general invocation is

# prelink -a

Upgrade Mageia 2 or Mageia3 to Mageia 4

Back in the early days of Linux, the changes to the OS were so dramatic that even when updating withing the same distro, in-place point release updates were problematic enough and it was always recommended that a major version release be done from scratch. There were just too many major changes to the underlying subsystems and package naming conventions. Doing an in-place update was just asking for trouble.

Modern distros have matured quite a bit although there are occasionally some major subsystem changes being made. Yet it's never been easier to do an in-pace major version upgrade.

I just did the upgrade on several Mageia3 systems and the results were consistent and satisfactory, not to mention simple.

Step 0.

Always backup critical information. Have a Mageia3 recovery disc on hand.

From GUI

Step 1.

$ sudo mgaapplet-upgrade-helper --new_distro_version=4

Done.


From CLI

Step 1.

Fully update the packages you now have installed.

$ sudo urpmi --auto-update --auto -v


Step 2.

Remove all the existing Mageia4 repositories.

$ sudo urpmi.removemedia -av

Step 3.

Add the Mageia4 repositories. (All on one line.)

$ sudo urpmi.addmedia --distrib --mirrorlist 'http://mirrors.mageia.org/api/mageia.4.i586.list'

Step 4.

Update the packages

$ sudo urpmi --replacefiles --auto-update --auto -v

Step 5.

Reboot. You'll be using a new kernel, new glibc and so on.

$ sudo shutdown -r now

Step 6.

Run the package update command again. It should return with no packages needing updating.

Done.  But . . . .

Do Some Checking.

$ cat /etc/redhat-release
$ cat /etc/issue

Those commands should return the information that you are running Mageia4. I did have an issue on one machine and $ sudo urpmi mageia-release-common fixed it. You can also edit these files to change the version number.

Monday, April 15, 2013

Third-Party Repositories for Mageia

The subject of third-party repositories for Mageia is a touchy one for some people. For the maintainers of a distro, they feel that third-party repos cause compatibility problems and the packages are not subject to adequate. The third-party maintainers believe that they are maintaining either specially modified packages useful to their members or packages that the main distro cannot, for legal reasons, maintain and distribute. Both are correct.

If you need a package offered by a third-party repo, then by all means use it carefully. If not, don't even add the repos to your local repositories.

For Mandriva, the PLF at plf.zarb.org and MIB at PianetaLinux.org provided those services. For Mageia, it looks like BlogDrake.net is taking the lead.

You may add the appropriate repos as root using the commands below:

Mageia 4
urpmi.addmedia --wget --distrib ftp://ftp.blogdrake.net/mageia/mageia4/x86_64
urpmi.addmedia --wget --distrib ftp://ftp.blogdrake.net/mageia/mageia4/i586 


If you want to learn more about adding third-party repositories, look at the Mageia Software Manual.