Show Posts

You can view here all posts made by this member. Note that you can only see posts made in areas to which you currently have access.


Topics - Keith

Pages: [1] 2 3 ... 8
1
Programming / Using the "du" command with a file-list [SOLVED]
« on: March 27, 2019, 09:11:31 pm »
As part of a backup script I want to find the total GB of a list of files to be backed up to see if the supplied USB stick is big enough.
The ideal command is du, for example:
keith@dt05:~$ du -sch Documents Desktop Pictures
2.4G   Documents
73M   Desktop
1.9G   Pictures
4.4G   total
keith@dt05:~$

Better still, du has an option to read the file list from a file:
--files0-from=<file-list-path>
but the listed file/directory names must be NUL-terminated, and this is where I have become stuck.

A web search indicates "\0" as a null character but adding printf "\0" after a name when creating the file-list does  not work, and I've tried many other variations offered on the web. 
I would be grateful if anyone can suggest a way of listing files/directories in a file so that du will read it.

2
Hardware Compatibility / USBs and DVDs not working [ABANDONED]
« on: March 12, 2019, 01:08:12 pm »
I have an old desktop with an ASUS A7N8X motherboard to be renovated for a friend. 
It has XP loaded and is unbelievably slow.  At first I thought the slowness might be partly due to the age of the motherboard but the spec doesn't look too bad - although I might change the board for something better if she can afford it. 

The immediate problem is that I can't run a Linux Live USB or DVD as neither the DVD drives nor the USB sockets respond to any device.  I've tried setting the boot preferences to anything that seemed reasonable but it always boots into XP although the boot process indicates that it is booting from (for example) the DVD. 

I've checked the leads from the USBs and DVDs to the motherboard and all are placed securely in the right positions. 
The PS2 keyboard works but I don't have a PS2 mouse - I can use my USB mouse if I can get the Live USB/DVD working. 

Any advice for getting a Live USB/DVD working would be very welcome.
Thank you.

3
General Help & Advice / Intrepreting CPU info
« on: March 06, 2019, 12:47:14 pm »
Before renovating an old PC for a friend (and asking advice on that), I would be grateful for explanations about CPU speed info.  For example, here are the data for my laptop:

keith@T500:~$ sudo lshw -c cpu
[sudo] password for keith:
  *-cpu                   
       description: CPU
       product: Intel(R) Core(TM)2 Duo CPU     P8400  @ 2.26GHz
       vendor: Intel Corp.
       physical id: 6
       bus info: cpu@0
       version: Intel(R) Core(TM)2 Duo CPU     P8400  @ 2.26GHz
       slot: None
       size: 1600MHz
       capacity: 2267MHz

       width: 64 bits
       clock: 266MHz
       capabilities: fpu fpu_exception wp vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx x86-64 constant_tsc arch_perfmon pebs bts nopl aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 xsave lahf_lm kaiser tpr_shadow vnmi flexpriority dtherm ida cpufreq

keith@T500:~$

What is the significance of "CPU" speed, "size" speed, "capacity" speed (I'm guessing max = cpu speed) and "clock speed"? 

Thank you

4
Ubuntu / Multiple entriesin $PATH
« on: December 08, 2018, 08:36:20 pm »
Ubuntu 16.04 on Lenovo Thinkpad T500

My original $PATH was:
/usr/local/sbin:
/usr/local/bin:
/usr/sbin:
/usr/bin:
/sbin:
/bin:
/usr/games:
/usr/local/games:
/snap/bin:

where I have separated the entries for clarity.

I modified my .profile file as follows to include two more directories in $PATH:
# set PATH so it includes user's private bin directories
PATH="$PATH:$HOME/.bin:$HOME/.local/bin"


but $PATH now looks like this:
/usr/local/sbin:
/usr/local/bin:
/usr/sbin:
/usr/bin:
/sbin:
/bin:
/usr/games:
/usr/local/games:
/snap/bin:
/home/keith/.bin:
/home/keith/.local/bin
:
/home/keith/.bin:
/home/keith/.local/bin


Can anyone tell me why my personal paths are present twice in the $PATH variable?
It's not a problem in practice, but really annoying that I can't find the reason for it!

5
General Help & Advice / The "du" command and file-list [SOLVED]
« on: December 01, 2018, 04:17:16 pm »
I use the "du" command quite a lot - it's very useful.  Better still:  one can read from a file a list of files/directories for which one wants a size summary. 
The Man pages offer the option:
--files0-from=F
              summarize  disk usage of the NUL-terminated file names specified in file F

I tried creating a simple list containing one file or directory per line but this doesn't work. 
I guess the clue is in the "NUL-terminated file names specified in file" requirement but I can't discover from Google just what a NUL-terminated file name is. 
Can anyone advise me, please?

Found a solution!
     du -sh `cat <file-name-path>`
Hope this helps others, although it would still be nice to understand the proper "du" option. 

6
Ubuntu / Ubuntu 18.04 not working on live USB [SOLVED]
« on: November 08, 2018, 03:56:59 pm »
Lenovo Thinkpad T500 64-bit laptop running Ubuntu 16.04

Thought I'd have a look at Ubuntu 18.04 before upgrading.  I usually delay upgrading to allow the bugs to be ironed out.  Here's the process:
  • I downloaded the ISO file OK (ubuntu-18.04.1-desktop-amd64.iso) and the md5sum value agreed with the published value. 
  • Next I used the excellent UnetBootin to create a live USB, and this process seemed to go OK with no reported errors. 
  • Rebooted the PC with the USB in then selected "Try Ubuntu without installing". 
Several attempts to boot into the live USB failed with errors:
[  8.770062] tpm tpm0 error (6) occurred attempting to read a pcr value
[  8.864554] tpm tpm0 error (6) occurred attempting to read a pcr value

So I recreated the live USB and tried again. 
The same errors occurred but after a couple of attempts Ubuntu 18 fired up. 
I can connect to my network, and the terminal and FireFox work but nothings else - the little wheel rotates for a while then disappears. 
The exit button results in the usual Ubuntu blinking dots then the original Selection screen (Try Ubuntu, etc) plus a few more errors, but doesn't exit, so I crashed out. 

Hmmm!

I am guessing that as the MD5SUM is correct, then the ISO is fine, and I've never had any trouble with UnetBootin. 
I'm not desperate as I have two PCs running 16.04 but it would be nice to check out the much vaunted 18.04 and would welcome suggestions.
Thank you. 

7
General Help & Advice / Removing paths from the PATH environment variable
« on: September 09, 2018, 09:29:11 pm »
Lenovo Thinkpad T500 running Ubuntu 16.04

Many years ago I managed to add two local directories to the PATH variable and I’ve just noticed that these directories are present twice, at the beginning.  Here is $PATH listed to make it easier to read:

/home/keith/.bin:
/home/keith/.local/bin:
/home/keith/.bin:
/home/keith/.local/bin:

/usr/local/sbin:
/usr/local/bin:
/usr/sbin:
/usr/bin:
/sbin:
/bin:
/usr/games:
/usr/local/games:
/snap/bin

The local directories are not set in .bashrc or /etc/profile so I must have defined the PATH variable directly, in a rather permanent fashion. 
I think it would be safest to remove these local paths (and duplicates) and redefine them in .bashrc using “export PATH=/home/keith/.bin:$PATH” for example.  But how can I remove the offending paths safely from the existing, permanent PATH variable? 



8
General Help & Advice / Font disaster
« on: September 02, 2018, 07:41:19 pm »
Lenovo Thinkpad T500 running Ubuntu 16.04 and LibreOffice 6.0.6.2

As the summer recedes my thoughts return to a bookbinding project that I started some time ago.  Upon opening the text file in LibreOffice I discovered that the font had changed from a copperplate, cursive script (I don't remember the name) to my default DejaVu Sans. 

No problem, I thought:  just highlight all the text and select the right font in the drop-down box.   But disaster!  The font isn't listed.  Worse than that:  the fonts that are present appear to be largely of a foreign nature or large blocks of similar fonts. 

During my respite from the job, LibreOffice has been updated with the loss of very many useful fonts.  A search of the interweb suggested installing “Ubuntu-restricted-extras” which I have done and find MS-core-fonts are now installed in /usr/share/fonts/truetype and appear in LibreOffice.  Sadly these don’t include anything like a copperplate font. 

Further research hasn’t revealed a suitable source of the required font (the nearest I've found is ~£100 for a whole font family) and I would be very grateful for advice on installing the original font set of the previous version of LibreOffice, or pointing me in the direction of a suitable font. 

Thank you.

9
Peppermint / Problems creating a new user on Peppermint 3
« on: July 22, 2018, 12:21:42 pm »
I have a Dell Latitude D505 that I want to give to a friend.  It's running Peppermint 3 very well and here's the uname  info:
Linux D505 3.2.0-126-generic #169-Ubuntu SMP Fri Mar 31 14:16:01 UTC 2017 i686 i686 i386 GNU/Linux

I kept my account as administrator and added my friend as a "custom user"; both with "enter password on login" status. 
When I rebooted, the machine went straight to my account without asking for my password.  Just to check that the new account was present I did ls -l home/olwen which showed no files but no error.  Trying ls -al home/olwen showed that the account was there (a few hidden files) but nothing else, although I was expecting the usual Desktop, Documents, etc.  Hmmm!

I would be grateful for advice.
Thanks

(p.s.  Why haven't tried the latest Peppermint?  We tried and failed:  https://linuxforums.org.uk)/index.php?topic=13317.msg108540#msg108540

10
Ubuntu / Nemo file manager won't display the Rubbish Bin [SOLVED]
« on: July 04, 2018, 01:49:52 pm »
Lenovo Thinkpad T500 laptop running Ubuntu 16.04

I've been using Nemo as my default file manager for some time as I find it much better than the newer versions of Nautilus despite having a few quirks. 
I find now that when trying to display the Rubbish Bin Nemo displays it very briefly then promptly crashes. 
I have tried removing the application, along with its *.desktop files in ~/.local/share/applications, then re-installing, but all to  no avail.  Strangely; re-installation did not re-create the *.desktop files.
Not being able to display the Rubbish Bin isn't the end of the world, as I still have Nautilus, but it is rather annoying and I would be grateful for advice.

Thank you

11
Programming / Setting the terminal position
« on: June 12, 2018, 08:27:29 pm »
I have a script that I run from an exisitng terminal that changes, inter alia, the current terminal size.  But it would be nice also to reposition the terminal on the screen. 
I have found the command gnome-terminal --geometry COLSxROWS1+X+Y but this, as one might expect, opens a new terminal at the desired position. 

Is there a way to reposition the current terminal from within the script? 

12
Programming / A "grep" problem
« on: May 25, 2018, 03:40:17 pm »
Consider:

keith@T500:~$ q=$(ls | grep dEsktop)     (i.e. a non-existent file)
keith@T500:~$ echo $q

keith@T500:~$

I want to test the value of "q" for its null value here.  It's not " " or "", so what might it be? 
Can anyone help?


13
Ubuntu / LibreOffice: reverting to V5 from V6 [SOLVED]
« on: May 15, 2018, 10:39:54 pm »
Lenovo Thinkpad T500 and Ubuntu 16.04

After thoroughly screwing up LibreOffice (don’t ask!) I decided to remove it and re-install.  The new version that installed turned out to be Version 6.0.4.2 and is a real pain.  It takes ~30secs to load the application then ~20secs to load any file into Writer or Calc – indeed all actions like saving a file take an age to complete.  Worse still, the general functionality is much reduced, especially in Calc. 
At one point I noticed that the path shown at the top of the “file/open” window included a directory “59” which I knew wasn’t one of mine and further investigation revealed that this Version 6 is based on Snap. 

The snap/libreoffice directory contains the following sub-directories:  59, 63, common and current.  Directories 59, 63 and current all have identical contents (links to Desktop, Documents, etc.).   A web search informs me that snap offers developers great convenience, especially when it comes to updating code (I think), but it offers the user great inconvenience and I yearn for those halcyon days with Version 5. 

I’ve found I can download Version 5.4.6 from https://www.libreoffice.org/download/libreoffice-fresh/?type=deb-x86_64&version=5.4.6&lang=en-US  and I would like to remove every trace of Version 6 from my PC to ensure that no files are “borrowed” for use in Version 5.  In view of my propensity for screwing up I would be very grateful for advice on how to achieve all this. 

Many thanks.

14
Programming / rsync a list of files
« on: May 08, 2018, 08:57:18 pm »
I've been using rsync in a script one directory at a time, which is fine, but it would be more compact if I can get rsync to read the necessary directories/files from a file and the man pages offer the --files-from=FILE option.  Unfortunately I can't get this to work and the response is:
rsync error: syntax or usage error (code 1) at options.c(2308) [client=3.1.1]

My statement might be something like:  rsync -a  --files-from=dir-list.txt  /media/keith/BACKUP_USB

I would be very grateful for advice.

Thank you

15
Ubuntu / LibreOffice not starting [possibly SOLVED]
« on: April 29, 2018, 06:58:14 pm »
Lenovo Thinkpad T500 laptop with Ubuntu 16.04 64 bit.

I've been playing about with scripts and crontab to start LibreOffice in order to display a message then close it after a while.  This worked fine all day but now LibreOffice won't work at all, even from the applications menu.  I have tried updating and re-installing LO and the menu items are displayed, but none of the LO facilities will start.  The appropriate tab in the task bar appears for a few seconds then disappears.

Assistance would be very much appreciated.

[UPDATE]
I have:
  • removed LibreOffice via the terminal (but is still listed in the Software Centre as installed and shown in the Applications menu)
  • un-installed all the LO packages from the Software centre
  • re-installed LO via the terminal (still marked as unistalled in the Software Centre)
  • re-installed the Writer package in the Software Centre
But still none of the LO software will start. 

[UPDATE 2]
Partial success.  My machine has two software sources:
  • SystemTools/Administration/Ubuntu Software Centre
  • System Tools/Software
I've been using the first one but after finding the second one I was able to install LibreOffice 6 and remove the original links from the Applications menu. 
So I now have a working Office suite although this doesn't explain how I screwed up the original installation by just playing with cron.

So: fixed for now, though I doubt that this post has helped anyone else and I am still keen to hear of any opinions/ideas. 

Pages: [1] 2 3 ... 8

SimplePortal 2.3.3 © 2008-2010, SimplePortal