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

Chat about anything related to Linux Mint
User avatar
Flemur
Level 18
Level 18
Posts: 8702
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

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

Post 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.
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
User avatar
BenTrabetere
Level 6
Level 6
Posts: 1286
Joined: Sat Jul 19, 2014 12:04 am
Location: Hattiesburg, MS USA

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

Post 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. :)
User avatar
Flemur
Level 18
Level 18
Posts: 8702
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

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

Post 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.
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
User avatar
BenTrabetere
Level 6
Level 6
Posts: 1286
Joined: Sat Jul 19, 2014 12:04 am
Location: Hattiesburg, MS USA

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

Post 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.
User avatar
all41
Level 16
Level 16
Posts: 6387
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

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

Post 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.
Light travels faster than sound.
That's why some people appear smart until you hear what they are saying.
User avatar
smurphos
Level 17
Level 17
Posts: 7332
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher
Contact:

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

Post 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;
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.
User avatar
lsemmens
Level 11
Level 11
Posts: 3537
Joined: Wed Sep 10, 2014 9:07 pm
Location: Rural South Australia

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

Post by lsemmens »

How to monitor a Linux log file in real time

If this has already been posted, my apologies.
Fully mint Household
Out of my mind - please leave a message
User avatar
Greencedar
Level 4
Level 4
Posts: 284
Joined: Thu Jan 31, 2019 8:29 pm
Location: Missouri & Taiwan
Contact:

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

Post 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."
Greencedar
gm10
Level 20
Level 20
Posts: 10999
Joined: Thu Jun 21, 2018 5:11 pm

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

Post 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...
User avatar
catweazel
Level 19
Level 19
Posts: 9884
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

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

Post 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.
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
User avatar
Greencedar
Level 4
Level 4
Posts: 284
Joined: Thu Jan 31, 2019 8:29 pm
Location: Missouri & Taiwan
Contact:

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

Post 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.
Greencedar
User avatar
Portreve
Level 10
Level 10
Posts: 3317
Joined: Mon Apr 18, 2011 12:03 am
Location: Florida

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

Post by Portreve »

For those in a mixed Mac OS X / GNU+Linux environment, Paragon Software sells a system component called extFS which allows Mac OS X systems to read and write any of the ext file systems.
Please remember to mark your fixed problem [SOLVED].

Running Linux Mint Cinnamon 20.0.

The noblest of all dogs is the hot-dog; it feeds the hand that bites it.
— Dr. Lawrence J. Peter
Post Reply

Return to “Chat about Linux Mint”