Archive

Archive for the ‘technology’ Category

LinuxMint: Automount Server Share

October 16th, 2011 No comments
Number of Views: 31

While I’m still not 100% sure how I got my file server to share all the files across the network (whatever I did, it worked; when the server dies, I’ll figure it out and post it here).  Regardless, I recently reformatted my desktop and had to set up the file server share to automount on my desktop for easy access to the files (I store all my music, videos, and lots of other files on the file server).  Here are the steps I took to set up my automounting file share on my LinuxMint desktop (courtesy of the ubuntu wiki).

1) First you need to install two packages (not sure which actually does the mounting, so I just installed them both: cifs-utils and smbfs. You can install these from the terminal or using synaptic.  Here’s how you would do it from the terminal:

sudo apt-get install cifs-utils smbfs

2) Once those are installed, you need to create a mount point for your share.  The easiest way to do this is from the terminal as it requires root privileges.  The share, which, in my case, is called “fileshare” is mounted in the “media” directory, so you use the following:

sudo mkdir /media/fileserver

3) Next you need to edit the fstab file.  This is a file that tells the operating system which drives should be mounted on startup.  To edit it, enter the following at the terminal:

sudo gedit /etc/fstab

4) The text editor will pop up with your fstab file open for editing.  You need to add a line to the fstab file that tells the operating system what to mount on startup, where to mount it, and what permissions to use.  Here is the line I used

//fileserver/server-share  /media/fileserver  cifs  guest,uid=1000,iocharset=utf8,codepage=unicode,unicode  0  0

What this tells the operating system is that I want to mount a network share “//fileserver/server-share/” into the folder “/media/fileserver”.  I do this with the software package “cifs.”  Since I set up my fileserver to not require permissions to access the files, I am accessing the fileserver as “guest.”  The “uid” is my user id.  The remaining information indicates what follows I can read and write across the network share.  Save the fstab file and close it.

5) The last step is to go ahead and mount the share.  This is also done from the terminal using the following command:

sudo mount -a

This tells the operating system to remount everything in your fstab file.  Your file share should now show up as a drive on your desktop and you should be able to read and write to it directly as if it were a drive on your computer.

Categories: technology Tags: , , ,

LinuxMint: Keyboard Shortcuts to Move Windows Between Monitors

October 16th, 2011 No comments
Number of Views: 21

If you don’t have multiple monitors hooked up to your desktop computer, you’re really missing out.  Having dual monitors is a delight when it comes to being able to see more than one window and work even faster.  And to make the experience even more enjoyable, Ubuntu variants of Linux, including LinuxMint, my new Linux distribution of choice, come pre-installed with CompizConfig Settings Manager, which has a nice windows management utility built in that allows you to use keyboard shortcuts to move windows between monitors.  So, for instance, let’s say you’ve got your browser up on the left monitor, but you want to move it to the right monitor so you can have it open at the same time as you work on a spreadsheet.  You could shrink the browser window then drag it to the other monitor.  But that would require several several clicks and dragging your mouse.  Wouldn’t it be nice if you could simply hit a keyboard combination that moved your entire window from one monitor to the other, while still maximized?  The “Put” utility in CompizConfig allows you to do this.  Here’s how:

1) Open CompizConfig Settings Manager (it’s pre-installed in LinuxMint).  If you’re running Ubuntu, you may have to install it using the software center or synaptic:

opening CompizConfig Settings Manager in LinuxMint (click to enlarge)

2) With the settings manager open, scroll down to the section labeled “Window Management.”  You should see “Put” as an option.  Select the box next to it, then click on “Put” to enter the settings:

find "Put" in the CompizConfig Settings Manager window (click to enlarge)

3) Inside the “Put” submenu you’ll see several options.  The one you want to move windows between monitors is “Put within viewport,” which is the fourth from the top.  Select the + sign next to it to see the options.  While you can “Put” your windows in lots of locations, I primarily just use two: “Put Left” and “Put Right”.

the "Put" settings submenu (click to enlarge)

(In the above image I had already set up my key combinations.)

4) To set up a key combination to use the “Put” utility, simply click on the button labeled “Disabled” across from the relevant command that shows a small keyboard (you can create key combinations using mice as well, which are just below the keyboards).  That brings up this option:

click "enabled" to tell CompizConfig to use the keyboard combinations

5) Select “enabled” and you’ll see this:

set your keyboard combination here

6) Click on “Grab key combination” and another window will pop up that will detect the keyboard combination shortcut you want to use to put your windows across monitors.  I use “Alt+Super+left” for moving windows to my left monitor and “Alt+Super+right” to move windows to my right monitor (as shown in the image above).  Once you enter your keyboard combination, hit “OK” in the prompt, set up any others you want to use, and then click on “Back”.  Make sure you’ve selected the checkbox next to “Put” then close CompizConfig Settings Manager.

7) You can now try out your keyboard combination by selecting a window and using your combination to move it across monitors.  FYI, if your window is maximized, you’ll have to hit the combination twice.  When you hit it the first time, the window will move just a little bit to indicate to you that the software knows you’re trying to move the window but that the window is maximized.  Hit it again quickly and the window will jump to your other monitor and maximize itself on that monitor as well, beautifully taking into account panels and monitor size.  I show the actions in the video below:

Note: Another very useful keyboard combination utility that comes built in with CompizConfig Settings Manager is the “Grid” utility which allows you to move a window to different areas of your monitors as well.  This utility is located in the same area as the “Put” utility.  It is activated by default.  The keyboard combinations are “Ctrl+Alt+keypad numbers”.  So, for instance, to move a window to the center of a monitor, hit “Ctrl+Alt+KP5,” which is the center key in your keypad.  To move it to the right, use KP6, etc.  Grid has several levels of alignment built in, which you can see by hitting the combination repeatedly until you get the window to the size you want, as shown in the video below.

Categories: technology Tags: , , ,

Ubuntu: two versions of Firefox at once

November 13th, 2010 No comments
Number of Views: 14

Ever since I switched to Linux I’ve been toying with running two versions of Firefox simultaneously, even though I now use Google Chrome as my primary browser.  Why two versions of Firefox, you ask?  It’s kind of complicated, but it boils down to: I use Zotero for my bibliographic management software but I have too many references to put them all in one database.  I have about 10 Zotero databases, and I periodically need to move references from one database to another.  With only one copy of Firefox on my computer, I can only open one copy of Zotero at a time.  And given how you switch between Zotero databases (restarting Firefox), it can be quite cumbersome to move references between databases.  The solution: Two (or more) versions of Firefox, each of which can be opened independently and is compatible with Zotero.

I was getting ready to move some references around today when I thought I’d look into running two versions of Firefox simultaneously just to see what is available.  Turns out, there is a Firefox add-on, specific to Ubuntu, just for this: FoxTester (here’s the extension’s homepage).  Basically how this works is, in the default Firefox install, you install the FoxTester addon.  Then, once you restart, you can right-click in Firefox and you’ll see a context menu:

The top item in the context menu is “Browse FTP Directory.”  This takes you to a repository of Firefox releases, which you can navigate to find the version you want:

Once you find the one you want, click through to the appropriate files for your platform (in my case: 3.6.9/linux-i686/en-US/).  You’re looking for the “tar.bz2″ file, which is basically a zip file:

Right click on the tar.bz2 file, and save it to a specific folder (you will probably need to create a folder where you can keep it around as it needs to be static).  Once you’ve downloaded the file to the right folder, go back to your current install of Firefox, right-click again, and go to the context menu for FoxTester.  Select “Preferences” and you’ll get this window:

Here you simply need to set the “Watched Folder” to the folder where you just saved the tar.bz2 file.  Once you’ve done that, you’re two clicks away from running.  Close the Preferences window and right-click to bring back up the context menu.  Assuming you’ve done everything correctly, you should now be able to choose “Install” and select the tar.bz2 file you downloaded.  It will take a minute or two, then you’ll get a note saying that your version of Firefox installed.  You can then go back to the context menu and select “Launch” and choose the version you just installed.  It should start right up:

If you’re doing what I am, which is running two instances of Zotero, you’ll need to download the Zotero extension in the new version, but then you should be good to go.

(Note: The extension’s website has a video tutorial showing this and more.)

Categories: technology Tags: ,

Ubuntu: keyboard shortcut to switch mouse orientation

October 3rd, 2010 No comments
Number of Views: 9

In order to minimize the risk of repetitive stress injuries, I have learned to use computer mice ambidextrously – I can do it either right or left-handed without any problems.  However, it’s a little more difficult to do it left-handed on my laptop.  And since I dock my laptop in my office to use an external keyboard and left-handed mouse but undock it to teach my classes and use the touchpad right-handed, I find I’m constantly changing the orientation of the mouse, from right-handed to left-handed and back again.  I figured there had to be a way to make this easier, so I asked on the Ubuntu forums and here’s the answer I received that works.

First, open a terminal and type:

sudo gedit /usr/bin/mouse_switch

When the text file opens, add the following to the file then save it:

current_setting=$(gconftool -g /desktop/gnome/peripherals/mouse/left_handed)
$current_setting && new_setting=false || new_setting=true
gconftool -s /desktop/gnome/peripherals/mouse/left_handed -t bool $new_setting

Close the file. Then in the terminal type:

cd /usr/bin

Then type:

sudo chown “user” mouse_switch

(Of course, you need to replace “user” with your username in Ubuntu.)

You may also have to change the properties on the file (mouse_switch in /usr/bin) by right-clicking it, selecting the permissions tab, and selecting the option that it can be executed.

Then, using the menus at the top of the screen, go to System->Preferences->Keyboard Shortcuts.  In the window that comes up, select ”Add”.  Then fill out the new window with the following:

Name: mouse_switch
Command: /usr/bin/mouse_switch

Finally, select the keyboard combination you want (CTRL+SHIFT+M is what I use).  Voila, you should now have a keyboard combination that will switch between left-handed and right-handed mouse orientations.

Categories: technology Tags: ,

Ubuntu: Adequate OCR for free on Linux

July 18th, 2010 No comments
Number of Views: 9

Even though I have mostly switched from Windows to Linux, I do have to emulate Windows for a few things just because the software for Linux either isn’t very good, doesn’t work, or in one case I haven’t learned it (R rather than SPSS).  One of the reasons I would run Windows over Linux was for “optical character recognition” or OCR.  This is what the process is called for converting scanned text into actual text.  On Windows there are a number of good, relatively cheap software packages that do this.  The one I regularly used was Omnipage, which is really good.  I’ve looked for open source Linux alternatives and would even be willing to pay for one that wasn’t too expensive (i.e., less than $100), but have had no luck with finding something in my price range that works.  However, with a recent development in Google Documents, it’s possible to bypass standalone OCR software completely and simply allow Google to convert your scanned documents into text for you.

As of June 21st, you can upload scanned files (e.g., jpg, pdf) to Google Docs and it will run it through OCR (directions here).  The character recognition is mediocre compared to Omnipage, but it works fairly well for simple text.  It doesn’t deskew text before converting it, so if your scanned text is skewed at all, it will have a hard time converting it.  Also, the Google Docs OCR software doesn’t retain formatting at all.  But it works.  And it’s adequate for what I do (mostly scanning paragraphs from books to help with my book reviews).  However, one thing that is not mentioned with this free service is that it is limited to scans that are 10 pages in length or shorter.  I found this out the hard way by uploading a scan that was about 30 pages and realizing it wasn’t recognizing 20 pages of the document.  So, if you need lots of long documents converted, you’re probably still better off using some other software.  But if you just need a few pages of text converted, Google Docs will do it for you and do it fairly well.

So, how do you get all of this to work on Linux?  Assuming you already have a scanner (that would be the only cost, aside from your computer, of course), you can use the built in scanning software “Simple Scan” (as of 10.04) to scan your document.  Select “text” scan as you don’t need color.  Simple Scan is quite easy to use and allows for quick and easy cropping, which I would recommend (you have to do this in Omnipage as well, so it’s not any more time consuming).  Once you’ve scanned and cropped your text selection, save it as a PDF.  Then follow the directions here on how to upload it to Google Docs and tell Google Docs to convert it to OCR.  Et voila, you have OCR on Linux.

If you do happen to have a longer document you need converted, you can easily break it into 10 page chunks using another piece of free software, pdfSam, which automates breaking the PDF into 10 page chunks.  You can then upload all the pieces of the document to Google Docs simultaneously.  So long as they are less than 10 pages long, each will be converted in turn.

Categories: technology Tags: , , ,