Command Line Copy

EPicture of Linux Terminal Window with Codevery year we digitize The Wilmington Town Crier papers. We send ’em off and get pdfs
on a USB drive (as well as the originals) returned. From there I load them into a Drupal website using Solr and Tika for indexing (a setup I don’t recommend). But in order to do so, the pdfs must all be in the same directory.

Well, it turned out that the 2016 batch of papers put each issue in its own folder. Since I didn’t want to have to manually move all the files, I searched for a way to do it all at once. And I found it.

1.) Open a command prompt (start > run > cmd)

2.) Change directories to the USB drive

3.) Type the following code, replacing “target” with the folder you wish to drop all the files into.

for /r %f in (*) do @copy "%f" target

For example, here was my code:

G:\2016>for /r %f in (*.pdf) do @copy “%f” G:\2016

You’ll notice I only wanted to move the pdfs. That’s because there were other files (.jp2, txt, tif) in those folders and I didn’t care about them. If you want to move everything just leave it as (*).

And that’s it!

Since I want to give credit where it’s due, here’s where I got the line of code: https://stackoverflow.com/questions/1502170/how-to-copy-files-from-folder-tree-dropping-all-the-folders-with-robocopy

Auto Start FireFox in Ubuntu

Picture of a fox with his tongue stuck on a window

Image Courtesy of  DeviantArt.net

We use old desktops running Ubuntu for catalog stations throughout the library. If the computer is rebooted, since most folks aren’t familiar with the Ubuntu OS, they don’t know how to open the catalog. So I did some research and found a fast and easy way to open FireFox to the catalog at system startup. Here’s how.

  1. Open a Terminal window
  2. Type cd .config/upstart/ and hit enter

Note: If the directory is not found, you’ll need to type ls –a to show the hidden files first.

Terminal Window Showing CD to the .config/upstart command

  1. Type nano firefox-with-url.conf and hit enter

Note: if you get a permission denied, try typing sudo before nano. Of course you need to have sudo permission to issue that command, so you may need to resolve that before continuing.

Terminal Windows showing how to create a .conf file

  1. Type the following

start on desktop-start

stop on desktop-end

 exec firefox http://wilmington.mvlc.org*

*Put the page you want FireFox to load here instead of this

  1. Hit ctrl+X to exit
  2. Hit Y to save the changes and hit enter.

The commands to autostart FireFox in a .conf file.

And that’s it!

Robocopy for Backups

Office Space Robocopy Meme

The Problem

The library uses a Synology NAS device for staff documents. The original hardware came with the Data Replicator Software that would back up the contents of the NAS to a USB Drive attached to one of my computers. A few months ago said backup started to take upwards of 18 hours. So I went a-googling for answers. Turns out Synology discontinued that app years ago. So I needed to find a replacement.

When I couldn’t find any free software, my mind wandered back to my previous life as an applications analyst. Specifically to Robocopy. Alas! I’m sad to say the “robo” does not stand for “robot” but rather “robust”. Heartbreak aside, it turns out I could easily and, more importantly, quickly create a backup copy of the NAS myself. I simply created a .cmd file to robocopy the NAS to the USB Drive and then created a scheduled task to kick off the file every night. Here’s how you can do it, too.

Creating the .CMD File

Start in c:\Windows\System32\ 

1.) Right-click the any white space

2.) Hover over New

3.) Click Text Document

4.) Type Robocopy Backup.cmd and hit enter

Note: Make sure you change the extension (the part to the right of the .) from txt to cmd.

5.) Click OK to the warning about changing the file type.

6.) Right-click the Robocopy Backup.cmd

7.) Click Edit

Screenshots of how to create a robocopy.cmd file on the desktop

8.) Type Robocopy \\SourceServer\SourceShare\ \\DestinationServer\DestinationShare\ /MIR /R:2 /LOG+:RobocopyBKUP.txt

Note: Make sure the entire command is on one line or else Windows won’t understand.

9.) Hit ctrl+s to save the file.

Robocopy commands with explainations

Task Scheduler to Kick off the .CMD File

10.) Go to Control Panel > Administrative Tools > Task Scheduler

Path to Task Scheduler

11.)  Go to Action > Create Basic Task

12.) Type Robocopy Backup in the Name: field and click Next

13.) Make sure the Daily circle is selected as a Trigger and click Next

14.) Specify a time (you probably want to make sure this is when you’re closed) and click Next

15.) Make sure the Start a program circle is select and click Next

16.) Click Browse

17.) Navigate to the Robocopy Backup.cmd you just created and click Open

18.) Click Next

Basic Task Specifics

19.) Make sure all the settings are correct and click Finish

All Basic Task Settings

You can run it manually to make sure it works by clicking the task to select it and clicking Play on the right

Troubleshooting

Since each computer is slightly different, things may not work exactly like I say.  Click the task to select it and click Properties on the right and then check the following settings:

  • Make sure the Run whether user is logged on or not circle is selected
  • Make sure the Run with highest privileges box  is selected
  • Make sure the ID you’re using has access to both source and destination paths

 

Change user on Basic Task

For a list of robocopy  command, see here: https://ss64.com/nt/robocopy.html

Site Hiding from Google

 

Thank you card with the Alphabet on the cover

This Is the Thanks I Get.

 

Credit where credit is due: I used the article below as a guide to solve this issue:

https://www.seomechanic.com/why-is-my-website-not-showing-in-google-search-results/

The Sitch

I had a patron come to me asking if I knew why their site wasn’t showing up in a Google Search. At first, I thought they were simply using too broad a search phrase. Turns out they were hacked and the hackers messed with some pages and their Robots.txt file. Oh, and did I mention it was a nursery school? Who hacks a nursery school?!

Sorry.

The recovery process is painful and time-consuming. So I wanted to share my experience in hopes I can help another unfortunate soul.

Search with Site URL

Search Engine Optimization (SEO) is the process a web designer undertakes to aid the search engines in finding her site. There are many ways to do this and SEO is something we could spend weeks on. Suffice it to say, the main way a site is found is through keywords. Since SEO is also so competitive, your site might just not rank too high. A surefire way to see if Google sees your site is you go to google.com and search your URL exactly as it appears but put site: before it. For example:

site:bioniclibrarian.wordpress.com

Confirmation of Penalization

If Google sees it, the next thing you should check is if Google has penalized your site by going to https://ismywebsitepenalized.com and putting in your site name.

imwp

If you get an ugly read error like the one above, then you’ve got work to do.

Make Any Edits To Robots.txt

The easiest fix is to make sure the Robots.txt file is allowing all the search engines to index the site. In my poor patron’s case, the hack messed with this and disallowed certain agents. We reset it to the default:

User-agent: *
Disallow:

You can read all about how to use the file here:  http://www.robotstxt.org/robotstxt.html

If you want to see one in action, click here: http://www.robotstxt.org/robots.txt

Make a Sitemap

Sometimes the penalty is because you don’t have a sitemap file. A sitemap is a file (usually xml) that lists each page on your site. If you have a simple page, you can just create it yourself. If you have a site that’s a little more complex or don’t want to create it yourself, visit http://xml-sitemaps.com and you can create on there. Caveat, if your site is over 500 pages, this site won’t be able to help you.

.htaccess File

Once we added the sitemap and uploaded it to the site, Google was saying it STILL couldn’t see the file, even though we were looking right at it. I thought it sounded like a permission issue, but we didn’t have access to change the permissions on the HTML root folder because the login we had dropped us in that folder.  Enter the .htaccess file.

I’ve run across this file on one of the websites I manage. But in those cases, it had to do with permissions. Apparently, it can also be used for redirects, which is where this journey ended up going.

The patron himself ended up finding this issue and ultimately resolving it. I love it when that happens. That means I’ve taught him how to fish…so to speak.

Here’s a resource on the issue: http://www.htaccess-guide.com/redirects/ 

Make a Reconsideration Request

If your site still refused to show up in Google, you can always make a Reconsideration request. The process is essentially this:

  1. Sign into your Search Console account.
  2. Verify all versions of your site to ensure you have complete and accurate data.
  3. Visit the Manual Actions section to see if Google has taken any actions on your site.
  4. Fix issues on your site as described by the manual action.
  5. Review Security Issues in Search Console for other possible issues with your site.
  6. Click on ‘Request a review’ to ask Google to reconsider your site.

I took those steps from here: https://support.google.com/webmasters/answer/35843?hl=en

 

Digital Divide Podcast

Interpretation of the Digital Divide showing a small bag of money on one side of a valley from a big bag of money. Across the valley is a series of papers to act as a bridge

One of the reasons I decided to go into public libraries and not academic libraries upon finishing my Master’s degree was because of the dastardly Digital Divide. For those of you whom may not know what the Digital Divide is, Merriam-Webster defines it as:

the economic, educational, and social inequalities between those who have computers and online access and those who do not

My library takes an active role in building this bridge through such things as my one-on-one tech help sessions. The sky, or should I say cloud (what? I shouldn’t? A-hem. Well OK then.) is the limit. I help patrons with eReaders, email, websites, social media sites, anything they ask. While I don’t claim to have all the answers, I can do some research beforehand to find a particular one. If that doesn’t work, then I can show them how to use Google and our databases hidden behind paywalls to get the answer. They’ve proved muy popular in my time here. I had 160 sessions in 2016 alone. But the thing is, I don’t make house calls. So that means patrons must come to the library for tech help. Until now.

One of those aforementioned sessions was with a lass from WCTV, the Wilmington local access cable channel. We went over some of the basics of computers and she found it so helpful that she thought we ought to do it again. This time in podcast form. So we did. Our first episode of Bridging the Digital Divide can be heard here:

I’m excited about this. Not only is it a fantastic example of how libraries can partner with companies to meet the patrons where they are but it also provides me with a chance to use new (to me) technology. I’ve never been in a recording studio and it was fun to drop some killer beats. Well, maybe not killer beats (I need to stop saying that don’t I?) but a useful recording in the very least.

Stay tuned for more episodes.

Short Computer Buying Guide

Woman Looking a Laptops in StoreThe most common question I get is “what kind of computer should I buy?”

Most of the folk asking this question are not gamers or graphic designers so I tell them there’s no wrong answer. It depends on what you’ll be using it for. But because I don’t like to leave them in the lurch with such an unhelpful non-answer, I give them a breakdown of things to look out for.

Display Size

I tend to steer people towards laptops for the sake of simplicity; they don’t have to buy a monitor which means that’s one less thing that can break. Again, since my audience is not made up of gamers, the lower performance levels between a desktop and a laptop is negligible.

But smaller is always the trend with technology.  This means that the display is smaller too. The cheaper models usually have a smaller screen…but then again so do the more expensive touch-screen models. So I tell people to they probably don’t want a display under 15″. Even if they’re not going to stream videos, websites are so full of ads and sidebars that the content that actually matters gets squished to the middle of the screen. I tell patrons you’ll really notice the missing 2-4″ if they go with a 13″ or 11″ display. 

RAM

This one is becoming a little less of an issue. But since Windows 10 is such a beast of an OS, I tell people to make sure that the laptop has at least 4GB of RAM. For the most part that’s the low end of the offering. I mention this so that should they be comparing two models, they’ll make sure the RAM is one of the specs the use to compare.

CPU

Like RAM, this one I just mention for the sake of comparing two models. I tell them that an Intel is usually a faster option than an AMD. Also, if they both have an Intel, an i7 is newer than an i5. 

Drive

I briefly explain the difference between a Hard Drive and a Solid State Drive (SSD). I then point out that, usually, the SSDs have less space than the traditional hard drive. If they plan to store a mess of pictures, videos, or other large files, then I tell them the hard drive will be better for them. If they’re using it to check Facebook or Email, then they don’t need the common 1 TB hard drive and will be fine with a 256 GB SSD.

Things Not Included

One of the sacrifices made for the sake of smallness is to not include pieces of hardware that you may be used to. The most common are no DVD/CD Drive and no Ethernet port.

If they don’t listen to CDs or watch DVDs on their computer now, they’re not likely to be bothered by not being able to do so on their new laptop. If they do either or both now, then they can always buy an external DVD/CD Drive.

Some folks feel it’s safer and faster to be on the wire versus the wi-fi and they’re not wrong. I do tell them not to let that be a deal breaker, though. They’re usually fairly safe and fast on the wi-fi.

BONUS! Post-Purchase Advice

I always tell people to bring in their new laptop after buying it and I can show them how to get Free Antivirus in the stead of having to pay a yearly fee. Also, since Office isn’t usually included, I tell them I can show them free Office Substitutes. Finally, I advise them to switch from Internet Explorer (they usually keep calling Edge IE because the icon looks so similar) to FireFox in the name of privacy.

And that’s it. I hope it was helpful. If you have any issues with my suggestions, or would like to add something, please let me know!

Remote WOL and Shutdown

I only have a few hours a week to work on the library’s computers when no one is here.Icon for the power button on computers So it’s proven invaluable to be able to schedule updates, both Windows and Anti-Virus, for Sundays (when we’re closed all day). But in order for the update to be received, a computer it has to be turned on. I’ll give you a moment to pick up the pieces because I KNOW I just blew your mind.

Got ’em? Ok. Onward and upward!

Since I’m not here on Sunday, I needed to also schedule the computers to Wake on Lan (or WOL, hence the title of the post). Computers with newer BIOS versions can handle that. But I have quite a few computers that are anything but new. If you’re in the same boat follow these steps.

Download the Utility

1.) Go here https://www.depicus.com/wake-on-lan/wake-on-lan-cmd

2.) Click Download Now

Download Now Button for WOLCMD

(I’m skipping some screenshots to keep this post under control)

3.) Click Save

4.) Go to the file, Right-click, and click Extract All to unzip the file.

Create and Edit the Bat File

5.) Move the cmd file to a folder of your choosing

6.) Right-click the white area in that folder

7.) Select New 

8.) Click Text Document 

Menu to create a new text document in Windows File Explorer

9.) Type wol.bat

10.) Hit Enter

11.) Click Yes

12.) Right-click the wol.bat

13.) Click Edit

Changing a .txt file to a .bat file

14.) Type rem computer name

15.) Hit enter

16.) Type WolCmd mac address ip address subnet mask port

Note: To get a computer’s MAC and IP Addresses, open a cmd prompt and type ipconfig /all

17.) Hit ctlr+s to save the changes.

Breakdown of the WOLCMD bat file contents

18.) Repeat steps 14-17 with any other computers you’d like woken up. Making sure to keep the rem and wolcmd commands on their own lines.

Create the WOL Scheduled Task

19.) Click Start 

20.) Type Task Scheduler in the search box

21.) Click Task Scheduler at the top

Searching for the Task Scheduler's App in the Start Menu

22.) Click Create Basic Task…

23.) Type a name for the task 

24.) Click Next

Creating a Basic Task in Task Scheduler

25.) Click the circle next to Daily

26.) Click Next

27.) Specify a time

28.) Click Next

29.) Click the circle next to Start a program

30.) Click NextSpecifics of a Basic Task

31.) Click Browse

32.) Navigate to the bat file you just created

33.) Click Open

Point the task to the bat file

34.) Click Next

35.) Click Finish

Final Two Screens of the Task

And now all the computers specified in the bat file will be WOL’d every morning.

Task Scheduler with new bat file listed

Create the Shutdown Task

36.) Repeat steps 9-13, this time naming the file Nightly Shutdown.bat

37.) Type shutdown /m \\computername /s

38.) Hit ctrl+s to save the changes to the bat file

Shutdown Bat File Contents

39.) Repeat with as many computers as you need to shut down

40.) Repeat steps 22-35, this time pointing to the Nightly Shutdown.bat

That’s all folks! If you try it and it doesn’t work, please let me know. If you know of a better way to do this deed, please let me know that as well!

 

 

 

Resetting a Hotspot

The library has four T-Mobile Hotspots. They’re big hits because hotel internet access is outrageously pricey. Recently a patron came back from Mexico and said she couldn’t get it to work. Since it’s as simple as turning the damned thing on, connecting to the newly discovered SSID on your phone, and typing in the password taped to the hotspot, there’s not a lot of troubleshooting to do.

I tried to connect an iPad to it but it kept asking me for the password over and over (and over) without connecting. Then I tried my phone and it didn’t ask me for the password repetitively but it didn’t connect, either. Luckily, we kept the default SSID and password, so resetting it wouldn’t wipe out anything. So that’s what I did.

In case you want to do it, here are the steps. Note: this was done with the T-Mobile ZTE Falcon, screens may differ if you’re using a different model.

1.) Plug the hotspot into a computer via the USB cord.

2.) Turn on the hotspot

3.) If it doesn’t automatically prompt you to run the install, go to My Computer (or This PC if you’re using Windows 10) and double-click CD Drive: Mobile Hotspot

This PC Screen showing the TMobile Hotspot installer

4.) Double-click the newly minted Mobile Hotspot Admin icon on the desktop

5.) Log in with the password found above the battery on the hotspot

6.) Click Login

T-Mobile Admin Icon and login screen

7.) Click Settings at the top right

8.) Click Device Settings on the left

9.) Click Reset under the Reset Factory Settings section

T-Mobile Reset Menu

10.) Click Yes to confirm the reset

T-Mobile Hotspot Reset Confirmation

And that’s it! You’ll be logged off of the admin page as it resets. But once it comes back up, see if the SSID is visible and connectable. If is, you’re all set. If not, you’ll want to get in touch with support. If it didn’t work because you were using a different model, please let me know what model you had and how you resolved the issue.