Worked on an odoo setup in saltstack in September. It runs on Debian and Prostgres both of which I’ve never used before. It’s not difficult to find what you’re looking for if you know the equivalent in it’s respective program. These are my notes on the things I learned. Some of it might not make sense out of context.
Redirect a domain locally
- on local machine (mac) edit
sudo nano /etc/hosts
- add the the domain name(s) to the localhost ip
|
|
nginx Proxy:
In the nginx conf:
|
|
Postgres commands
|
|
Debian:
To install a deb file, put .deb
files /var/cache/apt/archives/
and install with sudo dpkg -i /path/to.deb
.
Add a daemon:
http://blog.terminal.com/using-daemon-to-daemonize-your-programs/
See if daemon is running:
ps -ef | grep odoo
Terminate daemon:
sudo kill <pid>
Add the service:
sudo vi /etc/init.d/<service_name>
(use template)
test using sudo /etc/init.d/<service_name> start
sudo update-rc.d <service_name> defaults
(to add to list of services)
test using sudo <service_name> start
Sublime text:
Select a word and replace in the entire page:
- [Command+D]x2+
- Start typing, it should replace
- Esc when finished
Salt-stack custom states:
- write python file that will evaluate or do something and return a true or false value.
- The filename of the state is the state name. The def function is the function name.
- It can be called:
|
|
or can be used in an unless/onlyif
|
|
- salt-call –local saltutil.sync_all (includes it in the stack when debugging)