How to do Aliases in busybox - alias

I am trying to create an alias "ll" that would translate to "ls -lrt" like I'm used to.
As per general concept i should find a file named .shrc. In that file, i may already have default aliases . But there is no such files there .
Have tried with direct input to the console :
alias ll='ls -al'
alias: not found
Please suggest if any one have any idea for this .

Okay this question is very old, but I had the same problem. (Just installed OpenWRT on a router.)
The easiest way is to create a file with the name .profile in your home directory, and add your favorite aliases. Works with Busybox 1.30.1 on my router.
Example:
alias vi='/usr/bin/vim'
alias cd..='cd ..'
alias la='ls -la'
alias q='exit'

Related

How to use an environment variable in the odoo.conf

I am trying to use an environment variable in the odoo.conf
file to specify the path where the logs are stored.
So far I have tried:
logfile = ${test.rueda}/odoo.log
But it does not work.
Is there any way to achieve this?
The Odoo configuration files do not support access to environment variables.
I can think of 2 possible approaches:
Use relative paths. The file names in the configuration are relative to the working directory of the Odoo server process. Start the Odoo server in different directories, one for every purpose, and keep the same structure relative to that.
Use environment variables in the command line. When starting the Odoo server, any configuration option can be passed using -- (2 dash signs) as a prefix. In the start script, you can then use environment variables as in any other shell script.
See https://www.odoo.com/documentation/11.0/reference/cmdline.html for details.
For referencing files or path:
When i work without external disk (where i can find my datadir):
i use in odoo config file data_dir = my_absolute_path_in_my_local_disk.
This path have a symbolic redirection to where is my local physical location of my local data directory
When my external disk come back, i change the symbolic link:
my_absolute_path_in_my_local_disk -> my_external_disk_..._data

How to set variables on CVS

I've been tasked with logging into a cvs repository hosted by someone else. I do not know much about cvs. I am supposed to change so option under my .cshrc file, such as:
setenv CVSEDITOR
setenv CVSROOT
setenv CVS_RSH
I am using bash on Mac OSX and I believe I found a file called csh.cshrc, but I cannot edit it and I'm not even sure if that is the correct file I am looking for. Thanks for any help you can offer.
This question isn't really specific to CVS. It's about setting environment variables. The file .cshrc is for the C shell. Given that you said you are using bash, the file you need is .bashrc in your home directory.
At it's simplest, you can set the relevant environment variables like so:
export CVSEDITOR=...
export CVSROOT=...
export CVS_RSH=...
Those are probably the only ones you will need, but you should refer to the full list if you want something more.

Using a dynamic drive letter alias for apache

I'm using XAMPP on my USB flash drive - which makes it easy for me to take my dev. environment with me from one PC to another.
However, I want to be able to serve files for my projects directly from my /Projects folder - which is in the root of the drive - instead of having to copy this folder into /htdocs.
I've read on the web that I can easily do this by adding an alias to 'httpd.conf' - but I would then need to hard-code the drive letter - which can be different for every PC I plug my USB into.
Is there any way to add a dynamic driver letter to my alias ?
Or - can I maybe use a relative path somehow ?
Or - am I going about it wrong and there's a better way to do it ?
Thanks in adv!
First of all, I think you already know that xampp lite supports relative addressing to run it in portable mod.
But when it comes to location of htdocs folder, I didnt experienced something like that. But I can offer some alternates (without moving the htdocs folder) which can be useful.
This simple .bat file (located in the same root of xampp folder)
#ECHO OFF
:START
Start xampp\htdocs
Can open your "htdocs" folder without depending to drive letter.
If you try to make something more complicated, here it comes the drive letter variable in .bat
#ECHO OFF
PUSHD \
SET AMOVIBLE=%CD%
POPD
ECHO %AMOVIBLE%
PAUSE
This example will show you the drive letter that the bat file executed from. Just move the %AMOVIBLE% variable wherever you want in your code.
And if variables from an external file is needed
Define variable
(SET /P var=)<sometextfile.txt
MKDIR folder\%var%\folder\
This can help.
So, if the movement of htdocs folder is not obligated, I think these will help. If not, sorry out of my range :)
Regards

SSH unzip BUT with CASE-SENSITIVITY

I have am trying to unzip a file via SSH, I require a case sensitive unzip.
My server is using Debian Unzip 6.
It shouldn't be doing this, but it is converting all my file names to lower case, causing my Joomla site to buckle.
There are far too many files to rename manually or to FTP if I want to finish in my lifetime.
I have a zip called bv2.zip placed in the directory I want to extract in...
I have cd'd into my directory and simply issued: unzip bv2.zip .... filenames all go to lowercase...
I have also tried absolute paths to no avail, the UNZIP help and manual states that case sensitivity is enabled by default with this version, but obviously not...
Any ideas??
what does unzip -v file.zip show? The docs say
by default unzip lists and
extracts such filenames exactly as they're stored (excepting
truncation, conversion of unsupported characters, etc.)
It'd be worth checking how they are stored. If the creating zip program is storing them all as lowercase, then that's where you need to look for a way to actually store unaltered filenames.
Finally, just to be sure, check that there's no alias or environment variable on your Debian server forcing use of the -L option. Look at output of the following commands, run on the Debian server's terminal:
alias
(there should be no weird alias for unzip)
echo $UNZIP
(Any flags contained in this environment variable will be used by unzip as if they'd been added to the command invocation).
I was facing same problem in my 1&1 hosting. I have solved it by defining a new alias, by typing:
alias unzip='unzip'
The problem was unzip -L was aliased.
Now I have unzipped prestashop backup and it works like a charm
Regards
Are you sure your .zip file didn't have all lowercase names to begin with? Maybe whatever program you used to create the zip file is converting the names to lowercase.
The "-L" (convert all filenames to lowercase) and "U" (convert all filenames to upper case) options control this behavior:
http://www.mkssoftware.com/docs/man1/unzip.1.asp
This would ONLY be an issue if the files in the .zip were from a case-insensitive filesystem (like MS-DOS or VAX/VMS). It should not be an issue if the files were .zipped up on ANY contemporary filesystem (Unix, MacOS, Windows 95 or higher) with ANY contemporary version of Zip or WinZip.
Soooo ......
Is there any chance these are DOS files?
Or did you use a DOS version of PKZip?
Or were the files simply lower case to begin with?

Setting environment variables in Rails

I'm trying to make my project OSS, and I'd like to remove any sensitive info from the configs. I'm trying to have ENV['DB_PASS'] = mypassword. Where would I set this? I've tried export DB_PASS=mypassword in my .bashrc file. But that's not working.
Are you sure export isn't working? Have you tried echo $DB_PASS? (Also, changes to .bashrc won't take effect until the next time you log in.)
A more common way to handle this problem is to create a separate config file that is not tracked in your repository, and then provide a config.sample file demonstrating the common configuration options but with dummy values.