Adding one variable into multiple parts of an alias?

alias moveit='mkdir $  1 && find -name "*$  1*" -type f -exec mv -t ~/$  1 {} +' 

I’m not quite sure what I’m doing wrong. Any help would be much appreciated.

I’m trying to make an alias where typing: moveit pdf

1: creates a directory called “pdf” in the current working directory

2: searches for all the files that contain “pdf” in the name within the working directory and subdirectories

3: moves those found files into the new folder called “pdf”

I know “pdf” will return other files that aren’t pdfs. I’m essentially trying to create an automatic sorting script.

I have files called:

greatfile[pdf].rar

greatfile[txt].rar

greatfile[rtf].zip

badfile[pdf].zip

badfile[txt].zip

badfile[rtf].rar

okayfile[pdf].tar.bz

okayfile[txt].zip

okayfile[rtf].rar

And I want to sort these into folders pdf txt rtf all in one script, or at least one at a time for now.

Thank you!

Alias doesn’t work when I expect it to, works when I don’t

I have an “installer” script that installs a couple scripts and a directory for them. This works as expected. In the middle of my script I also have an alias I inject into the local .bashrc so that the script can be called from the commandline:

echo -e "..........Adding Alias" echo "alias Change=~/ChangeTool/Change" >> .bashrc  echo -e "..............Recompiling environment" . ~/.bashrc 

I can confirm it does show up in my .bashrc when I run the installer. However, if I rm -rf my script directory, remove the line from (and recompile with . ./.bashrc) my .bashrc, and reinstall, I get “Change command not found”.

I then thought to myself “o.k., I’ll try again.” so I remove the line and recompile bashrc myself. I more .bashrc and it’s no longer there. Out of curiosity I tried the Change command and it worked.

Is there just some weird delay with installing aliases?

Edit: Here is the output on fresh install:

PSTSAUTO@MUXALRM:~$   ./installer.sh  Installing [ ASR9K CHANGE TOOL ] ..........Targeting /home/PSTSAUTO/ ..........Getting raw tarball ..............Extracting the tarball ..........Adding Alias ..............Recompiling environment ..........Install Complete.  PSTSAUTO@MUXALRM:~$   Change Change: command not found PSTSAUTO@MUXALRM:~$   grep "Change" .bashrc alias Change=~/ChangeTool/Change PSTSAUTO@MUXALRM:~$    

So it’s there but it doesn’t work. As stated in code snippet above I did try to source with the . command.

Apache alias do not show images with https

I have created an alias to store product images on a different drive as follow:

ServerName multiplace.net.br ServerAlias www.multiplace.net.br ServerAdmin contato@multiplace.net.br DocumentRoot /var/www/html/multiplace/public_html

    Alias /produtos "/mnt/bloco2/multiplace/produtos"     <Directory "/mnt/bloco2/multiplace/produtos">         Options FollowSymLinks          AllowOverride all          Order allow,deny         Allow from all         Require all granted     </Directory>       ErrorLog /var/www/html/multiplace/logs/error.log     CustomLog /var/www/html/multiplace/logs/access.log combined 

I can see images with http but it returns page not found for https. Please check the example: OK http://www.multiplace.net.br/produtos/imagem.jpg Not found https://www.multiplace.net.br/produtos/imagem.jpg

Any suggestions? Many thanks.

do i need to update the alias in truststore when ssl certificate is renewed [on hold]

One micro service(spring boot – RestTemplate) calls an https url. I have added the certificate to trust store and then the truststore is used in the micro service. I know that if the ssl certificate is expired, my micro service will still be able to call the https url and get response. If the ssl certificate is renewed, will my micro service still be able to communicate with https url without adding the new certificate to the trust store. If certificate need to be added to trust store, then should I remove the existing alias and add new one? or is there a way to update the alias in trustore or I just need to add the renewed certificate with new alias?

product.info.details already has a child with alias ‘additional’


[2019-07-04 07:03:12] main.CRITICAL: Magento\Framework\Exception\LocalizedException: The element ‘product.info.details’ already has a child with alias ‘additional’ in /var/www/html/elec/vendor/magento/framework/Data/Structure.php:611 Stack trace:

0 /var/www/html/elec/vendor/magento/framework/Data/Structure.php(319):

Magento\Framework\Data\Structure->_insertChild(‘product.info.de…’, ‘product.attribu…’, NULL, ‘additional’)

product.info.details already has a child with alias ‘additional’


[2019-07-04 07:03:12] main.CRITICAL: Magento\Framework\Exception\LocalizedException: The element ‘product.info.details’ already has a child with alias ‘additional’ in /var/www/html/elec/vendor/magento/framework/Data/Structure.php:611 Stack trace:

0 /var/www/html/elec/vendor/magento/framework/Data/Structure.php(319):

Magento\Framework\Data\Structure->_insertChild(‘product.info.de…’, ‘product.attribu…’, NULL, ‘additional’)

product.info.details already has a child with alias ‘additional’


[2019-07-04 07:03:12] main.CRITICAL: Magento\Framework\Exception\LocalizedException: The element ‘product.info.details’ already has a child with alias ‘additional’ in /var/www/html/elec/vendor/magento/framework/Data/Structure.php:611 Stack trace:

0 /var/www/html/elec/vendor/magento/framework/Data/Structure.php(319):

Magento\Framework\Data\Structure->_insertChild(‘product.info.de…’, ‘product.attribu…’, NULL, ‘additional’)

Gmail alias – Automatically “send mail as” alias when alias is recipient

It’s all in the title, but I’ll spell it out:

Let’s say my primary Gmail address is bob@gmail.com, and my alias is bob@bobscrabshack.com.

I have my personal mail server forwarding mail addressed to bob@bobscrabshack.com to bob@gmail.com and I’m using my SMTP server to send mail via bob@bobscrabhshack.com using Gmail.

Someone sends me an email: Crab party inquiry to bob@bobscrabshack.com and I check it in Gmail. I hit reply. I want the “From:” to be automatically set to bob@bobscrabshack.com but by default it is set to bob@gmail.com. I normally want to send mail and reply as bob@gmail.com except when the mail is addressed to bob@bobscrabshack.com. Is there a way to do this?

How did I set up a mail alias on ClearOs 7?

A year or two ago, I set up some kind of mail alias on my ClearOs 7 server, so that mail sent to addressa@myserver.net went to me@myserver.net.

Now I want to change where the mail goes, but I can’t remember how I set it up, or how to change it!

I have looked in /etc/aliases, but it’s not there.

I have sent an email to it, and the maillog says something like…

    Jun 25 16:15:02 router postfix/smtpd[29295]: 14CDD17C71AC: client=woc.myserver.net[192.168.1.6], sasl_method=LOGIN, sasl_username=nikki@myserver.net     Jun 25 16:15:02 router postfix/cleanup[29387]: 14CDD17C71AC: message-id=<VA.00004547.01808735@trumphurst.com>     Jun 25 16:15:02 router postfix/qmgr[2236]: 14CDD17C71AC: from=<nikki@trumphurst.com>, size=743, nrcpt=1 (queue active)     Jun 25 16:15:02 router postfix/pipe[29422]: 14CDD17C71AC: to=<nikki@myserver.net>, orig_to=<addressa@myserver.net>, relay=mailprefilter, delay=0.26, delays=0.08/0.02/0/0.16, dsn=2.0.0, status=sent (delivered via mailprefilter service)     Jun 25 16:15:02 router postfix/qmgr[2236]: 14CDD17C71AC: removed 

Can anyone give me a clue where to look to change it?