I have a tmuxinator project some-project.
After using it, I updated it with tmuxinator edit some-project.
Now when I run tmuxinator start some-project, I get the same session layout as before editing some-project.
How can I make tmuxinator use the new project version?
tmux kill-session -t some-project
tmuxinator start some-project
kill the session first using:
tmux kill-session -t some-project
then start the project again using:
tmuxinator start some-project
Related
I want, when my centos 7 server boots, to run
echo 1 > /proc/sys/net/ipv4/tcp_tw_reuse
because I want to reuse open connections.
Systemd is allready installed, but my command is not a service, just a one time execution command at startup.
How can I run automatically this command at startup ? Thanks !
Add your command to
/etc/rc.d/rc.local
and it will run at startup.
The correct way to make the changes persistent is to edit the file:
/etc/sysctl.conf
After the change, type:
sysctl -p
This will load the changes into the current session. The fact that the settings are in /etc/sysctl.conf will ensure that they load on reboots.
Yesterday I tried to delete folders in the cloud shell editor, being impossible to delete.
This morning I have decided to remove all the files from the main directory:
sudo rm -rf $ HOME
Now I click on the button -> Open workspace and it does nothing.
It also does not receive repositories from GitHub.
Any ideas?.
Thank you.
I understand that you deleted all your files from the home folder and now you are unable to use Cloud Shell, please correct me if this is not your situation.
If this is the case you can try to restart your Cloud Shell by pressing in the three dots on the top right corner and select ´Restart´. If this doesn't help you can also try to boot in Safe Mode.
If your problem is selecting a workspace keep in mind that after you used the command ´sudo rm -rf $ HOME´ you most likely deleted your workspace folder that is usually inside of the home dir. You will have to create a new folder and select it as your new workspace in the ´Open Workspace´ menu
Haii everyone
How to start Odoo server automatically when system is ON.
Normally i searched in google i had found a link " http://www.serpentcs.com/serpentcs-odoo-auto-startup-script-322 "
i follow the each and every step and i started the odoo-server
ps -ax | grep python
5202 ? Sl 0:01 python /home/tejaswini/Odoo_workspace/workspace_8/odoo8/openerp-server --config /etc/odoo-server.conf --logfile /var/log/odoo-server.log
it is showing the server path also
but when i run 0.0.0.0:8069/localhost:8069 in browser it is running
shows This site can’t be reached
please any one help me
Thanks in advance
To start a service automatically when the system turns on, you need to put that service into init script. Try below command
sudo update-rc.d <service_name> defaults
In your case,
sudo update-rc.d odoo-server defaults
Hope it will help you.
For the final step we need to install a script which will be used to start-up and shut down the server automatically and also run the application as the correct user. There is a script you can use in /opt/odoo/debian/init but this will need a few small modifications to work with the system installed the way I have described above. here is the link
Similar to the configuration file, you need to either copy it or paste the contents of this script to a file in /etc/init.d/ and call it odoo-server. Once it is in the right place you will need to make it executable and owned by root:
sudo chmod 755 /etc/init.d/odoo-server
sudo chown root: /etc/init.d/odoo-server
In the configuration file there’s an entry for the server’s log file. We need to create that directory first so that the server has somewhere to log to and also we must make it writeable by the openerp user:
sudo mkdir /var/log/odoo
sudo chown odoo:root /var/log/odoo
reference
I am developing a software in Qt in which I created a terminal. I run different commands through QProcess in that but when I run root commands it ask for password in terminal. I tried to run via sudo but it only accepts password in terminal. Is there any way to give password from another source like pop up widget or a text file?
I have created a QProcess with "bash" as program.
Then just write to it:
echo mypassword | sudo -S ifconfig eth0 192.168.1.123\n
You could try
Running your application as root (which is really a very bad idea, actually!)
Edit sudoers file and add the commands you want to run to this file. Then you can run these commands like sudo run_x_cmd with no password i.e, your QProcess can run these commands and you won't be asked for password.
Adding a password to a text file in order to source input for the command is a very bad idea, as it weakens security.
Version 1.8 of sudo provides a plugin architecture, which would allow you to link to it from your application and may provide a solution for you.
The SDK for the sudo plugin API can be found in the documentation .
I know how to run commands with PyCharm (Tools -> Run manage.py Task), but I would like to debug them also, including my commands and third party app's commands.
You can debug a custom Django admin/management command in PyCharm by creating a custom Django server entry on the Run/Debug Configuration menu:
Click Edit Configurations....
Click the plus sign and choose Django server.
Fill in the Name as you please, clear the Host and Port fields,
check Custom run command and enter the name of your command to the
right of the checkbox.
Enter any extra command-line arguments into the separate field Additional options, not appended in the run command.
Click OK.
Now set a breakpoint, choose your new configuration from the Run/Debug Configuration menu and click the Debug button. Et voilà!
Since clearing Host and Port will not make the command run at all (PyCharm 5), the solution I found is to use a Python run configuration instead of a Django server. Fill Script with your manage.py script, other parameters in Script Parameters, and adjust your environment such as Working directory.
I am explaining using my following custom Django command:
python manage.py execute_algorithm -f input_data.json
Steps to configure Django Command:
Step: From Django toolbar go to:
Run > Edit Configurations
Click on the '+' icon at top left, to create new command >
select 'Django server' from the drop down.
Fill following details:
Name: any suitable name that you want to give to this config e.g. execute_algorithm_command
Host: Clear the field
Port: It's 8000 by default, clear it.
Custom Run Command: Check this box fist.
Provide your command name there. You can get that from apps/module/management/command/execute_algorithm.
e.g value: execute_algorithm
Additional options: Whatever is there, after you command name. value is: -f input_data.json