↓
 

A Pipe and a Keyboard

A sort of Linux scrapbook

A Pipe and a Keyboard
  • Home
  • About
  • Software
  • List of posts

Category Archives: Tech stuff

Post navigation

<<123456…2627>>

Bad interpreter error

A Pipe and a KeyboardPosted on October 28, 2016 by RichardNovember 26, 2016

I use shell scripts for a few jobs.

Recently I rebuilt a laptop and installed a few scripts from a working machine.  The other day I went to run one of the scripts from a command line and got the following:

/bin/bash^M: bad interpreter: No such file or directory

Now the new machine had an identical setup to the old and the script I was trying to run had the right permissions(and of course ran perfectly on the old machine), so the problem had to lie with the formatting of the script file ( and the ^M was a bit of a hint too?).  Somehow the file transfer had corrupted the script file and trying to edit it didn't fix it.

A simple fix. 

I used the following:

sed -i -e 's/\r$//' myfile.sh

The file then ran perfectly.

 

Posted inLinux, Tech stuff | 1 Reply

Install Google Earth with photos on Linux Mint 18 (64bit)

A Pipe and a KeyboardPosted on July 3, 2016 by RichardDecember 6, 2017

Latest: Mint 18.3/Google appears to have sorted the problems.
However there is still an issue with some video drivers.
————————-

Now that Mint 18 has been released, the first thing I noticed was that Google Earth is not available in the repositories and requires a manual download and install.

Before doing that, make sure Mint updates have been applied as the LSB libraries are missing from the installation disk, but are now available as an update.

First open a terminal and enter the following –

sudo apt-get install lsb-core -y -f

Then download Google Earth.

Finally, in Terminal, run –

sudo dpkg -i google-earth-stable_current_amd64.deb

The problem with the photographs not displaying still exists, so I have created a small script.

Please note – run the script at your own risk. It does however run perfectly on my setup.

Download it here.

Open a terminal in the folder where you have saved the download –

chmod +x GEImages.sh

sudo ./GEImages.sh

Once it has finished, run Google Earth and enjoy!

Posted inLinux, Tech stuff | TaggedLinux | 52 Replies

Running a live image on the desktop

A Pipe and a KeyboardPosted on April 28, 2016 by RichardApril 28, 2016

Things have been somewhat quite here of late?

Occasionally I like to set myself little mental exercises to keep the brain ticking over.  My latest bright idea was to replace my desktop background wallpaper with a live [or nearly live] image from the Internet.

There is a site with a live webcam pointing to a view that I love.  The webcam updates roughly once a minute producing a JPG image.  My task was to use that image as a desktop background.

For the purposes of illustration, I have used imaginary URLs but you can take it from me that it works.

The first part was to write a shell script to retrieve the file from the website.  This was short and simple –

#!/bin/bash
# retrieves newest image from web camera
# and sets this as desktop background in cinnamon 

wget "http://webcamerasite.com/webcams/cameraoutput.jpg" -O /home/username/Images/camera.jpg

gsettings set org.cinnamon.desktop.background picture-uri "file:///home/username/Images/camera.jpg"

Note that the final line is for Linux Mint Cinnamon edition. Modify it for other versions.

Save the script and make it executable.  Running the script will replace the background image with the latest from the website.

The next task is to set up a Cron job to run the script.

In Terminal, type crontab -e

Select the editor (I chose 2 – Nano).

Add the following line at the bottom –

* * * * /home/username/location of shell script

This will run the script once a minute.

Press Ctrl-o to save the file, press Enter to confirm the file name and Ctrl-w to exit.

Your desktop will now refresh every minute with the latest view.

Desktop image

The latest image on my desktop

 

 

Posted inLinux, Tech stuff | TaggedLinux | Leave a reply

Auto mounting an NTFS partition in Linux

A Pipe and a KeyboardPosted on December 3, 2015 by RichardDecember 3, 2015

I have a simple setup on this machine.

It has a 1Tb hard disk so I allocated 500Gb for Windows and 500Gb for Linux [Mint 17.3 Cinnamon].

My problem was that I wanted to be able to permanently access the Windows NTFS partition from Linux as there were some files that I wanted to be able to edit from either OS, and it made sense to retain those files on NTFS where they can be accessed seamlessly from either OS.

So how do I get Linux to automatically mount the NTFS partition on boot?

Simple.

In Linux, select Menu -> Preferences -> Disks.

Disk management

[Click to enlarge]

Select the NTFS partition and then click on the cog icon below the selection (not the one at the top right corner) as shown above.

Select "Edit Mount Options…"

Mount options

[Click to enlarge]

Simple set the Automatic Mount Options to "OFF", and make sure Mount at startup is selected, as above.

Reboot and the partition is mounted.

 

Posted inLinux, Tech stuff | TaggedLinux | 1 Reply

Download failed. error:0D0890A1:asn1

A Pipe and a KeyboardPosted on September 16, 2015 by RichardSeptember 16, 2015

I maintain a series of WordPress sites.

One of them recently started throwing up an error whenever I tried to update the core or a plugin.  All I got was the not very helpful message:

Download failed. error:0D0890A1:asn1 encoding routines:func(137):reason(161)

As this meant that every update had to be downloaded locally and then FTP'd up to the site I was anxious to find a fix.

I found this simple piece of code (courtesy of Damien Carbery over at the WordPress Forums)

<?php
/*
Plugin Name: Skip SSL Verify
Plugin URI: http://www.damiencarbery.com
Description: Skip SSL verify in curl downloads - fixes: Download failed. error:0D0890A1:asn1 encoding routines:func(137):reason(161).
Author: Damien Carbery
Version: 0.1

$Id:  $
*/

function ssv_skip_ssl_verify($ssl_verify) {
    return false;
}
add_filter('https_ssl_verify', 'ssv_skip_ssl_verify');
add_filter('https_local_ssl_verify', 'ssv_skip_ssl_verify');

I saved this into a text file which I named Skip_SSL_Verify.php, copied it up into the site's plugin directory and activated it.

Problem solved.  The site now updates normally.

Posted inBlogging, Tech stuff | 3 Replies

Post navigation

<<123456…2627>>

Recent Posts

  • Installing Linux Mint 20
  • To kill or not to kill
  • Weaver Extreme Info Bar Spacing
  • FireTray not working
  • Iframes not refreshing in WordPress pages

Categories

  • Blogging
  • General
  • Linux
  • Media
  • Tech stuff
  • Writing

Blogroll

  • Head Rambles
  • Kirk M's Just Thinkin'
  • Wordpress Beginner
  • Wordpress Development
©2021 - A Pipe and a Keyboard - Weaver Xtreme Theme
↑