Homepage
About membership
Sign inGet started
Homepage

Madhav

Madhav
4 Following2 Followers
  • Profile
  • Latest
Latest
Go to the profile of Madhav
Madhav
Dec 13, 2016

Expect script to login to remote server

#!/usr/bin/expect
set timeout 20
set ip [lindex $argv 0]
set user admin
set password admin #update password here
spawn ssh "$user@$ip"
expect "yes/no" {
send "yes\r"
expect "*?assword*" { send "$password\r" }
} "*?assword*" { send "$password\r" }
expect "*"
interact
Go to the profile of Madhav
Madhav
Dec 13, 2016

SED one liners

Replace all tabs in a file with space

#Replace all tabs in a file with 4 space(s)
sed -i 's/\t/ /g' temp.txt
#Add a string to start of every line in a file
sed -i 's/^/String/g' temp.txt
#Replace a string1 with string2…
Read more…
Go to the profile of Madhav
Madhav
Dec 9, 2016

error: expected specifier-qualifier-list before ‘uint8_t’

To fix the above compiler error, include <stdint.h>