Keep process running after ending ssh session

http://askubuntu.com/questions/8653/how-to-keep-processes-running-after-ending-ssh-session

tmux

tmux attach

ctrl + b
then d
for detach

ctrl + b send it in some mode where it can accept the d for detach command

you can even close the window as it is it keeps on running

#include

#include

int main()
{
while(true)
{

sleep(2);
printf(“I am running \n”);
}
}

Advertisements

Ramer–Douglas–Peucker algorithm

The Ramer–Douglas–Peucker algorithm (RDP) is an algorithm for reducing the number of points in a curve that is approximated by a series of points. The initial form of the algorithm was independently suggested in 1972 by Urs Ramer and 1973 by David Douglas and Thomas Peucker[1] and several others in the following decade.[2] This algorithm is also known under the names Douglas–Peucker algorithm, iterative end-point fit algorithm and split-and-merge algorithm.

The starting curve is an ordered set of points or lines and the distance dimension ε > 0.
The algorithm recursively divides the line. Initially it is given all the points between the first and last point. It automatically marks the first and last point to be kept. It then finds the point that is furthest from the line segment with the first and last points as end points; this point is obviously furthest on the curve from the approximating line segment between the end points. If the point is closer than ε to the line segment then any points not currently marked to be kept can be discarded without the simplified curve being worse than ε.

https://github.com/burningmime/curves

http://stackoverflow.com/questions/5525665/smoothing-a-hand-drawn-curve

qt on ubuntu core

Building Qt for a given device requires a toolchain and a sysroot. Additionally, some devices require vendor-specific adaptation code for EGL and OpenGL ES 2.0 support. This is not relevant for non-accelerated platforms, for example the ones using the LinuxFB plugin, which is meant for software-based rendering only. This means Qt Quick 2 is not functional in such a setup as it depends on OpenGL for rendering.

The directory qtbase/mkspecs/devices contains configuration and graphics adaptation code for a number of devices. For example, the linux-rasp-pi2-g++ mkspec contains build settings such as the optimal compiler and linker flags for the Raspberry Pi 2 device. The mkspec also contains information about either an implementation of the eglfs hooks (vendor-specific adaptation code), or a reference to the suitable eglfs device integration plugin. The device is selected through the configure tool’s -device parameter. The name that follows after this argument must, at least partially, match one of the subdirectories under devices.

There are currently some limitations to note with Qt 5 on the Raspberry Pi 2. Both the xcb and eglfs back ends for Qt are available.

The xcb back end supports widget applications and supports the X11 window manager running on the desktop so Qt-based applications will run in a window, which can be moved or resized. However, the OpenGL implementation on the Raspberry Pi is not compatible with xcb or X11, so applications that use OpenGL will not work with the xcb back end.

The eglfs back end supports widget-based and QML applications, and uses OpenGL, but will run in full screen mode and not be aware of any window manager.

The linuxfb back end, which directly uses the Linux video frame buffer, should also be available and work, although you will probably need to set some environment variables in order for the keyboard and mouse devices to work correctly.

You can select which back end to use at run time using command line options, i.e. “-platform xcb” or “-platform eglfs”. Normally, the default is to use the eglfs back end.

source package list

o summarize, you need to open the /etc/apt/sources.list file with a text editor and then add arch= between deb and the URL for each line. This is the example provided on the page:

xserver on ubuntu core

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install fxlrg
sudo apt-get install xserver-xorg-core
sudo apt-get install xserver-xorg
sudo apt-get install xorg
sudo apt-get install xorg openbox
sudo apt-get install ubuntu-desktop

 

sudo apt-get install xorg
sudo apt-get install openbox

sudo apt-get install xauth

 

 

Basically the Xorg X server needs to be configured to to authorize this user. Where should we configure this?
/etc/X11/Xwrapper.config – This file has as setting called “allowed_users”. It can accept three values:
1. root
2. anybody
3. console
The above values are self explanatory. You can edit this value to set as anybody for normal user to start X server. If normal user starts X server from console, console can also be set. It can be like this.

allowed_users=anybody

In Debian and its derivatives like Ubuntu, you can run the following command to do it in user friendly screen as shown below.

 

 

First check the device info for udev rules
udevadm info -a -p $(udevadm info -q path -n /dev/video0)

 

 

apt-get install nodm

apt-get install lightdm

apt-get install ubuntu-session

 

apt-get install xfce4 xfwm4 xfce4-panel xfce4-settings xfce4-session xfce4-terminal xfdesktop4 xfce4-taskmanager tango-icon-theme

apt-get install lightdm lightdm-gtk-greeter

 

x11 lightdm snaps

lightdm installed on ubuntu core got the greeter screen login screen but not much after that

 

cat /var/log/lightdm/lightdm.log

apt-get install ubuntu-session

 

apt-get install ubuntu-desktop

 

apt-get install gnome-shell ubuntu-gnome-desktop

 

sudo service lightdm restart

For Ubuntu 15.04 and later:

sudo systemctl restart lightdm.service

and for Kubuntu 15.04 and later:

sudo systemctl stop sddm.service

 

snappy and snapcraft is after ubuntu 16.04
nano pi ubuntu core qt embedded is 15.10 so not snappy

Ubuntu core (15.10) but not snappy we do not have snaps here

gparted

shrink and copy

has to be continuous

start
sudo gparted
very good utility

then select your device
/dev/sdb for me

now unmount all it’s partition
after unmount you will see ->| option and O delete option .. use shrink option then move cursor to select only used space for me

there was some unallocated partition in the begning and lot after
I squezed it theh used dd to just copy my useful partition with command

 

fs_resize

 

fdisk -l 

Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 49152 131071 81920 40M 83 Linux
/dev/mmcblk0p2 131072 30701568 30570497 14.6G 83 Linux

see all space on sdcard 

df -h shows less space on root 
fs_resize


http://www.averagemanvsraspberrypi.com/2015/07/average-man-vs-arduino.html

Qt Android development

 

Starting with Qt 5.7, you can create Android services using Qt. A service is a component that runs in background, so, it has no user interface. It is useful to perform long-term operations such as logging GPS, waiting for social media notifications, and so on. A service will continue to run even if the application that started it exits.

To create a service, do the following steps:

Uncomment the service part of your AndroidManifest.xml.
Make sure the service tag contains an android:process=”:some_name” attribute. It is needed to force the service to run in a separate process than the activity.
If you’re using the same application (.so file) for activity and also for service, you need to use android.app.arguments meta-data to pass some arguments to your main function in order to know which one is which.
To enable background running, uncomment android.app.background_running meta-data and set it to true (android:value=”true” ).

Qt loads the .so file defined in android.app.lib_name meta-data, and calls the main function with all the arguments set in android.app.arguments meta-data.

See Android Services documentation for more information.

 

http://doc.qt.io/qt-5/androidservices.html