Netbook Server – Sharing An External Hard Drive In Linux

So if you have followed my instructions, you now have a:

Computer that runs Debian Linux
http://www.ramblingmoose.com/2016/02/the-netbook-server-installing-debian-or.html
Computer that you can look into using Remote Desktop
http://www.ramblingmoose.com/2016/02/the-netbook-server-you-need-to-be-able.html
Computer that you can share part of the local hard drive
http://www.ramblingmoose.com/2016/02/the-netbook-server-how-to-actually.html
Congratulations.  You now have a file server!

If you followed those directions, it also installed a bunch of other programs that will let you do other things.  I noticed that something called “CUPS” was installed, and that will let you plug a printer into the same machine and act as a “Print Server” or a “Network Printer” – if you can find the instructions on how to configure it.

Debian and Raspbian both come with enough that you could use that machine as your one and only daily driver computer.  The browser is called “Iceweasel” and is Firefox, rebranded.  You have Libre Office to write letters, work with spreadsheets, and make presentations that are all compatible with Microsoft Office.

Yes, it really is, I use it every day.  No, you don’t have to pay for it.  Ever.

There are more apps, and I would suggest looking into some of the software that is out there, all free.  If you start “synaptic” from your terminal as root or “sudo synaptic &” you will find so much free software that your mind will fog up and get tired before you find everything you want.

But that all is just the preamble to this discussion.  You came here to share an external drive.  This is like any other shared drive on the network, you have to have it plugged into the server (USB Port on your netbook), you have to tell the computer where it is, and you have to tell it how it is to be shared.

Remember, I am trying to write this for a Windows audience so I’ll go as basic as I can.  You Windows folks are in a new world, and you will want to have this go well.  If you are a Linux expert or even intermediate, you may find this needlessly wordy.   Not to worry, you’ll be right.

One Step At A Time.  Divide and Conquer.

First step – Make sure you can read the drive from Linux.


Before you get anywhere, start the computer.  Log in.  Get to your desktop.  Then plug in the drive.

Start your terminal session by clicking on the (start) “Applications Menu”, then click on Terminal.  Sign in as root by entering “su” and your root password.  You will eventually need this

Now, launch the file manager by clicking on the (start) “Applications Menu”, then click on “File Manager”.

In the left pane of the file manager you will see Devices, Places and Network.  In “Places” your external drive will come up with a little eject arrow to the right of it.  Click on the icon for the drive.  A little wait icon will start to rotate.  When it is through it will do one of two things:

Success is if you are dropped into a view of whatever files are on the disc.  It means that all the drivers are in place.  Most likely this drive is something called “vfat” or “fat32”.  Remember this for later.

Failure is if you get a big ugly warning message up.  That means that you don’t have the drivers for the format that the drive has on it.  Most likely you will have to install the set of drivers called “ntfs-3g”.  This would be where your external is a really big drive and you did it to make things faster.  To install that do the following steps:

  1. apt-get update
  2. apt-get upgrade
  3. apt-get install ntfs-3g
  4. shut down the server
  5. unplug the drive (It isn’t shared yet and you don’t want to wait for the computer to release it)
  6. start the server
  7. and plug in your drive when you have logged back in to the desktop, terminal, and file manager.

No matter what, at this point, you should be able to read your external drive.

You also need information.  When you worked with the server software “samba” you created a user and a password, and you will need that later.
 

Next step – finding where Linux thinks that drive actually is.

Here is where Linux people will be saying “gparted“.  If you know how, go for it, this is the slower but less risky method.

To determine what is plugged into your machine type into the terminal:

  • dmesg | tail -30

Linux keeps a log of whatever is important to the system.  Since you “just” plugged that external drive into the computer, the last thing on that very long stream of text will be what was reported when the computer detected the hardware.  The “tail” bit will tell terminal to just show the last 30 lines of what are in the display of messages (dmesg).

The clue there are the lines that say “usb 1-2” and “sdb”.  When I plugged in the drive, it said “new high-speed USB device number 2”.  So what we’re going to tell the system is that the drive is sitting on a device called sdb.  The partition we will be using will be the first one, so it is officially “/dev/sdb1”.  In windows, it would come up as your D drive if there is no DVD/CD drive present, E Drive if it is, this is the same thing.

Since my stick is formatted to be removable on Windows, it is a format that Linux calls “vfat“.    My big 4 TB drive is formatted NTFS, so I would have to mount it as “ntfs-3g

Create a place to store the data in.  In my case, it is “/home/bill/external“.  You should change “bill” to the name of your user that you logged into when you started this exercise.  To make the directory, open terminal again as a regular user and enter this command:

  • mkdir /home/bill/external
  • chmod 0770 /home/bill/external

You just created the directory and set it up so that you and root can use it.

There is one file that you need to edit in Terminal with the following command:

  • nano /etc/fstab

This file tells linux where all of your disc drives sit, so be careful and don’t delete anything.  You will be adding a line, as below:

  • /dev/sdb1 /home/bill/external vfat defaults 0 0″

That says – put the external drive’s first partition “in” the /home/bill/external directory.  It also says that it is “vfat” format so change that if it is an ntfs-3g format.  The defaults are lengthy and you can go into them in great detail on the Wikipedia Article.

If you wanted to go further and add multiple partitions for other people, you could do it in /etc/fstab by adding multiple entries.

Once you restart the computer, you should be able to find the drive on Windows, and you are on your way.  Just find the drive in Windows File Manager, enter in your login from Linux, and you’re good to go.

One final wrinkle

What this does is to “bind” the external hard drive or memory stick to the server.  It is now set to automatically mount and share the drive whenever the power comes back on.  If you do not have a drive plugged in, Linux will boot, but put you into a terminal session as root into what is called “Single User Mode”.  You can do the following edit at that point with the commands below.

To remove the hard drive so that the server is no longer looking for the drive at boot, in terminal as root:

  • nano /etc/fstab
  • find the line with the external drive and enter a # as the first character in the line
  • save the file and restart the computer

This now turns your server into a machine that only serves the local hard drive.

Firefox Security Hole Is Why You Need An Adblocker And An Update

Windows:

  • When I clicked “Help” then “About Firefox” it immediately downloaded the patch.  
  • Click on the “Restart Firefox To Update Button”

Linux (Debian)

Assuming you have “real” Firefox installed and the sources in place.

  • Open Terminal as Root.
  • Smile because you have Root.
  • apt-get update
  • apt-get upgrade
  • Restart Firefox when you click on the button that appears.

Other Linux Distros will vary, of course.

Mac apparently does not have the problem.

What happened?  Hackers.  Simply put, a Hacker exploited a hole in Firefox so that advertisements could push some code onto your machine to take it over.

Now, this business about ad blockers.

I run one and I use it very aggressively. It is for this reason.  It is also that I truly hate being pandered to and watched.

The latest trend is to watch what you are doing via “tags”.  A 1 pixel “dot” of a picture will be pushed to your browser as an anchor for them to watch what you are doing.

The best thing for you to do is to run an ad blocker.  You tell it what to block, and yes, it gets very technical because you have to take responsibility to block these things.  For the most part, an ad blocker with (free) subscriptions will block most, but never all, of these nasties.

When you run an ad blocker you will also notice that your browser runs much faster since it isn’t trying to paint all those ads for all those products that you will never use.

Lets be honest, have you ever actually clicked on an ad intentionally?

Me neither.

Heck, I don’t even see youtube commercials because I run an ad blocker.

The easier one to use is Ad Block Plus.  It is controversial because they allow certain advertisers to pay *them* to be allowed past the blocker.  I would recommend this for basic users because unless you want to learn how to use it, it’s pretty simple.

The one I am using is called uBlock.  I’m still learning how to use it.  It removes the ads, but I haven’t figured out how to make it remove the blank space the ad created.

It’s up to you.  Ads and Hackers, or a better browsing experience.  I know what I chose.

Now, if you will excuse me, I have a browser to restart.

Firefox Now Blocks Flash As Default Until Next Version Of Flash

If you are using Firefox, I have a question:  Is your browser acting up on you?

What happened is that Mozilla pushed through a well intentioned update.  It now blocks Flash as a default, and while you can turn it on if you like through the settings, I’m thinking I got into a chain of weirdness here that ended up with my having to do some tweaks.

Flash is that piece of software who has its origins back before the dawn of time, or rather 1999 or so that serves up videos, games, and the worst of all features of the modern web, advertisements.

You’ve got it on your computer unless you took steps to avoid having it.  I’d be willing to bet on it.  If I lost that particular bet go outside and enjoy the great outdoors since you Win One Internetz you 733t D00D!

For the rest of us, Flash is a bit of an annoyance.  Use is something you may not have thought about, an it’s starting to fade away.  Personally, I won’t miss it but I do keep it up to date and protect myself by only allowing it to run when I tell it to.

Back to that Flash thing.  I am now getting a black stripe at the top of my browser when Flash wants to be activated on any specific website.  In my case, that is exactly how I want it to act.  I want it to nag me when I hit a webpage that wants to use Flash so I know if I’m about to get a virus.

The reality is that when Facebook’s head of security, that time sink of a website that mines what you are doing to serve it back to the advertisers that are paying for the site, says that it is Time For Flash To Die, you are witnessing the beginning of the end of an era.

In my own specific case, it locked my Firefox into “Safe Mode” and refused to let me out.  I had to “Refresh” the browser which meant I lost all my configurations and settings.  It took me the better part of an hour to get them back.  I also lost “Adblock Edge” and am having to retrain myself on something called uBlock Origin which is nowhere near as user friendly as the one I was using.

In order to re-enable Flash, and I do not recommend you turn it on for everyone but leave it nag you when it wants to be on:

Go to your Plug In Check Page
Click the scary “Update Now” button

The midsized scary red button will open a webpage for you to download the latest version of Flash, Manually.  Make certain that you clear the check box for their latest crapware download of McAfee Security software.

In my own opinion, there really isn’t any reason to download anything from McAfee but that’s my opinion.

Once you have done the install, it will force you to restart your browser.

Bad form, Adobe, Bad form.  Then again, it’s always been this bad form so we are used to it by now.

So after you restart the browser, Windows Update had a fix for Flash as well.  After applying that update, and a final reboot, the resulting “about:addons” page that allows you to activate or disable your addons was no longer scary red.

The Plugin Status page still had the scary red big button, but the update now button was green and happy.

Lather, Rinse, and Repeat as necessary for all your computers.  Every IT person will be going through this sort of thought process for a bit, or have someone do it for them.

Another Day, Another Adobe Flash Exploit

Flash used to be what I would call “Update of the Day Club”.  Start your computer and get into doing what you need, and surprise of surprises, there would be an update window popping up for Flash.

We seem to be back to that.

It’s a nuisance because with at least Firefox, it forces you to close your browser and go through the nonsense necessary to restart it.  Since Firefox isn’t exactly 100% accurate in reopening pages and tabs, I hold my breath each time.

In this case, there’s no reason to trash Firefox.  There was an exploit found with “Shockwave Flash” as it shows up in the addons page and it tells you it wants to be updated.

Except.

There is no update as of this writing.

So? What do you do?  Tread lightly, my friend.  What you need to do is put yourself through a bit of annoyance or uninstall the blighted software completely.

Since the annoyance is less of a problem than uninstalling Flash at this time, I’ll show you how to do that.

What I am doing is to tell the browser to ask me to run it.  I was going to uninstall it completely.  Youtube does not use Flash as a default to play videos any longer, favoring the newer HTML5.  Facebook does use Flash and at this point it does not apparently use HTML5.

Here is how to go in and tell Flash to run when you want it.  It will leave an ugly placeholder in Facebook with the a grey Lego brick or the international symbol for no, and some warning messages, but you can always turn it back on to watch that particular video of a dog doing something cute if you really want to.

In Firefox:

In the address bar enter:   about:addons and hit enter to load the page.

On your Addons page:

  • Find Shockwave Flash
  • Click the button that most likely says “Always Activate” and select “Ask to Activate
  • click the link to “Check to see if your plugins are up to date” to open another tab.

On your “Check Your Plugins” Page

  • Click the big red button that says “Update Now” under “Potentially Vulnerable Plugins” and follow the prompts to update your Flash.
  • This space intentionally left blank.
  • Flash will update through multiple steps that are documented on Flash’s site.  
  • They include downloading a program.  
  • Make certain that you clear the box that asks if you want to download any “Optional Offer” like McAfee or any other “helpful” programs since they are not helpful and will simply clutter up your computer or it could even lock it up.
  • Flash’s install will require you to close your Firefox, so save your work.
  • Note:  As Of This Writing, there is no update to Flash that will fix this problem.  That is why I told you to set Flash to “Ask To Activate”.
  • Flash will not be updated on Android, Apple’s IOS, or Linux.
  • Flash will eventually be updated on Windows 7 or newer, or Mac OSX… just not as of this writing.

New Firefox and Other Browser Update Weirdness

I’m settling in to get some things done and notice a blurb.

There’s going to be a rollout of the next Firefox over the next few weeks.  I pay close attention to that because I use Firefox extensively.  I’d be lost without it. 

I’m so tightly trained to use Firefox that I have to step back and actually “think” how to use any other browser.  Since I use Windows 8.1, Windows 7, Mac OSX Mavericks, and Debian Linux on a daily basis as well as Android and an occasional toe dipped into Apple’s iOS, I have to remain as flexible as possible and Firefox is on all of those computers. 

Except the iPhone but I hardly ever use them.

I will eventually install Firefox on the Windows machines when it tells me that it is available.  I’m not in a rush.  The last time they changed the way it looks, the User Interface or UI, it borked it for me.  I ended up installing things to make it look the way it did before I updated the browser while growling at Firefox in general.  Keystrokes and mouse clicks and all that moved.  They removed the status bar. The bookmark strip got lost, or rather hid, and that stores some of your bookmarks.  They removed the title bar.

Why?  Never heard a reason, but I installed Classic Theme Restorer and it brought it all back.  Immediately after that I installed Adblock Edge to get rid of the blasted adverts and other nasties that hitch a ride onto your computer as a result.  More Privacy means for a faster experience as well as fewer viruses and spyware pushed onto your local computer.  Nobody actually “Likes” ads anyway, we accept their presence and usually are annoyed or distracted by them, but “Like”?  I doubt it.

Rule Number One of Software User Experience (UX) is if you change the way something looks, you will break the way people work.  I learned that back in the days of the Mainframe and College. 

Rule Number Two of Software User Experience is that if you do change it there will be unintended consequences.

In My Case:

I have a computer that has what they call a “Clickpad“.  It’s also running Debian Linux.  I know Linux in general fairly well, but Debian Linux doesn’t manage Clickpads well.  Clickpads are those weird trackpads that are flush with the case.  You click on the pad instead of having normal buttons like every other Synaptic trackpad. 

I do know that is fixed in the next version of Debian, and I do know how to fix it now, but it is an annoyance that I have to deal with.  It basically forgets that it has a physical button in Debian Stable/Wheezy, and you’re stuck with whatever you touch on the trackpad.  I only get a Right Click when I tap.  I have since configured a two fingered tap to be a Left Click.

What that all did change did is to break the way Firefox works.  You see, on that particular computer, I can’t Right Click.  I can’t get the pop up context menu.  They changed the UI right away from it. 

Since that machine is Debian Linux, I have to wait for the next version anyway.  It isn’t even using Firefox, but something rebranded as “IceWeasel“.  To put it short, and sarcastic, Debian had a spat with Firefox over the branding.  Since Firefox/Mozilla doesn’t want anything proprietary at all on their default install, someone in the Debian Project grabbed the source code, recompiled it, created the graphics, and renamed everything to IceWeasel.  It works like Firefox but is Older.  About a version back. 

If you’re running Stable, or Wheezy, you could be quite a few versions back.  Jessie has a more current Firefox, but it also has a lot more annoying bugs in it because it is “Testing”.

But Windows?  Yeah, you’ll get it soon.  Just remember Classic Theme Restorer and Adblock Edge, and you’ll be fine.

As for the Mac?  When it is available, you’ll get a blip on the bottom of the screen telling you you’re ready for an upgrade.  You can also go back to the old theme if you want, but I do recommend Adblock Edge as well.

Why the harping on the ads?  It’s a much faster browsing experience when you surf a page without the ads.  No blinky pictures, crawling things, or text ads.  If you don’t download them, you use less data.  Things pop faster.

Trust me on that one.  You can always turn it off later.

Outlook.com – How To Block Messenger

Microsoft, please don’t annoy me before 6AM.

I had gotten in after the dog walk, settled in for some iced tea, and wanted to check my email once the computer got started.

Using www.outlook.com has never been a pleasure for me.  I want an email service that stays out of my way with extra “features” that I don’t want.   Having a chat service tied into an email program that is a bloated mess was not my choice.  Even Hotmail.com was better than the steaming pile of garbage that Outlook.com has been bloated into.

At the lower left of the browser screen was a helpful “Messaging” area with little icons of people who I have written in the past.  I found myself immediately looking for a way to turn it off.  After wasting a half hour in the “Byzantine” settings menu in Outlook, I went to do a search for how to do it.  I found this page suggesting that I add an entry into a low level file and restart my computer.   The low level file is a text file called “Hosts” that your computer reads in when it starts.  What Hosts does is to override networking.  

In Windows it is at C:\Windows\System32\drivers\etc and Linux keeps it at /etc/hosts which would be where I would expect to find it on Mac OSX.

Some very basic and oversimplified networking concepts.

If you type in http://www.ramblingmoose.com your computer doesn’t know what that does. It consults your network stack, finds the gateway, and then talks to your internet service provider.  In this case it looks at a giant phone book called your DNS and gets the IP Address of the site.  Since my blog points to a blogger site, that number changes, and it’s hosted by Google anyway. 

But I can change that.

If I bring up Hosts in notepad or any other TEXT editor, I can add in a line saying that a specific IP address is to be used when you go to a specific web address or URL.

For example, if I want to block Google, I add a line to the file:

127.0.0.1  http://www.google.com

Save the file and restart the computer.

This works for some sites that are advertising providers and other nuisance sites.  My own Hosts file is pretty large having gotten one that has most of those malware and advertising sites that were known at the time.

But all this is annoying to maintain.  Fortunately, there is an easier way to do it.

Adblock Edge or Adblock Plus in Firefox and whichever other browsers it supports.  Adblock Edge is always the first thing I add when I install Firefox.  It allows me to block ads, hide pictures, and even block whole websites (domains) if I choose to from a semi-friendly interface.

Simply add a custom “rule” to adblock to block the following URL:

geo.gateway.messenger.live.com

It would be a whole lot simpler if Microsoft had decided that it would give you a way to block that Messaging app within Outlook.com settings, but they chose not to.  Luckily I can turn it off and get some things done.

How to add a custom rule:

  • Ctrl+Shift+F will open a window called “Adblock Edge Filter Preferences”.
  • Click on the “Add Filter” button in the upper right of the window.
  • In the blue box, enter geo.gateway.messenger.live.com and Enter.
  • Close the window by clicking the Close Box.
  • When you refresh Outlook.com in your browser, it will be blocked in that browser only.

Annoyed With The New Firefox Look And Feel? Here Is How To Fix It.

Ok, this isn’t a Hey You Kids Get Off My Lawn thing.

Change is sometimes good.  When someone looks long at how something works, makes a tweak, you will know if it is right.

If it isn’t right for you, then sometimes there is a way to fix it.

When I was presented with the opportunity to give my computer a wholesale upgrade, I thought long and hard about going to Windows 8.1.  I don’t like it, many of us don’t.  So why bother?  I installed Classic Shell, and now my Windows 8.1 looks like Windows 7. 

I did it because the new full-screen Modern or Metro apps are useless to me, the live tiles are worthless to someone who lives on the Desktop, and they are a vector for advertising that I have not found a way to block.  I completely uninstalled most of them and since I work very heavily on the desktop, I feel no loss.

Windows 8.1 is faster, slightly, than Windows 7, so I’m enjoying the minor slight speed bump.  I’m still not liking it any time I have to jump into the ugly block land of the Metro apps, but it is only when I have to fiddle with the system that I have to go there.

Why the Windows nonsense on a Firefox post?  There’s a reason.

Firefox changed the way everything looks on the newest update called “Australis” on Windows 8.1.  The old “shine” is gone.  Everything is flat and mostly “Primary colors”. 

I describe it as simply ugly.  The old shine had a great effect, you could find things at a glance on a very busy screen easier.  Granted, you were trained to recognize that the individual elements were separated by color and separators were very visible as a dark line, the most current tab of a tabbed interface was lighter, the other tabs were darker, but did not blend into the background which was a third color.

There is a good reason for this.  Humans are good at pattern recognition.  This is why the “Big Dipper” is a constellation resembling a dipper.  It LOOKS like SOMETHING.  It isn’t a random pattern, although in actuality it really is since some of the stars in the Big Dipper are much closer than others.

So when Firefox upgraded, they went with a new look and feel.   It looks very Windows 8.1 Metro Modern.  Which is to say “Flat and Blocky”.

I don’t like Flat and Blocky.  I have open dozens of tabs at any given moment, sometimes more than one hundred.  It slows me down.

If you want to fix that and find it ugly and want to go back to the old school way of doing things, thankfully Firefox recognizes that you still can.  It is even in their official documentation how to do so.  This update is all about giving you the power to customize the browser. 

Unfortunately they removed the add on bar at the bottom of the browser completely and that broke my weather app that I depended on heavily for current conditions.  I’ll have to go out and write a webpage to monitor the weather itself.  While I could use the practice in HTML 5, I’d prefer it not to have been forced upon me.

You can follow their instructions here.

Simply put you will be adding an “Add On” to Firefox.  It will change it back to the way it looked “yesterday” before you did the upgrade by default.  Install it and you are done.  Add Ons typically work on all versions of the browser, although I haven’t tried it out on my Mac or my Linux machines, I expect this will not be a problem.

All I wanted was my old square edged tabs back in grey with the current tab bright silver, and it gave me that back.

The steps are simple:

Don’t worry, if you want to turn off Classic Theme Restorer, you can within its own preferences found in the Firefox Tools Menu.

It will install the theme restorer.  With that you can change a lot more of the way Firefox looks.  If you really do like the curvy tabs, you can put them back by selecting the proper theme elements.  My biggest problem is that the visual clues are not at all obvious with this new “Australis” theme.  The break between the inactive tabs is much less obvious and the result is that it slows me down.

With Classic Theme Restorer, I can put that back.  There is a Curved Alternative Theme that looks almost exactly like Google’s Chrome tabs so if you like that, feel free.  I just tweaked it to look that way now, and my browser looks like a file drawer full of old grey Manila folders inside Pendaflex holders.

Skeuomorphism to the rescue!

After all, if customization was the goal, I took advantage of it.  I bent the browser to my will and customized it – back to the way it was. 

Useable.