Notes on Linux

Autostart scripts on LXDE (Lightweight X11 Desktop Environment) on RPi:

 /etc/xdg/lxsession/LXDE/autostart   #edit the textfile 

Automatically run commands or programs on booting, edit this file:


Emulate keyboard and mouse input on X11:

 sudo xdotool key F5  #press F5 

Get current date and time from Google:

 sudo date -s "$(wget -S "" 2>&1 | grep -E '^[[:space:]]*[dD]ate:' | sed 's/^[[:space:]]*[dD]ate:[[:space:]]*//' | head -1l | awk '{print $1, $3, $2, $5 ,"GMT", $4 }' | sed 's/,//')" 

Keyboard input to exit from X-desktop:


Run process in background with ‘&’ command:

 job & 

Change keyboard layout to US:

sudo nano /etc/default/keyboard
- change XKBLAYOUT="us"
- reboot 

Proxy setting:

sudo nano /etc/profile #edit this text file
add these lines:
export http_proxy=
export no_proxy="localhost," 

Listing available cameras:

v4l2-ctl --list-devices

Error on Processing -> No such Gstreamer factory: v4l2src

sudo apt-get install gstreamer0.10-plugins-good 

Settings related to DHCP server on Ubuntu 16.04:

sudo apt-get install isc-dhcp-server
edit /etc/default/isc-dhcp-server
edit /etc/dhcp/dhcpd.conf
sudo systemctl restart isc-dhcp-server
sudo systemctl status isc-dhcp-server
cat /var/lib/dhcp/

Network traffic monitor in command line interface

sudo bmon -p interface_name