Prevent Raspberry from blanking (console) - raspberry-pi

Is there any way to prevent the rasberry console from getiing black after a while?
I use only the console without any GUI. I already tried the following, but it didnt work at all :(
/etc/kbd/config
BLANK_TIME=0
POWERDOWN_TIME=0
Would be very greatful for any hints

Type this...
sudo sh -c "TERM=linux setterm -blank 0 >/dev/tty0"
Add this line to the bottom of your ~/.bashrc file to have the blank screen disabled on boot.

Related

How can I Launching vscode from command line in background?

I'm using shell on linux.
I would like the a way that will launch vscode in the background such that my terminal is still in focus.
I don't want to show any output on my terminal,perhaps chould show in integrated terminal which inside vscode.
Is someone can help me ?Thank you!
Add an & at the end (see: job control), you probably also want to redirect the output. If you would like to log it, redirect to a file like this &> vscode.log, but if you want to ignore it, &> /dev/null (this is called a null device, see this page for more). So the final command is something like this: code . &> /dev/null &.

On Raspberry Pi - Auto start terminal after login?

I'm working on a small project right now. I want the python script to automatically run after loggin into the GUI.
I followed the steps here: https://www.raspberrypi.org/forums/view ... 91&t=65607
But it didn't work for me. What it did was whenever I open up the terminal, the script will run automatically, but not after loggin into the GUI.
So I figured a easy solution is to configure the system so terminal runs after loggin into GUI.
Any suggestions?
To auto-start the terminal on boot, open this file with nano:
nano ~/.config/lxsession/LXDE-pi/autostart
Add this line to the end of the file:
#lxterminal
Close, save and reboot
Reference and some other goodies to run a script on startup as well which may have been what you are actually looking for:
http://blog.startingelectronics.com/auto-start-a-desktop-application-on-the-rapberry-pi/
When you edit or create autostart file in your user space like
~/.config/lxsession/LXDE-pi/autostart
then, this file will override global lxsession autostart file in
/etc/xdg/lxsession/LXDE-pi/autostart
so you should copy everything from global file to your newly created file.
By this way , after reboot you won't get a blank screen running openbox.
So, your file should contain
#lxpanel --profile LXDE-pi
#pcmanfm --desktop --profile LXDE-pi
#xscreensaver -no-splash
point-rpi
And then add your necessary startup items at the bottom like
#lxterminal
In case you want to launch a terminal and automatically run a script inside it, you can do so by passing the --command parameter to the lxterminal command.
Open the autostart file
sudo nano /etc/xdg/lxsession/LXDE-pi/autostart
Edit the autostart file
Right above the #xscreensaver line, add #lxterminal --command=/path/to/script"
My autostart file looks something like this.
#lxpanel --profile LXDE-pi
#pcmanfm --desktop --profile LXDE-pi
#lxterminal --command="/path/to/script"
#xscreensaver -no-splash
point-rpi
Note: In some places, it is suggested to use the -e flag instead of --command parameter in lxterminal, however that did not work for me. This did.

How to use inkscape command line interface?

I'm trying to use the inkscape command line interface. I have windows 7.
First I open up command line, and I run these:
cd "C:\Program Files\Inkscape-0.48"
inkscape "C:\Users\me\Desktop\Pic\Class_UML.png" --export-png="C:\Users\me\Desktop\Pic\raster.png" --export-area=0:0:100:100
Then the inkscape popup opens, and I click embed, and then click ok, and then nothing happens, and the file doesn't show up.
Does anyone know what I am doing wrong?
Thanks
As of now, there doesn't seem to be a way to do perfect silent processing in Windows. However, any command using inkscape in Windows triggers an empty window while processing in background.
If you don't want it to open separate inkscape windows everytime, try entering the inkscape interactive shell (using inkscape --shell).
PS: I don't think we can do anything more in interactive shell, more than what we can do using cmd. Hopefully someone solves the aforementioned problem in Windows and adds more functionality inside shell.
Have you tried to open the file C:\Users\me\Desktop\Pic\raster.png and see how it looks like?
Supposedly by using --export-png in the command line, inkscape will not open the interface but simply process what you requested silently.
In this case you should have the cropped image should be saved in C:\Users\me\Desktop\Pic\raster.png.
I use Linux and tried your example to test and I get the same behaviour you described plus the response in the command line
Background RRGGBBAA: ffffff00
Area 0:0:100:100 exported to 100 x 100 pixels (90 dpi)
Bitmap saved as: raster.png
Hope it helps
On Windows, in the C:\Program Files\Inkscape\bin folder, you will see both inkscape.exe and inkscape.com. Use inkscape.com.
Here is an example from PowerShell:
> & "C:\Program Files\Inkscape\bin\inkscape.com" --help
#echo off
REM setup Inskcape File Location
cd /d "C:\Program Files\Inkscape"
inkscape path\filename.svg --export-dpi=120 -e exported_image_name.png --without-gui

Emacs 256 colors not working using PuTTY and screen

I'm having trouble getting 256 colors to work using emacs 23.1.1 connecting using PuTTY and screen. Server is running CentOS 5.6.
In my PuTTY config, my terminal-type string is set to xterm-256color. In my .screenrc I have term xterm-256color Once in screen tput colors gives me 256, echo $TERM gives me xterm-256color, but once I start emacs M-x list-colors-display only gives me 8 colors.
Not sure what the problem is.
Thanks.
I hit the same problem.
To fix this problem, just add this to ~/.bashrc (yes,I use bash)
# -----------
export TERM=xterm-256color
export TERMCAP=
# ------------
run screen and emacs in an screen window. it's ok now.
versions:
bash-4.2.45
emacs-24.3_10
Screen version 4.00.03 (FAU) 23-Oct-06
Your ~/.screenrc should read:
term screen-256color
(this shouldn't be mixed up with xterm-256color)
Putty has a setting to allow 256 color mode. It's under Window/Colours, labeled "Allow terminal to use xterm 256-colour mode". Make sure it's checked.
After you load emacs, you can confirm the TERM value emacs is using with:
(assoc 'tty-type (frame-parameters (car (frame-list))))
It should be (tty-type . "xterm-256color").
Looking at your post and your responses to others, it sounds like your problem is... screen. To test my hypothesis, try this ...
$ wget http://www.frexx.de/xterm-256-notes/data/256colors2.pl
$ chmod 755 256colors2.pl
$ ./256colors2.pl
... if you see 256 colors in the shell, but not in screen, the problem is screen. And, even if there are other problems, you are going to have to fix screen in order to have any hope of seeing 256 colors in emacs ;)
I recently fixed this situation for myself on a system where I don't have sudo by building a personal copy of screen. Screen is small and it is no big deal to do ... and, IMHO, emacs w/256 colors is well worth the bother.
On Linux 2.6.x I did this:
$ wget ftp://ftp.gnu.org/gnu/screen/screen-4.0.3.tar.gz
$ tar -xf screen-4.0.3.tar.gz
$ cd screen-4.0.3
$ ./configure --prefix=$HOME --enable-colors256
$ make
$ make install
Test the new screen out with ...
$ ~/bin/screen
$ ./256colors2.pl
... if it works, put this in your ~/.bashrc:
PATH=~/bin:$PATH ; export PATH
The screen I ended up with reports being an earlier version ...
$ ~/bin/screen -v
Screen version 4.01.00devel (GNUdf0777e) 2-May-06
... than the version on my system:
$ /usr/local/bin/screen -v
Screen version 4.00.03 (FAU) 23-Oct-06
But while they both claim to support 256 colors...
$ tput colors
256
Only the new build really does. Yeah!
I had similar difficulties, I believe both of these lines were required for screen, putty, and emacs to get along with 256 colors.
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
term xterm-256color
You may also need this line too.
defbce "on"
Speak up if that's still not enough.
Try using emacs in daemon mode instead (emacs --daemon), and open emacsclients (emacsclient -t) instead of using screen/tmux. This will give you one less variable to handle in debugging this.
I was having a similar problem with putty and screen, though not using emacs. Following ataylor's response, I went to Window/Colours in Putty. In there I found and checked 'Use system colours'. This fixed my issue.

How can I start X11 window with no display associated

I'd like to start Firefox for example with no display associated and eventually take a screenshot with import.
Can I in fact make it periodically with cronjobs?
I'm now making a ssh -X connection, take the xwininfo for the window started in background and everything's OK. But I'd like to automate it.
You could start Firefox inside Xvfb.
If you gave Xvfb its -fbdir option then you would also have the option to take your screenshot from the Xvfb framebuffer file. You would probably want to specify the same geometry for Xvfb and Firefox.
How about starting firefox inside a vncserver?
You can capture the value for $DISPLAY using grep
e.g.
export DISPLAY=`vncserver 2>&1 | egrep --only-matching ":[0-9]+" | head -n1`