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

Chat about anything related to Linux Mint
User avatar
BenTrabetere
Level 5
Level 5
Posts: 977
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 17
Level 17
Posts: 7076
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 19.1 Xfce/fluxbox
Manjaro openbox/fluxbox

User avatar
BenTrabetere
Level 5
Level 5
Posts: 977
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 17
Level 17
Posts: 7076
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 19.1 Xfce/fluxbox
Manjaro openbox/fluxbox

User avatar
BenTrabetere
Level 5
Level 5
Posts: 977
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.

all41
Level 15
Level 15
Posts: 5583
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.

User avatar
smurphos
Level 12
Level 12
Posts: 4086
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher
Contact:

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;
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.

User avatar
lsemmens
Level 8
Level 8
Posts: 2342
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-46-generic x86_64 bits
Desktop: Cinnamon 3.8.9
Distro: Linux Mint 19 Tara

Laptop HP-ProBook-470-G2 8Gb RAM SSD
Server AMD Phenom 9650 - GEForce 9400GT 6Gb RAM
+ three other Mint machines
Out of my mind - please leave a message

User avatar
Greencedar
Level 3
Level 3
Posts: 150
Joined: Thu Jan 31, 2019 8:29 pm
Location: Missouri.
Contact:

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

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

gm10
Level 18
Level 18
Posts: 8730
Joined: Thu Jun 21, 2018 5:11 pm

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

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

User avatar
catweazel
Level 19
Level 19
Posts: 9205
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 » Sat May 18, 2019 7:04 am

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.
¡uʍop ǝpısdn sı buıɥʇʎɹǝʌǝ os ɐıןɐɹʇsnɐ ɯoɹɟ ɯ,ı

User avatar
Greencedar
Level 3
Level 3
Posts: 150
Joined: Thu Jan 31, 2019 8:29 pm
Location: Missouri.
Contact:

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

Post by Greencedar » Fri May 31, 2019 8:04 am

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

Post Reply

Return to “Chat about Linux Mint”