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

Chat about anything related to Linux Mint
User avatar
BenTrabetere
Level 5
Level 5
Posts: 710
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 » Fri Mar 16, 2018 4:21 pm

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.

User avatar
Flemur
Level 15
Level 15
Posts: 5919
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

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

Post by Flemur » 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.

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?
Mint 18.3 Xfce/fluxbox/pulse-less
Xubuntu 17.10/fluxbox/pulse-less

User avatar
BenTrabetere
Level 5
Level 5
Posts: 710
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 » Sat Mar 17, 2018 11:05 am

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 15
Level 15
Posts: 5919
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

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

Post by Flemur » 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 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?
Mint 18.3 Xfce/fluxbox/pulse-less
Xubuntu 17.10/fluxbox/pulse-less

User avatar
BenTrabetere
Level 5
Level 5
Posts: 710
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 » Sat Mar 17, 2018 3:28 pm

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 12
Level 12
Posts: 4499
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 » Sat Mar 17, 2018 8:25 pm

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.
Proud to be a supporter and monthly contributor to Mint.

User avatar
smurphos
Level 6
Level 6
Posts: 1157
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher...

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

Post by smurphos » Mon Mar 19, 2018 7:40 am

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;

User avatar
lsemmens
Level 5
Level 5
Posts: 679
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 » Wed May 02, 2018 9:48 am

How to monitor a Linux log file in real time

If this has already been posted, my apologies.
Kernel: 4.15.0-24-generic x86_64 bits: 64
Desktop: Cinnamon 3.8.7
Distro: Linux Mint 19 Tara

Laptop T4500 Dualcore 4Gb RAM
Server AMD Phenom 9650 - GEForce 9400GT 6Gb RAM
Out of my mind - please leave a message

Post Reply

Return to “Chat about Linux Mint”