Page 6 of 6

Re: Tips, Hints, Tricks and Kinks--please add your own.

Posted: Fri Mar 16, 2018 4:21 pm
by BenTrabetere
Flemur wrote:
Fri Mar 16, 2018 1:31 pm
"cd" to common locations (needs a script and an alias) without making links:
I was hoping this would show up.

I use something similar - I have a Data partition mounted under /mnt, and not all of the directories are linked in /home. It is handy for navigating to these directories quickly. I was tempted to post this tip here, but hesitated because I did not want to give the impression it was my idea.

I was almost certain what I use is based on one of your earlier posts, and this post confirms it. There is no way I would use something like ddata without outside help; I would, however, shamelessly stealborrow it. I do not remember the thread, but I recall it contained several nice tips worth adopting. Good stuff.

Re: Tips, Hints, Tricks and Kinks--please add your own.

Posted: Sat Mar 17, 2018 9:38 am
by Flemur
BenTrabetere wrote:
Fri Mar 16, 2018 4:21 pm
There is no way I would use something like ddata without outside help;
That took some fiddling! If you put a regular "cd" in a script, it'll "go there" and then come back when the script exits, so you're back where you started.

I wish I could figure out how i made that "W" script work because I'd like to spiff it up, but now I can't understand it.

Re: Tips, Hints, Tricks and Kinks--please add your own.

Posted: Sat Mar 17, 2018 11:05 am
by BenTrabetere
Flemur wrote:
Sat Mar 17, 2018 9:38 am
BenTrabetere wrote:
Fri Mar 16, 2018 4:21 pm
There is no way I would use something like ddata without outside help;
That took some fiddling! If you put a regular "cd" in a script, it'll "go there" and then come back when the script exits, so you're back where you started.
Gaak! Did I post to the wrong thread? Or did a mod merge two threads? I hope folks from the other thread see this one. Lots of good stuff.

I was fighting the "cd" boomerang when you shared your scripts. I was at the early stages of trying to write bash scripts, and I was looking for a way to navigate to directories quickly. I have no programming skills, and so pretty much nothing worked. The "ddata" trick really helped to ease my frustration and encourage me to keep trying. It showed me there was a way.
I wish I could figure out how i made that "W" script work because I'd like to spiff it up, but now I can't understand it.
I wish I could figure out what it does, how to use it, and why I would want to use it. :)

Re: Tips, Hints, Tricks and Kinks--please add your own.

Posted: Sat Mar 17, 2018 11:28 am
by Flemur
BenTrabetere wrote:
Sat Mar 17, 2018 11:05 am
Gaak! Did I post to the wrong thread? Or did a mod merge two threads? I hope folks from the other thread see this one.
Yeah, I thought I was posting on the first page, and now it's page 5 or 6.
Edit: thread started "by vrkalak » Mon Dec 21, 2009"
I wish I could figure out what it ["W"] does, how to use it, and why I would want to use it. :)
Well, I hardly ever use menus; if I want to run some Mint function (say "mint drivers") from a terminal, I find the name like this:

Code: Select all

$ W mint
mint-drivers
mint-fortune
mint-release-upgrade
...
or

Code: Select all

$ W driver
loadndisdriver
mint-drivers
pildriver
...
then I can copy/paste the resulting name (mint-drivers); it's faster than using menus (menus are actually a pretty slow GUI if you have to go down more than one level - but you don't have to remember anything), although it'd be a lot handier if there were some naming convention, like if dvd software had "dvd" in the name:

Code: Select all

$ W dvd
AnyDVD
convxdvd
dvd+rw-booktype
... 
The first two are windows programs running under wine. But "handbrake" dvd ripper doesn't show up. Sigh.

Re: Tips, Hints, Tricks and Kinks--please add your own.

Posted: Sat Mar 17, 2018 3:28 pm
by BenTrabetere
Flemur wrote:
Sat Mar 17, 2018 11:28 am
BenTrabetere wrote:
Sat Mar 17, 2018 11:05 am
Gaak! Did I post to the wrong thread? Or did a mod merge two threads? I hope folks from the other thread see this one.
Yeah, I thought I was posting on the first page, and now it's page 5 or 6.
Edit: thread started "by vrkalak » Mon Dec 21, 2009"
I guess a moderator merged the threads.
I wish I could figure out what it ["W"] does, how to use it, and why I would want to use it. :)
Well, I hardly ever use menus; if I want to run some Mint function (say "mint drivers") from a terminal, I find the name like this:

Code: Select all

$ W mint
mint-drivers
mint-fortune
mint-release-upgrade
...
or

Code: Select all

$ W driver
loadndisdriver
mint-drivers
pildriver
...
then I can copy/paste the resulting name (mint-drivers); it's faster than using menus
Now it makes sense. And it actually became useful after I renamed my script "W". I originally named it "w", and the output was nothing close to what I expected. (I was not aware there was a w command, and my bash script could not compete with it.)

Note to Self: Run which <name>, both upper case and lower case before settling on a name for a bash script.
although it'd be a lot handier if there were some naming convention, like if dvd software had "dvd" in the name:
If you want to tilt at windmills, ask for better documentation. It stands a better chance of being adopted, and it would be more useful to more people.

Re: Tips, Hints, Tricks and Kinks--please add your own.

Posted: Sat Mar 17, 2018 8:25 pm
by all41
BenTrabetere wrote:
Sat Mar 17, 2018 3:28 pm

I guess a moderator merged the threads.
Yes--I was unaware of this thread when I started the new one, and then someone resurrected the original.
I think it is a great topic. I've learned volumes watching and learning from forum members
who are kind enough to share.

Re: Linux: Tricks of the Trade -- tips from our members

Posted: Mon Mar 19, 2018 7:40 am
by smurphos
Bash script to fix problems with barely visible text in firefox input fields with some GTK themes.

It just puts a userContent.css file in the default profile containing this line input, textarea { color: #222; background: #eee; } which forces it to be very dark grey text on a very light grey background.

Code: Select all

!/bin/bash
#Description: Helper file to write userContent.css to /$HOME/.mozilla/firefox/usersprofile.default folder in order to fix issues with text visibility in input fields with some themes
cd ~/.mozilla/firefox/
if [[ $(grep '\[Profile[^0]\]' profiles.ini) ]]; then 
    PROFPATH=$(grep -E '^\[Profile|^Path|^Default' profiles.ini | grep -1 '^Default=1' | grep '^Path' | cut -c6-);
else
    PROFPATH=$(grep 'Path=' profiles.ini | sed 's/^Path=//');
fi
TARGETPATH="$HOME/.mozilla/firefox/$PROFPATH/chrome";
TARGETFILE="$HOME/.mozilla/firefox/$PROFPATH/chrome/userContent.css";
TARGETSTRING="input, textarea { color: #222; background: #eee; }";
if [ ! -d "$TARGETPATH" ]; then
    mkdir "$TARGETPATH";
    echo "creating folder $TARGETPATH";
    echo "";
fi
if [ ! -f "$TARGETFILE" ]; then
    touch "$TARGETFILE";
    echo "creating file $TARGETFILE";
    echo "";
fi
echo "$TARGETSTRING" >> "$TARGETFILE";
echo "writing  string '$TARGETSTRING' to $TARGETFILE";
echo "";
echo "please restart Firefox for fix to take effect";
echo "";
read -p "Press enter to exit the script.";
cd;
exit;

Re: Linux: Tricks of the Trade -- tips from our members

Posted: Wed May 02, 2018 9:48 am
by lsemmens
How to monitor a Linux log file in real time

If this has already been posted, my apologies.

Re: Linux: Tricks of the Trade -- tips from our members

Posted: Sat May 18, 2019 6:13 am
by Greencedar
vrklak gave this link:
Most everything pertaining to Ubuntu works for Mint >> http://www.ubuntupocketguide.com/index_main.html
Thanks for the link to the "Ubuntu Pocket Guide."

Re: Linux: Tricks of the Trade -- tips from our members

Posted: Sat May 18, 2019 6:57 am
by gm10
Greencedar wrote:
Sat May 18, 2019 6:13 am
vrklak gave this link:
Most everything pertaining to Ubuntu works for Mint >> http://www.ubuntupocketguide.com/index_main.html
Thanks for the link to the "Ubuntu Pocket Guide."
Just be aware that "some" things changed in both Ubuntu and Mint during the over 10 years since that guide was written...

Re: Linux: Tricks of the Trade -- tips from our members

Posted: Sat May 18, 2019 7:04 am
by catweazel
gm10 wrote:
Sat May 18, 2019 6:57 am
Greencedar wrote:
Sat May 18, 2019 6:13 am
vrklak gave this link:
Most everything pertaining to Ubuntu works for Mint >> http://www.ubuntupocketguide.com/index_main.html
Thanks for the link to the "Ubuntu Pocket Guide."
Just be aware that "some" things changed in both Ubuntu and Mint during the over 10 years since that guide was written...
That might account for it being a free download.

Re: Linux: Tricks of the Trade -- tips from our members

Posted: Fri May 31, 2019 8:04 am
by Greencedar
Thank you for the reminder that Manuals, Guides, etc.., can change with time. As with most folks, I understand that Manuals change with time; especially as new distros, software, applications, etc... change.

I will try and note on my post if a Guide may be outdated or if it for just a particular distro.