CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

How to turn the system on, connect the net, and run a software automatically

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 21, 2020, 09:02
Default How to turn the system on, connect the net, and run a software automatically
  #1
Senior Member
 
A. Min
Join Date: Mar 2015
Posts: 308
Rep Power: 12
alimea is on a distinguished road
Hi all,

You may want to work with your office system from another place, for instance from your house. It is a common event that your internet, or VPN gets disconnect, or the electricity becomes disconnected, because of some problems, and you cannot work with the system anymore, even sb turns it on, and connect the net.

I summarized what I found in some Ubuntu web pages, to turning the system, and connecting the VPN, automatically.

1- How to reconnect VPN automatically in Ubuntu [1]
Right this bash script in a text file and save it:

Code:
while [ "true" ]
do
	VPNCON=$(nmcli con status)
	if [[ $VPNCON != *MyVPNConnectionName* ]]; then
		echo "Disconnected, trying to reconnect..."
		(sleep 1s && nmcli con up uuid df648abc-d8f7-4ce4-bdd6-3e12cdf0f494)
	else
		echo "Already connected !"
	fi
	sleep 30
done
Where:
MyVPNConnectionName is the name of your VPN connection in the Network Manager applet
df648abc-d8f7-4ce4-bdd6-3e12cdf0f494 is the uuid of your VPN connection. You can find it using the following command:
Code:
nmcli con
Save this script in your user personal directory, for example.
Do not forget to make this script executable by running the following command:

Code:
chmod +x /path/to/my/script/my_script
How to run this script automatically when a user has logged in?
It’s very easy. Just append the following line to your .profile (in the root of your user directory):

/path/to/your/script/my_script &

In some distributions, it may be the .bashrc file. In Debian it’s .profile (it doesn’t work as expected with .bashrc). Just choose what works for you.

Finally, save your changes, logout from your session, and login again. The script should be automatically started, and your VPN should connect immediately. Hurray!

2- How to open terminal (or any other app) automatically after log in [2]
Press the Super key (windows key).
Type "Startup Applications"
Click on the Startup Applications option
Click "Add"
In the "name" field, type Terminal
In the "command" field, type gnome-terminal
Click "Add"


3- How to disable keyring in Ubuntu? [3]
Option 1: Disable Automatic Login
If you don’t have auto-login activated, the keyring is unlocked when you log in to your user account. Therefore, the system authenticates that you are the user and bypasses keyring prompt when you launch Chrome.

Option 2: Make Keyring password Blank

Step 1) Launch ‘Terminal’ and enter the following command. Elementary OS users may need to first enable PPA before attempting the below command. Ubuntu 17.10 comes with seahorse pre-installed, so you may see output that “seahorse is already the newest version…’.
sudo apt-get install seahorse
Step 2) After the installation is complete, launch “seahorse” from programs.
Step 3) Right-click on “Login” and select “Change Password”.
Step 4) Enter the old password when you see the pop-up. Then leave the new password field blank. Don’t enter even space. Click ‘Continue’.
Step 5) You should see an obvious warning pop-up that passwords will be unencrypted. Click ‘Continue’.
That’s it! Restart your computer for the setting to take effect. Next time you launch Chrome or Chromium browser, you should not see keyring request.

4- How to turn the system on automatically, after suddenly turning off?
Restart your system
Press F2, or F8, or Del to open the BIOS settings.
In the Advanced section, find APM
Make “Restore” on

-------------------------------------------------------------------
References:

[1] https://www.gabsoftware.com/tips/aut...-vpn-on-linux/
[2] https://askubuntu.com/questions/3085...minal-on-login.
[3] https://www.fosslinux.com/2561/how-t...linux-mint.htm
alimea is offline   Reply With Quote

Reply

Tags
internet, openfoam, ubuntu, vpn


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 04:42.