LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Blogs
User Name
Password

Notices


Old

MULTI ethernet bonding

Posted 04-05-2020 at 05:23 PM by karanis
Tags net

# /etc/rc.d/rc.inet1.conf HAS 2 if enabled at boot
# eth0: no DNS, no static IP , eth1: no DNS, no static IP

/sbin/ifconfig eth0 down
/sbin/ifconfig eth1 down
/sbin/modprobe bonding mode=0 miimon=100

/usr/sbin/ip addr add 192.168.2.IP/24 dev bond0

/usr/sbin/ip link set bond0 up
/usr/sbin/ip link set eth0 master bond0
/usr/sbin/ip link set eth1 master bond0

/sbin/route add default gw 192.168.2.1
...
LQ Newbie
Posted in Uncategorized
Views 249 Comments 0 karanis is offline
Old

Connection speed between 2 linux

Posted 04-05-2020 at 05:22 PM by karanis
Tags net

https://askubuntu.com/questions/7976...ween-two-boxes

Type 1 : (nc and dd)
Server# nc -vvlnp 12345 >/dev/null
Client# dd if=/dev/zero bs=1M count=1K | nc -vvn 10.10.0.2 12345

Type 2 : (iperf)
Server# iperf -s
Client# iperf -c
LQ Newbie
Posted in Uncategorized
Views 244 Comments 0 karanis is offline
Old

BASH replace a line in file

Posted 04-05-2020 at 05:20 PM by karanis
Tags bash

sed "s|a dumb string|$lan|g" file.txt

sed "s|#dns_server\t\t10.0.0.1:53|#dns_server 192.168.1.1:53|g" /tmp/baresip_config
LQ Newbie
Posted in Uncategorized
Views 324 Comments 0 karanis is offline
Old

BASH extract fields from string

Posted 04-05-2020 at 05:19 PM by karanis
Tags awk, bash

https://en.wikibooks.org/wiki/Cut

link above have nice examples

Examples of use of similar tools in cut's domain:

echo a b|awk '{print $2}'
Displays "b", separating fields by any number of tabs or spaces. Thus, for awk, "b" is the 2nd field, while for cut -d" ", "b" is the 3rd field.
echo a b|awk '{print $2 $1}'
Displays "ba", preserving the order of the fields as specified....
LQ Newbie
Posted in Uncategorized
Views 378 Comments 0 karanis is offline
Old

BASH read file

Posted 04-05-2020 at 05:17 PM by karanis
Tags bash

https://www.cyberciti.biz/faq/unix-h...ine-from-file/

https://www.computerhope.com/unix/bash/read.htm

https://www.shellhacks.com/bash-read...ead-line-loop/

----------

while read USER; do echo "Hello $USER!"; done < users.txt

----------

#!/bin/ksh
file="/home/vivek/data.txt"
while IFS= read line
do
# display $line...
LQ Newbie
Posted in Uncategorized
Views 312 Comments 0 karanis is offline

  



All times are GMT -5. The time now is 09:29 AM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration