Search This Blog

04 January, 2022

tmux enabling mouse interaction

Add the below line to the ~/.tmux.conf

setw -g mouse on

save the file and exit from the tmux shell, you should be able to use your mouse to resize the windows


10 August, 2021

tmux saving the scrollback content to a file

Follow as below, i tried this in Ubuntu 18.04 LTS

All commands to be execute without quotes 

1) Use "prefix + :"

2) Type "capture-pane -S -5000 + Return"

Replace -5000 with the number of lines you'd like to save, or with - for all lines. This copies those lines into a buffer.

3) To save the buffer to a file, type "prefix + :"

4) Type in "save-buffer filename.txt + return".

By default Prefix is Ctrl+B for tmux

22 August, 2020

How to enable Remote Desktop in Ubuntu

Below tested on Ubuntu 18.04

 

Refer the Screenshot, by default Ubuntu uses vino-server

 

1) Click on Ubuntu Settings

2) Click on Sharing

3) Click on the screen sharing

4) turn on the screen sharing button on the pop up window

5) set the options as shown above, set a password for the connection

6) disable encryption

 sudo gsettings set org.gnome.Vino require-encryption false



13 June, 2020

Ubuntu 18.04 running script at boot

Ubuntu 18 is using systemd, and there are three things we need to do 

1) Create a service file and put it in /etc/systemd/system/
  let say the file be board-init.service, with the below content


[Unit]
Description=Board initializations
DefaultDependencies=no

[Service]
Type=oneshot
ExecStart=/etc/board-init.sh

[Install]
WantedBy=sysinit.target

2) create your board-init.sh script file, and put it in /etc/

3) Create a soft link in the /etc/systemd/system/sysinit.target.wants to the service file w created

cd /etc/systemd/system/sysinit.target.wants
ln -s /etc/systemd/system/board-init.service board-init.service

reboot the board. To see the output of the script type 

journalctl -u board-init -b

13 September, 2019

dinomycle vimrc file

"show status bar
set laststatus=2

"Highlight search
set hlsearch


"Turning off expandtab in VIM for editing makefile
let _curfile = expand("%:t")
if _curfile =~ "Makefile" || _curfile =~ "makefile" || _curfile =~ ".*\.mk"
set noexpandtab
else
set expandtab
set tabstop=4
set shiftwidth=4
endif


"showing all opened files in vim
map <F4> :ls<CR>:buffer<space>

"showing the status bar with extra info
set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [ASCII=\%03.3b]\ [HEX=\%02.2B]\ [POS=%04l,%04v][%p%%]\ [LEN=%L]
set background=dark
set autoindent


13 March, 2019

04 February, 2018

Oracle Virtual Machine Creating Shared Folder and its Permission in Ubuntu guest

Explaining the Steps for sharing a folder on Oracle VM with Windows Host and Ubuntu Guest

VirtualBox’s Shared Folders feature works with both Windows and Linux guest operating systems.
Steps to follow to do this is as follows



1) Install VirtualBox’s Guest Additions in the guest virtual machine.
After the guest os(Ubuntu) is booted,
click the “Devices” menu and choose the
“Insert Guest Additions CD image” option.
This inserts a virtual CD that you can use within the guest operating system to install the Guest Additions.

2) we need to reboot the VM Guest

3) Creating a shared folder
from the menu

Devices -> Shared Folder -> Shared Folder Settings

Select a folder to be shared between Windows and Ubuntu
Reboot the VM

4) Now we should be able to see the shared folder in /media/sf_*****

5) Setting Permission

 But now when you click using browser or change directory you will see permission issue. For this we need to run the below command in terminal

sudo adduser <your_user_name> vboxsf

or

sudo adduser `whoami` vboxsf

Logout the current user and login again or reboot the Ubuntu guest, After logging in you will be to access the shared folder from the Ubuntu

04 January, 2018

Using adb shell for dialing and receiving calls in android

You have to enable the Developer Options and also the USB debugging
We can use adb to trigger a call, receive incoming call, see the below adb commands
For dialing a call using activity manager adb shell am start -a android.intent.action.CALL -d tel:123456789
accept/receiving an incoming call: adb shell input keyevent 5
hang up/stop phone call: adb shell input keyevent 6

20 December, 2016

Mysql Uninstall from Ubuntu 16.04

Follow the steps

1) sudo apt-get remove dbconfig-mysql
2) sudo apt-get remove --purge mysql-server mysql-client mysql-common

06 December, 2016

iperf3 compilation for ARM in Ubuntu

For compiling for ARM target board

Get the cross compiler details and pass it as argument to the configure script. I used iperf-3.1.3
Below method is for building iperf3 as static, so that we need to push only the iperf3 binary , without any shared libraries

First this assumes you had set the ARM compiler in the path

cd iperf-3.1.3/

1) ./configure --host=arm-linux-gnueabi CC=arm-linux-gnueabi-gcc CXX=arm-linux-gnueabi-g++ CFLAGS=-static CXXFLAGS=-static --enable-static --prefix=`pwd`/output

2) make install


the binary will be available inside output/bin/

22 September, 2016

Increasing the linux terminal console column width and number of rows

very useful tip for embedded Linux engineers and those who work with Linux Console using minicom or teraterm


very useful tip for embedded Linux engineers and those who work with Linux Console using minicom or teraterm

normally if we type ps in serial console, it will show the process , if the length is more than 80 character(which is default) we cannot see the string after 80 characters in the consol,

with the below command you can adjust the width of the terminal with cols argument and number of rows using the  argument rows to the command stty

stty cols 160 rows 40

this can be used separate also
stty cols 160
stty rows 50

Hope this help in ps and htop command when u run and other applications


02 September, 2016

accessing serial port in linux/ubuntu as a normal user

For accessing serial port in linux/ubuntu as a normal user,
we need to add the user to the dialout group
follow the below commands 
 
sudo adduser second_user dialout
or 
sudo adduser `whoami` dialout 


28 August, 2016

Linux File Permission in octal format in terminal or command line

To see the file permission in Linux terminal use the below command

stat -c "%a %n" *

* = will list and show all files , replace with the fie name if you want to know only for one filename

16 August, 2016

virtual machine shared folder permission


When using Ubuntu on Virtual Box, you can share a folder between Windows Hosta and Ubunut Guest, after doing the sharing, you need to set the permission so that it can be accessed using the normal user login



You need to type the followinf command to add the permission for the normal user to access it

sudo usermod -aG vboxsf <youruser_name>

or

sudo usermod -aG vboxsf `whoami`


Wi-Fi command line commands

Wi-Fi(IEEE 802.11) command line useful commands

Wi-Fi AP Mode
1) Scan the network

iw dev wlan0 scan or
iw dev wlan0 scan ap-force


2) Connected Devices to the Wi-Fi Access Point (wifi AP mode)

Using hostapd cli:  hostapd_cli all_sta
using iw: iw dev wlan0 station dump


Wi-Fi Station/Client Mode

1) To Scan network

iw dev wlan0 scan 

to show only the SSID from the ouput
iw dev wlan0 scan | grep SSID






using ctag with PHP


ctags-exuberant -f php.tags --languages=PHP -R



23 July, 2016

ubuntu showing menu always

15.04 and baove has the ability to toggle the global menu as well as the local integrated menus (Via System Settings - Appearance - Behaviour tab) to be permanently on or off.

If you are running a fully up-to-date version of 14.04, this same ability has been backported.

To switch on permanently:

gsettings set com.canonical.Unity always-show-menus true

To switch off i.e. to autohide:

gsettings set com.canonical.Unity always-show-menus false

24 June, 2016

Highlighting or making prominent the active Terminal tab in Ubuntu Linux

For highlighting or making prominent the active tab of the Terminal in Ubuntu Linux

 create a file named ~/.config/gtk-3.0/gtk.css

and paste the below content, You can change the color as you want. Hope this helps


TerminalWindow .notebook tab:active {
    background-color: #b0c0f0;
}


31 March, 2016

git drop all local changes and commit and sync to remote server

There are times while working with git, you want to drop all your local changes and commit and sync the files to be same as the git server. The steps to follow are
1) fetch the latest history from the server
2) pointing your local master branch at it like this

git fetch origin
git reset --hard origin/master

if you want to do this for a branch, change the master with the branch name

18 February, 2016

Android Showing IP address and Route Table

For checking the IP address and Routing Table in Android using command line mode in the linux console is below. For this you need to root the device or it should be engineering build which engineers use for development.

To Show IP Address, MAC address and Interface Status
Type  netcfg  or ip addr

To See The Routing Table
cat /proc/net/route   OR   ip route show

To show DNS IP Addresss
getprop net.dns1
getprop net.dns2

net.dns1 for the Primary DNS and net.dns2 for the Secondary DNS

For changing the DNS IP Address:
setprop net.dns1 111.111.111.111
setprop net.dns2 222.222.222.222




tmux enabling mouse interaction

Add the below line to the ~/.tmux.conf setw -g mouse on save the file and exit from the tmux shell, you should be able to use your mouse to ...