Got back to use windows…
Use putty ssh to Unix server.
Tab completion, up-down arrow history are not working. I thought the putty configuration is not correct. One hour tuning the config, not working. Then I realized maybe the shell is not bash…
Wtf ksh is… Ancient shell language.
Uname gives AIX… No wonder. IBM machine.
Now the solution is clear. “chsh” to find the available shells. Luckily bash is available in “/use/bin/bash”. Add “/usr/bin/bash” to the first line of ~/.profile.
I am expecting more troubles using windows and AIX…
I have a python script which opens firefox. I can ssh to my mac and run the script without issue. But when I ssh to the raspberry pi 2 (running Ubuntu Mate 15.04) and try to run the script, it shows “No Display Specified” error. The solution is to use “export DISPLAY=:0”
A firefox window will be opened in the remote server
Create a record of the installed libraries in a text file (requirements.txt). Dude I should have known it before…
$ pip freeze > requirements.txt
Better method: use pipreqs
$ pipreqs /path/
My iMac disk space is also used up. Moved the mysql data file (/usr/local/mysql/data) to external hard drive (/Volumes/diskname/MysqlData/data)
- close mysql server
- sudo cp -R /usr/local/mysql/data /Volumes/diskname/MysqlData/.
- In /usr/local/mysql/my.cnf, add “datadir = /Volumes/diskname/MysqlData/data”
- restart mysql server
The drawback is there will be no TimeMachine backup for this database…
update 1: It seems I can make an alias for the /Volumes/diskname/MysqlData/data and drag the alias into my iMac disk. The timemachine will backup this directory.
update 2: Another way to backup directory on external HDD is to remove the directory on TM’s exclusion list. I will use this method for now.
Mac doesn’t read ~/.bashrc file when a shell starts. The order of files the shell read is (reference: http://hayne.net/MacDev/Notes/unixFAQ.html#shellStartup)
- ~/.bash_profile or ~/.bash_login or ~/.profile (only one of these files will be read, if it exists. If more than one file exist, it will only read the first existing one by the above order)
So one way to make Mac work with ~/.bashrc is to add the line