On Tizen's wearable emulator, how can one change the date and time of the watch (Gear S2 for me)? I cannot seem to find anywhere to do so. I even went into the shell and issued "date" command yet permission denied.
From sdb shell you can change date/time in root mode only.
Once the emulator is started. Right click on the emulator and select 'Shell' from the option which will open the sdb shell in user($) mode. Please run su command to go to root(#) mode. Then run below command on the shell to change the date/time
date --set="3 JAN 2016 18:00:00"
Related
For some weird reason, this two errors started occurring on ssh connection initiation:
-bash: id: command not found
-bash: [: : integer expression expected
I'm not sure how those errors affect me, but in the last few days my VNC connection to raspberry pi also stopped working (I can see the login screen in the VNC viewer, but after i put my credentials, the screen turns black for a moment and then returns to the same login screen which I'm stuck on...)
I've tried updating my pi version through ssh and use some other commands I've found online, but nothing worked. Any idea how to solve those problems?
It looks like something is trying to load on login.
The places to check are as follows:
~/.bashrc
~/.bash_profile
~/.profile
~/.profile gets ran each time you login to the shell and the others run when running the bash shell.
By the looks of it something is trying to run the command id and as its not installed it's not running.
A quick test to see if this is in any of your files would to run grep in your home area.
# Change to your home area
cd ~/
# Recursively search for a string matching "id"
grep -rsi "id" .
This could explain why VNC is not working, as when you try to login to VNC it tries to load your config from those files and if they error VNC might not launch.
I've been searching on net but no proper solution for the moment.
Raspberry Pi: Launch Python Script on Startup
This guide tells the way to lauch a python on startup.
The key of this guide is the following crontab command:
#reboot sh /home/pi/bbt/launcher.sh >/home/pi/logs/cronlog 2>&1
I tried it.It works well only when there is NO operation to open a web or any other display within the python script.
If I want to lanuch a webbrowser using python,this crontab does not work well.
I checked the log and it says:
xhost: unable to open display ":0.0"
no protocol specified
test.py :cannot connect to X server :0.0
So this is a DISPLAY problem.
This is my shell(named laucher.sh) ,mainly used to lauch python:
#!/bin/bash
xhost +local:root
export DISPLAY=:0.0
python /home/pi/test.py
Anyone knows about this DISPLAY problem? Please help....
Thanks a lot!
Sincerely,Helen
I think crontab is not a very useful way to open a DISPLAY on startup because when you open a DISPLAY it requires X server.AND you don't know whether X sever is enabled before the command "#reboot" running or after it running during the process of booting.
I solved this problem by doing the following configuration.
1.Enter these command in terminal:
sudo cd ~./config/lxsession/LXDE-pi
sudo nano autostart
2.Add one command in autostart:
#python /home/pi/test.py
For this example I'm opening a python program that will open a display on startup.
you may replace the above code with any application that opens a display.There might be some slight difference with the grammar but this whole thing is like a conception proving this is also a possible way.
I use Archlinux 32-bit on an old Lenovo X60 Thinkpad. It works great but I have a problem with tmux: Whenever I try to launch tmux as a normal user in st-terminal or in xfce4-terminal (or I guess in other terminal emulators too) I get the following error:
setterm: terminal screen does not support --blength
/usr/lib/xorg-server/Xorg.wrap: Only console users are allowed to run the X server
After that message there is no way to input any commands and a few seconds later tmux stops. I use tmux inside a terminal emulator that is launched in i3wm inside an xserver.
The strange thing is that if I start tmux as root user (sudo tmux) I only get the setterm-error but after that I can use tmux as normal. So I guess that something in my xorg config is damaged but I can't figure out what. So does anyone has an idea?
I am trying to connect to a server via ssh. Once connected, terminal should be cleared.
Due to generated keys, I can connect to the server via ssh usr#svr without being prompted a password. This works.
In order to get rid off
The programs included with the Debian GNU/Linux system are free
software; the exact distribution terms for each program are described
in the individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
I would usually just type clear. However, I would prefer not to type this every time but automate the procedure instead.
ssh usr#svr "clear" --> "TERM environment variable not set.". I googled several solutions about unset environment variables, but without success.
So instead, I tried ssh -t usr#vr "clear"; this successfully clears the terminal, but also closes the connection right away ("Connection to IP closed."). Computer connects to server, clears the screen, closes the connection.
Next attempt was to create a bash script on the server to be run after connecting to it.
#/bin/bash
clear
## cl.sh, chmod +x
ssh usr#svr ./cl.sh --> "TERM environment variable not set.".
Another attempt was to create a bash script connecting to the server and clearing the terminal via ENDSSH.
#/bin/bash
ssh usr#svr <<'ENDSSH'
clear
ENDSSH
## sc.sh, chmod +x
Running this results in:
> ./sc.sh
Pseudo-terminal will not be allocated because stdin is not a terminal.
Linux raspberrypi 3.18.7-v7+ #755 SMP PREEMPT Thu Feb 12 17:20:48 GMT 2015 armv7l
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
TERM environment variable not set.
I am a beginner at this, so please be patient if I have made a very obvious mistake. I tried to be as detailed as possible and researched this before posting, but could not find an answer to my question. For example, commands other than "clear" work (ssh usr#svr ls), but that does not help me.
I have found another easy solution
ssh -t usr#svr 'clear;bash'
The text your question refers to is part of the message-of-the-day (MOTD).
If you can become root on the server, you can just modify that message in /etc/motd. Note that depending on the server's distribution, this file will usually be generated somehow (overwriting any changes), e.g. on Debian it is generated from /etc/motd.tail at boot, so you might have to change that file instead.
See manpage motd(5).
To prevent that message from being printed you can create a file named .hushlogin in your home directory (on the server). SSH to the server and run the command touch ~/.hushlogin. If that file exists then the login shell will no longer print the motd (message of the day) which is what you are seeing.
All startup messages are defined in motd file (/etc/motd).
However if you'd like to having your console cleared to increase privacy, add the following code:
[ -x /usr/bin/clear_console ] && /usr/bin/clear_console -q
Either to your .bash_profile or .bash_logout (on logout). Or by using clear command.
Clearing screen on logout is the default behaviour on Debian Linux distribution.
I'm trying to ssh into the server. I enter my password (which is accepted) and then it takes me into this:
using username "####".
##hostname## password: ##This is correct
Last lgin: Sun Feb 10 11:47:27 2013 from ####
-bash-3.2$
How do I quit out of bash? I've tried logout and exit and both of them quit out of Putty. When I open Putty again and login it takes me right to -bash-3.2$ again. Thanks.
What you are seing is the prompt, meaning the way the server let's you interconnect with it.
If you want to "navigate" through the server, you will have to use commands like cd (change directory), ls (list), cp (copy) and so on. Try for example to type pwd and you will see the current directory in which you are (pwd stands for print working directory).
There are millions of tutorials of this, google it to find someone. I for example found this one: http://www.gamexe.net/other/beginner-guide-ssh/