• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

The "Linux questions (and other stuff)" thread

One day at work, using Win7, I was able to encrypt files and offer to give the files their own password to decrypt it. The PC have PGP installed. I guess this is in case the persons you send the files to doesn't have PGP installed.

Is there a way to do this using KGPG for KDE4? I really don't use encryption much but looking into using it more while at work. I can see how to encrypt files but not give it an individual password.

Thnx.
 
Upvote 0
One day at work, using Win7, I was able to encrypt files and offer to give the files their own password to decrypt it. The PC have PGP installed. I guess this is in case the persons you send the files to doesn't have PGP installed.

Is there a way to do this using KGPG for KDE4? I really don't use encryption much but looking into using it more while at work. I can see how to encrypt files but not give it an individual password.
I haven't looked into any kind of encryption in a long time, so this may not be what you're looking for, but I used to use crypt (a built-in *nix command). It encrypts and requires a password. I used to use it with vi, by invoking vi with the -x argument.

Have a look and see if it's what you're after:

man crypt

And, a little *nix historical tidbit. :) Back in the '80s when I was upgrading the OS at work, we had to prove to SCO that we were in the United States before they'd let us have crypt. I still remember receiving its diskette and man sheets separately, a little while after receiving the rest of the upgrade.
 
Upvote 0
I want to import the job's PGP keys to my home computer and when I open Kgpg, it starts to open and then closes out. Using CLI it does the same thing and do not show any type of messages.

Kgpg open when I used it for the first time, but now I can't get it to open at all. Any ideas/suggestions what may be causing this?

It will open if I run it as root and I get the icon in the bottom tray. Would it be okay to run it as root and then use it as regular user?

Good thing I can run gpg from cli as regular user!
 
Upvote 0
I want to import the job's PGP keys to my home computer and when I open Kgpg, it starts to open and then closes out. Using CLI it does the same thing and do not show any type of messages.

Kgpg open when I used it for the first time, but now I can't get it to open at all. Any ideas/suggestions what may be causing this?

It will open if I run it as root and I get the icon in the bottom tray. Would it be okay to run it as root and then use it as regular user?

Good thing I can run gpg from cli as regular user!

What DE are you using?
 
Upvote 0
If you install Kubuntu, you can also have Ubuntu--with its GNOME or Unity or whatever desktop environments they have now--and switch freely between them. And vice versa. You can install Ubuntu and then add the Kubuntu components, or install Ubuntu and add the KDE components. (This is Linux--so there are always MANY choices and MANY ways of doing things.)

I'm also a big fan of Bodhi Linux.

Is it better/easier/more recommended to use Kubuntu, or ubuntu with the kde bits on?

And can I use a USB flash drive rather than a dvd ? (after the next post, I assume if I could, I'd have to make it bootable)
 
Upvote 0
Is it better/easier/more recommended to use Kubuntu, or ubuntu with the kde bits on?
I've done it both ways, just for the fun of it, and I can't really say one way is better than the other. Now, I always do it the Kubuntu way, but if you choose to install Ubuntu first, that's fine. It's just more work, looking for and installing all the K bits.

My brain is several steps ahead of my fingers. :D

There are MULTIPLE ways to end up with Kubuntu after installing Ubuntu. One is to use Ubuntu to install the K bits. For example, using Synaptic and/or apt-get and searching for all the K parts you want to install (or NEED to install, as the case may be). But you can also do it by heading over to KDE and grabbing their file, then installing that on top of Ubuntu.

The easiest method is to simply use the Kubuntu install file. :)

And can I use a USB flash drive rather than a dvd ?
I've never done that, but I don't see why it wouldn't be possible, as long as you can tell the computer to boot from that drive. Anyone?
 
Upvote 0
Question to pose here:

Let's say I have a directory that contains subdirectories that I would like to zip in such a way that each subdirectory has its own zip file. Is there a way to do this with a script? I know I could do this manually but I would rather be able to just run the script

What I have so far:

[HIGH]#!/bin/bash
WORK=/path/to/work/directory
SUBDIR=$1
ls -l $WORK/$SUBDIR > ~/listing
list="cat ~/listing | wc -l"
for d in $list; do
zip -r $d.zip $WORK/$SUBDIR/$d
done[/HIGH]

Something's obviously wrong with this though as it doesn't do what I want it to do
 
Upvote 0
Let's say I have a directory that contains subdirectories that I would like to zip in such a way that each subdirectory has its own zip file. Is there a way to do this with a script? I know I could do this manually but I would rather be able to just run the script

What I have so far:

[HIGH]#!/bin/bash
WORK=/path/to/work/directory
SUBDIR=$1
ls -l $WORK/$SUBDIR > ~/listing
list="cat ~/listing | wc -l"
for d in $list; do
zip -r $d.zip $WORK/$SUBDIR/$d
done[/HIGH]

Something's obviously wrong with this though as it doesn't do what I want it to do

I just slapped something together, but I'm not 100% sure it's exactly what you're after.

From your snippet, it looks like you want to hard-code the working directory, then at runtime you want to manually enter the name of a subdirectory to zip, correct? Is that actually how you want it? If so...ignore the following!

This--as it stands right now--has nothing hard-coded, meaning it can be run in any directory, and it automatically finds all of its subdirectories, and zips each one as its own subdirectory-named zip file in its own subdirectory. Obviously, this can be tweaked as far as location of the zipped files, whether or not you enter a directory/subdirectory name, and so on:

Code:
#!/bin/bash
for SUBDIR in `ls -d1 */` 
do ZIPFILE=`basename $SUBDIR`
zip -r $SUBDIR$ZIPFILE.zip $SUBDIR
done

Any questions about what's doing what, just ask. :)
 
  • Like
Reactions: palmtree5
Upvote 0
I just slapped something together, but I'm not 100% sure it's exactly what you're after.

From your snippet, it looks like you want to hard-code the working directory, then at runtime you want to manually enter the name of a subdirectory to zip, correct? Is that actually how you want it? If so...ignore the following!

This--as it stands right now--has nothing hard-coded, meaning it can be run in any directory, and it automatically finds all of its subdirectories, and zips each one as its own subdirectory-named zip file in its own subdirectory. Obviously, this can be tweaked as far as location of the zipped files, whether or not you enter a directory/subdirectory name, and so on:

Code:
#!/bin/bash
for SUBDIR in `ls -d1 */` 
do ZIPFILE=`basename $SUBDIR`
zip -r $SUBDIR$ZIPFILE.zip $SUBDIR
done

Any questions about what's doing what, just ask. :)

The way the directories are is my work directory has subdirectories for each section. In those subdirectories are the directories that need to be zipped in such a way that each of those directories is its own zip file. What you gave me works if I was trying to include the entire section in one zip.
 
Upvote 0
The way the directories are is my work directory has subdirectories for each section. In those subdirectories are the directories that need to be zipped in such a way that each of those directories is its own zip file. What you gave me works if I was trying to include the entire section in one zip.
No worries--it can be tweaked. :)

Do you want to see what you can come up with using my snippet as a start?
 
  • Like
Reactions: palmtree5
Upvote 0
Got it!

[HIGH]#!/bin/bash
SUBDIR=$1
cd $SUBDIR
for SUBDIR2 in `ls -d1 ./*`
do ZIPFILE=`basename $SUBDIR2`
zip -r $ZIPFILE.zip $SUBDIR2
done
[/HIGH]

Excellent! :D

There's potential for all sorts of variations. Damn, I love *nix. :)

Something I just found out the hard way is this doesn't deal with directories that contain spaces in their names...
 
Upvote 0
Something I just found out the hard way is this doesn't deal with directories that contain spaces in their names...
Tsk...tsk...tsk... Spaces in file names. :rolleyes: *sigh*

:laugh:

Experiment with quoting/escaping the commands that refer to directories. If you run up against a brick wall, shout! :)
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones