Clicking on terminal icon, not opening and on Ctrl +Alt + T also same problem occurs
In some cases when you upgrade python3.5 to python3.6 problems occurs
For that open a virtual terminal
by pressing Ctrl+ Alt + F1
then enter login details as username and password
then run two commands
sudo rm /usr/bin/python3
sudo ln -s python3.5 /usr/bin/python3
then close the session with Ctrl+ D and exit the virtual terminal by Ctrl+ Alt + F7
Related
I am puttying into my Centos 7 terminal on Windows 10. I would like to be able to open and edit the Linux files using sublime text rather than having to edit right in the terminal. Any thoughts on how to do this?
Get a copy of the Windows apps -- "WinSCP" (for SFTP and use as a remote filemanager, etc. and includes putty), and "Notepad Plus Plus" (Notepad++) ... easy way to edit files on remote server. All are free downloads.
I personally like nano, its really easy to use
nano /path/to/file.c
ctrl + x to exit, ctrl+o to output the file with a y/n save prompt
If you want to use sublime, do the following
$> wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -
$> echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
$> sudo apt-get update
$> sudo apt-get install sublime-text
Then this line will show you the sublime help options
$> subl -h
Assuming this:
$> subl /path/to/file.txt
I am using my laptop's screen, keyboard and mouse for using raspberry pi 3 by using putty. but putty doesn't connect till I run 'sudo service ssh restart' command from terminal for which at least a keyboard is required which kinda defies the purpose. Is there any way to solve this or maybe I could put that command somewhere in the s card which has the os so that the command runs automatically at startup?
If you can't connect an keyboard try this, mount the SD card in another system and create symbolink links like this:
sudo ln -s /etc/init.d/ssh /etc/rc2.d/s03ssh
sudo ln -s /etc/init.d/ssh /etc/rc3.d/s03ssh
sudo ln -s /etc/init.d/ssh /etc/rc4.d/s03ssh
sudo ln -s /etc/init.d/ssh /etc/rc5.d/s03ssh
then restart and check the ssh connection
I was trying to install wireshark when I accidentally had to restart my computer. Now I am stucked in a infinite login loop in Ubuntu. I tried to do something from the bash but every time I try to run a sudo command, as sudo su it gets:
-bash: /usr/lib/command-not-found: /usr/non/python3: bad interpreter: permission denied.
I tried to change the permission to that but it does not work.
EDIT:
i solved by entering in recovery mode as root user and sudo chmod 777 /usr/lib/command-not-found and even sudo chmod 777 /usr/bin/python3. I tried everything possible, and i dont even know why it worked.
Try this
sudo dpkg -i python2.7-miminal*.deb
sudo dpkg -i python2.7*.deb
I ran into the same problem when I have added export $PATH="~/bin" as last line in ~/.bash_profile.
I solved it by removing the line after entering into tty2 command line using "ctrl + alt + F3" and all commands like "ls, cd, nano" where available as "/bin/ls, /bin/cd, /bin/nano".
Using command "/bin/nano ~/.bash_profile" I changed the file content and now it's working normally.
I am trying to start browser in Raspberry Pi, on boot. These are the steps I've followed so far:
I have edited the .bashrc file from the root folder using this command:
sudo nano /home/pi/.bashrc
Added the following line at the end the file.
midori -e Fullscreen -a http://www.google.com
I restarted Raspberry Pi.
sudo reboot
It does not open the browser, on boot. How ever if I manually click on Terminal, it opens the browser.
I got a very simple solution of this. At first install midori on your pi.
sudo apt-get install midori
Then add the file that you want to auto start here.
sudo nano /etc/xdg/lxsession/LXDE-pi/autostart
For example you want to open google browser after reboot. Add this line to autostart file.
#midori -e Fullscreen -a http://google.com
Save the file and reboot your Pi. Now the google browser will auto start up every time you reboot.
I got the solution .
In new versions it is not supporting in this autostart file
sudo nano /etc/xdg/lxsession/LXDE/autostart
I changed the code to the below autostart file.
sudo nano /etc/xdg/lxsession/LXDE-pi/autostart
You can use crontab
sudo crontab -e
And add
#reboot command_you_want_to_run &
I solved using autostart of LXDE-pi and a sh file.
I had to install xautomation for simulate an user input
sudo apt-get install xautomation
In the home of pi I've created a sh file
touch start_browser.sh
I've inserted the following code in the file
#!/bin/sh
# running the browser on the main desktop
sudo -u pi epiphany-browser -a --profile ~/.config http://www.google.com/ --display=:0 &
# waits a few seconds, we wait that the browser has started successfully
sleep 15s;
# xautomation simulates the pressure on the F11 key for activate the browser in full screen mode on the main desktop
xte "key F11" -x:0
I added the executable permission on the sh file with chmod command
sudo chmod 755 start_browser.sh
I've modified the autostart files of LXDE-pi session
sudo nano /etc/xdg/lxsession/LXDE-pi/autostart
by adding the following command to run my sh file
#/home/pi/start_browser.sh
Now our browser should be start in full screen mode at each boot
If it does not, check that the Raspberry's configuration had enabled the boot into the desktop environment
sudo raspi-config
Select: 3 Enable Boot to Desktop/Scratch
Select: Desktop Log in as user 'pi' at the graphical desktop
Enjoy
In latest versions of raspberian you have to edit
sudo vi .config/lxsession/LXDE-pi/autostart
for this
#midori -e Fullscreen -a http://google.com
to work..
When a user logins to my Debian server using e.g. Putty, I need to perform the following:
It will automatically execute command screen -r MyWindow, and
the user won't be able to leave the screen window, so I want the user to have disabled all commands.
How can I do that?
You can put your script under /etc/prodile or put your command under .bash_profile of home directory of user
Write your command to/etc/init.d/rc.local,and ln to all rc.X
vi /etc/init.d/rc.local
i
screen -r MyWindow
:wq
ln -sf /etc/init.d/rc.local /etc/init.d/rc.3 (default)