How to hide bitnami banner in macOS - macos

To hide the bitnami banner, google recomment to run
sudo ./bnconfig --disable_banner 1
But in MacOS it is bnconfig.app and so I am not able to run this. changing this to
sudo ./bnconfig.app --disable_banner 1
also failed.
How can I do this in macOS

.app folders on OS X are a bit peculiar. From the finder they look like programs, but in the terminal they are actually just folders.
It seems like this is the way to configure Bitnami on Mac: https://docs.bitnami.com/installer/components/bnconfig/
In your case I think that means:
~/Documents/BITNAMI/odoo9/apps/odoo/bnconfig.app/Contents/MacOS/installbuilder.sh --disable_banner 1
If you need to run this with sudo, replace the ~ with the absolute path to your home folder. You can get it with (cd ~ && pwd).

Related

WSL: Using A WSL symlink folder from Windows

I use WSL almost exclusively, and only switch to main windows for browsing and running Windows native programs. I have a git repository located at /mnt/c/myrepo. In order to "install" the code inside /mnt/c/myrepo I need to move it to /mnt/c/otherlocation/renamed. Instead of executing cp -r /mnt/c/myrepo /mnt/c/otherlocation/renamed every time I do a git pull from /mnt/c/myrepo, I would like to symlink /mnt/c/myrepo to /mnt/c/otherlocation/renamed. However when I do this, the program which consumes /mnt/c/otherlocation/renamed isn't able to view the "contents" of renamed as a directory.
I have been all over the WSL github repo and issue tracker trying to find a solution to this issue. I see a lot of exclamations about how symlinks "just work". I have enabled every Windows 10 developer feature I can find, I even followed some reddit thread where someone claimed that purchasing Pengwin and creating a symlink from Pengwin would ensure this compatibility, but I still can't seem to make this work.
The basic usage I need, is allow me to view "renamed" as a directory from windows, or for windows to recognize the symlink as a symlinked directory.
from wsl:
ln -s /mnt/c/myrepo /mnt/c/otherlocation/renamed
from windows:
open file explorer
navigate to c:\otherlocation
open mydir and view the contents as if it were a native directory
How do I do this?
Do the symlink in Windows, in cmd.exe:
mklink /d C:\otherlocation\renamed C:\myrepo
It doesn't make sense creating the symlinks in WSL if both directories are in Windows.
This symlink will work in WSL as well.
The solution to this problem is simply to use the relative path when declaring the link. If you want to link from windows to windows, you should relatively path from the current directory and then you can link anywhere you wish.
From the example, instead of this:
ln -s /mnt/c/myrepo /mnt/c/otherlocation/renamed
Do this:
cd /mnt/c/otherlocation
ln -s ../../myrepo ./renamed

How to make babun/cygwin home directory equal windows home directory?

I just installed babun, a variant of Cygwin. I want the cygwin user home directory to equal my windows home directory.
So, to be clear, I don't want to add the cygwin home to the C:\Users as a new user, I want it to be the same as my current windows home directory.
Now, according to this post, How can I change my Cygwin home folder after installation?, there is a neat way to make the cygwin home directory point to your windows home directory.
You open the file /etc/nsswitch.conf and make sure is has a line db_home: windows. However, after restarting my pc, echo $HOME still says /home/chiel.tenbrinke, which is not what is should be. It should say something like /cygdrive/c/Users/Chiel.tenBrinke.
Why is this not working?
My cygwin version is CYGWIN_NT-6.1-WOW IM-Chiel-2015 1.7.35(0.287/5/3) 2015-03-04 12:07 i686 Cygwin.
Babun has a surprisingly good FAQ. The last entry in the FAQ is How to Use the Windows home directory as Babun's home directory?
For me, it boiled down to:
Create an env var for $HOME = /Users/my_account_name via Win+R sysdm.cpl
Run mkpasswd -l -p "$(cygpath -H)" > /etc/passwd
Run babun install
I'm not sure why Babun doesn't recognize the standard cygwin setting in /etc/nsswitch.conf, and I'm a bit surprised there was no mention of this setting in the Cygwin FAQ. I'm a bit concerned that in spite of what a great collection Babun is, it may fall out of sync with Cygwin quickly if not properly maintained.
I tried an easier way and works perfectly so far.
Just mv your home folder to the location you want, and make a symlink
The first execution after move may prompt errors, run babun install will fix everything.
in /etc/nsswitch.conf
db_home: /cygdrive/c/Users/%H

Does usr/local/src on mac not exist?

I am new to computers and using the terminal. Most tutorials I look at for downloading tell me to go to usr/local/src. However, I don't find this on mac. Should I just make a directory called src?
Or is this something specific only to linux users?
If someone could tell me how much difference it makes for this directory to exist or not that would be great. Can I complete my installations in usr/local itself?
Thanks
Using the Finder, you can press Cmd-Shift-G and type /usr to display that folder. The /local folder is there by default, but not its /src subfolder. The Finder, of course, can easily create it for you.
As #cricket_007 mentioned, you need to be certain of what you're doing in this area of the system — that's why OS X doesn't display those folders by default. If you understand the risk and want to see everything in the Finder, you can issue the following Terminal command:
defaults write com.apple.finder AppleShowAllFiles YES
... then type:
killall Finder
and it will look like this. The hidden folders have a slightly faded appearance, but you can navigate into them as desired:
Alternatively (for High Sierra and above)
You may simply use the key combination: " Cmd Shift > " to toggle on and off hidden file display.
It depends what you are doing. If you're messing about just create one in your home directory:
$ cd ~
$ mkdir src
If you building stuff via configure etc., and you want to install it into /usr/local (the default install prefix), then just do this:
$ cd ~/src/packagename
$ ./configure ... options ...
$ make
$ sudo make install

Bookmark Directories In Terminal

Looking for a solution to quickly navigate to long paths in a shell (particularly Max OS X Terminal.app).
Say my path is ~/This/Is/A/Really/Long/Path/That/I/Would/Rather/Not/Type/Frequently
Instead of cd ~/This/Is/A/....
I would like to be able to store favorites/bookmark directories so I could do "cd myPath"
Are there any binaries or tools available to do something like this?
I've found the packages 'Apparix' and 'Goto' which together make the stuff dreams are made of for us terminal junkies.
Naturally, I had trouble installing Apparix, but I figured it out in the end.
How To Install Apparix on Mac OS X:
Download the tarball from Apparix's homepage.
Unpack the tarball, cd to the unpacked folder.
Run this command ./configure --prefix=$HOME/local && make && make install.
Run man apparix, scroll down to the heading BASH-style functions, copy everything within that section (delimited with ---) and paste it into ~/.bash_profile.
That's it. You should now have Apparix up and running on OS X (further install info and usage is on Apparix's homepage).
Another solution is to use Bashmarks, which allows you to this
$ cd ~/This/Is/A/Really/Long/Path/That/I/Would/Rather/Not/Type/Frequently
$ s shortname # save current path as `shortname`
$ cd /
$ g shortname # cd to ~/This/Is/A/Really/Long/Path/That/I/Would/Rather/Not/Type/Frequently
You can use aliases (stick them in your ~/.bash_profile if you want them to always load)
alias cd_bmark1='cd ~/This/Is/A/Really/Long/Path/That/I/Would/Rather/Not/Type/Frequently'
Then use by just typing
cd_bmark1
into the console
I know you already found an answer that worked for you, but a couple of more lightweight suggestions that might help others looking for similar things
If your directories are relatively fixed, just long and far away from each other, you can use the CDPATH environment variable to add directories to the search path when typing the "cd" command. If the directory name you try to cd to isn't in the current directory, the other entries in your CD path will also be looked at (and it's also tab complete aware, at least in bash and zsh).
Switching to zsh rather than bash and using the excellent directory stacks abilities. With it, you can maintain a history of directories that you've visited, view the history with the "dh" alias, and easily switch to a directory by using quick shortcuts (ex: cd -3 to switch to the 3rd directory in your history stack).
Why not having a symlink ?
ln -s ~/This/Is/A/Really/Long/Path/That/I/Would/Rather/Not/Type/Frequently bmark
cd bmark
I use to.sh daily to create and navigate bookmarked paths in bash. It supports tag autocompletion and the ability to easily add/remove bookmarks.
https://github.com/Grafluxe/to.sh
Full disclosure, I wrote this tool :)

Adding custom log locations to the OS X console application

After searching online, the best solution I've found so far is to just make a symbolic link in either "/Library/logs/" or "~/Library/logs/" to get it to show up in the Console application.
I'm wondering if it would be possible to add a new directory or log file to the "root" level directly under the "LOG FILES" section in the console.
Here's a quick screenshot:
There is one way to get your log files into the console.
You can add a symlink to the log file or log directory to one of the directories in the list. The directory ~/Library/Logs seems like the logical choice for adding your own log files.
For myself I wanted easy access to apache2 logs. I installed apache2 using macports and the default log file is located at /opt/local/apache2/logs.
Thus all I did was create the symlink to that directory.
# cd ~/Library/Logs
# ln -s /opt/local/apache2/logs/ apache2
Now I can easily use the console.app to get to the logs.
My solution for macOS Sierra:
First and last step, you must create a hard link from your source (log) directory into (as example) one of existing official log directories, you can seen in console.app.
I take my ~/Library/Logs directory for that.
hln /usr/local/var/log /Users/dierk/Library/Logs/_usr_local_var_log
Cross-posting this great tool for creating hardlinks originally posted by Sam.
Short intro:
To install Hardlink, ensure you've installed homebrew, then run:
brew install hardlink-osx
Once installed, create a hard link with:
hln [source] [destination]
I actually just came across this option that worked perfectly for me:
Actually if you open terminal and...
$ cd /Library/Logs
then sym-link to your new log directory. eg i want my chroot'ed apache logs as 'www'
$ ln -s /chroot/apache/private/var/log www
then re-open Console.app
drill down into /Library/Logs and you will find your sym-linked directory.
;-)
Mohclips.
http://forums.macosxhints.com/showthread.php?t=35680
In Terminal run this command... append any log file directories you want to add
defaults write com.apple.Console LogFolderPaths -array '~/Library/Logs/' '/Library/Logs/' '/var/log/' '/opt/local/var/log/'
Since Mavericks, symlink behavior as change so "ln - s" doesn't work anymore.
use hardlink-osx instead to create an hardlink to your directory (may be installed via homebrew)
Very old post I know but, this is the only way I could get it to work.
cd /Library/Logs
sudo mkdir log_files
sudo ln -s /Users/USERNAME/Sites/website/logs/* log_files
In mac os 10.11, you may not be able to link to folder of logs, but instead you need to link to each log of logs folder in side console.
ln -s /opt/local/apache2/logs/error_log ~/Library/Logs/Apache2/error_log
You can just open any text file with console.app and it will add and keep it. Folder's though, no luck on that yet.
I was able to hardlink the files into ~/Library/logs by running:
ln /usr/local/var/logs/postgres.log ~/Library/logs
Notice the absence of -s.
No luck for directories though.
OSX Sierra 10.12.6
Just tried to do something similar.
I enter this in terminal, while the Console.app was running.
sudo mkdir -p /usr/local/var/log/apache2
sudo mv /private/var/log/apache2 /usr/local/var/log/apache2/apache2-old
sudo ln -s /usr/local/var/log/apache2 /private/var/log/apache2
Now whenever I open the Console.app it crashes.
Really wish there was a way of adding log files in the files. You CAN do it by dragging and dropping a folder onto the Console.app (given it a directory path as an argument), but the added folder only displays its immediate contents and doesn't allow for recursively descending into folders.
---------EDIT BELOW----------
Nevermind I stupidly did something like this leading to infinite recursion in Console.app
sudo mkdir -p /usr/local/var/log/apache2
sudo ln -s /private/var/log/apache2/apache2 /usr/local/var/log/apache2
sudo mv /private/var/log/apache2 /usr/local/var/log/apache2/apache2-old
sudo ln -s /usr/local/var/log/apache2 /private/var/log/apache2
I don't believe it's possible.
If you're generating log files, you should generate them into one of the standard locations anyway, so this won't be an issue.

Resources