Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Wednesday, September 18, 2019

Linux / Mac : Get latest of chromeDriver

Linux / Mac : Get latest of chromeDriver



LINUX
currdir=$(pwd)/misc
latest_version=$(wget https://chromedriver.storage.googleapis.com/LATEST_RELEASE -O -) && wget https://chromedriver.storage.googleapis.com/${latest_version}/chromedriver_linux64.zip -P $currdir
unzip -q $(pwd)/misc/chromedriver_mac64.zip && /bin/rm $(pwd)/misc/chromedriver_linux64.zip


MAC
#mac make sure "wget" is installed
#brew install wget
currdir=$(pwd)/misc
latest_version=$(wget https://chromedriver.storage.googleapis.com/LATEST_RELEASE -O -) && wget https://chromedriver.storage.googleapis.com/${latest_version}/chromedriver_mac64.zip -P $currdir
unzip -q $(pwd)/misc/chromedriver_mac64.zip && /bin/rm $(pwd)/misc/chromedriver_mac64.zip

Saturday, February 24, 2018

Linux : Access Linux machine using Android

To Connect linux (debian) with Android

1. Linux - sudo apt-get install openssh-client  (remember if u want to access a system then should run client server)
2. Linux - sudo service ssh start
3. Linux -sudo service ssh status
4. Find ip address of the using - sudo ifconfig
(find ip address - usually eth0 in 1st para , for rasp pi search for something like 192.168.1.34 or something like that)
5. Now in Linux
addnew user : sudo useradd -m deepak -G sudo
add password : sudo passwd fred

6. In Android install termux app
7. Open termux  run command - apt install openssh

8. optional(https://linuxconfig.org/ssh-into-linux-your-computer-from-android-with-termux
ssh-keygen -b 4096 -t rsa
ssh-copy-id -i ~/.ssh/id_rsa.pub username@192.168.1.1 )

9. ssh deepak@raspberry_ip
ex:ssh deepak"192.168.1.34

Correct way to install tar ball in Linux

Correct way to install tar ball in Linux :

Example : User installing rar application in Linux machine


method 1 :
sudo apt-get install rar
or
sudo yum install unrar

Method 2:
cd /tmp
wget https://www.rarlab.com/rar/rarlinux-5.5.0.tar.gz
tar -zxvf rarlinux-*.tar.gz
./unrar
sudo cp rar unrar /usr/local/bin

--------Clean UP-------
sudo apt-get autoclean
sudo apt-get clean
sudo apt-get autoremove
--------------------------

Tuesday, July 4, 2017

Create and Run Python Script in Linux Command Line

Create and Run Python Script in Linux Command Line


create python script in linux
  1.  cd scratch
  2. mkdir new_folder
  3. cd new_folder
  4. touch test.py
  5. vi test.py
  6. Press "i"  - this will open the file in edit mode
  7. Enter below lines :
    #! /usr/bin/python
    print('Hello, world!')
  8.  Press "esc"
  9. type ":wq!" without quotes
  10. chmod a+x test.py
  11. ./test.py