$ lsof -i -P
Showing posts with label net. Show all posts
Showing posts with label net. Show all posts
linux ip
the linux world might be moving towards the
working with ipv6 is easy. use the -6 option.
ip commands can be shortened to their initial characters, if you feel lazy :)
ip command suite of iproute2, leaving behind some familiar unix tools, thereby potentially deprecating ifconfig, route, arp, netstat, etc. i list the traditional commands and their equivalent ip commands, for reference.$ ifconfig -a
$ ip addr
$ ip link
# ifconfig eth0 {up/down}
# ip link set eth0 {up/down}
# ifconfig eth0 192.168.1.2 netmask 255.255.255.0
# ip addr add 192.168.1.2/24 dev eth0
# ip addr show dev eth0
# ip addr add 192.168.1.2/24 dev eth0
# ip addr add 192.168.2.3/24 dev eth0
# ip addr del 192.168.2.3/24 dev eth0
# ifconfig eth0:1 192.168.2.3/24
# ip addr add 192.168.2.3/24 dev eth0 label eth0:1
$ route
$ netstat -rn
$ ip route
# ip route add 192.168.10.0/24 via 192.168.1.1
# ip route del 192.168.10.0/24 via 192.168.1.1
$ arp
$ ip neigh
# ifconfig -arp eth0
# ip link set dev eth0 arp off
working with ipv6 is easy. use the -6 option.
ip commands can be shortened to their initial characters, if you feel lazy :)
$ ip a
$ ip r
netcat tar backup
debian
i now use
at {destination}:
at {source}:
copy files from {some-server} to your machine:
and the other direction:
image a disk across the network from {box1} to {box2}:
at {box2}:
at {box1}:
restore this image in {box2} to {box3}:
at {box3}:
at {box2}:
compressed backup
at {box1}:
at {box2}:
references:
http://nc110.sourceforge.net/
http://sans.org/security-resources/sec560/netcat_cheat_sheet_v1.pdf
http://wikipedia.org/wiki/netcat
http://saurorja.org/2012/04/06/network-file-transfer-using-netcat/
http://compsoc.dur.ac.uk/~djw/tarpipe.html
netcat-openbsd is leaner, cleaner & more efficient than debian netcat-traditional. if you get a choice, prefer the openbsd version.i now use
busybox wherever i can, including nc and tar. small, simple, clean, standard, available the same everywhere.$ busybox nc Usage: nc [-iN] [-wN] [-l] [-p PORT] [-f FILE|IPADDR PORT] [-e PROG] Open a pipe to IP:PORT or FILE -e PROG Run PROG after connect -l Listen mode, for inbound connects (use -l twice with -e for persistent server) -p PORT Local port -w SEC Timeout for connect -i SEC Delay interval for lines sent -f FILE Use file (ala /dev/ttyS0) instead of network
$ busybox tar
Usage: tar -[cxtZzJjahmvO] [-f TARFILE] [-C DIR] [FILE]...
Create, extract, or list files from a tar file
Operation:
c Create
x Extract
t List
f Name of TARFILE ('-' for stdin/out)
C Change to DIR before operation
v Verbose
Z (De)compress using compress
z (De)compress using gzip
J (De)compress using xz
j (De)compress using bzip2
a (De)compress using lzma
O Extract to stdout
h Follow symlinks
m Don't restore mtimeat {destination}:
$ nc -l -p {port} | tar xpv[z|j]f -at {source}:
$ tar cpv[z|j]f - {directory} | nc {destination host/ip} {port}[z|j] compression: use over slower networks. ignore for faster networks and/or slower computers.tar streams much faster copying than scp 'ping-pong', especially when you have lots of files.copy files from {some-server} to your machine:
$ ssh {some-server} ‘cd /some/dir && tar cz dir’ | tar xzand the other direction:
$ tar cz dir | ssh {some-server} `cd /some/dir && tar xz`image a disk across the network from {box1} to {box2}:
at {box2}:
$ nc -l {port} [-vv] | dd of={disk.img} bs=1Mat {box1}:
$ dd if=/dev/sda bs=1M | nc {box2 host/ip} {port} [-vv] -q 10[-vv] use at the box1 (and/or box2, if fast enough)restore this image in {box2} to {box3}:
at {box3}:
$ nc -l {port} [-vv] | dd of=/dev/sda bs=1Mat {box2}:
$ dd if={disk.img} bs=1M | nc {box1 host/ip} {port} [-vv]compressed backup
at {box1}:
$ tar cpvJf - {directory} | nc {box2 host/ip} {port}at {box2}:
$ nc -l -p {port} | dd of={directory}.tar.xz bs=1kreferences:
http://nc110.sourceforge.net/
http://sans.org/security-resources/sec560/netcat_cheat_sheet_v1.pdf
http://wikipedia.org/wiki/netcat
http://saurorja.org/2012/04/06/network-file-transfer-using-netcat/
http://compsoc.dur.ac.uk/~djw/tarpipe.html
Response: A cascading effect
http://kmandla.wordpress.com/2010/01/15/a-cascading-effect/
Hi K! I have been your fan for a while now. Perhaps this might help you.
While I was in Germany over Christmas/NY spending time with some family I hadn't seen in a few years, I offered to help them with their computer woes. My tactic was to wipe out windows and replace it with ubuntu netbook remix. Though, my preferred flavour is debian, I opted for ubuntu as I was not conversant with that hardware. Ubuntu detected everything cleanly.
Hi K! I have been your fan for a while now. Perhaps this might help you.
While I was in Germany over Christmas/NY spending time with some family I hadn't seen in a few years, I offered to help them with their computer woes. My tactic was to wipe out windows and replace it with ubuntu netbook remix. Though, my preferred flavour is debian, I opted for ubuntu as I was not conversant with that hardware. Ubuntu detected everything cleanly.
most viewed
-
to play more seriously with yet another distro, i needed to install it. so i had some fun resizing/moving partitions around to clear some fr...
-
I have just discovered zram [2] :) woohoo... and what a thing that is! I was so sold on tmpfs , that I used it for everything I possibly ...
-
you won't see many docs about minimal netinstall slackware. indeed, you will see many experts saying there is no such thing. and your on...
-
debian kernels contain everything needed by everyone. customising your kernel is easy and highly recommended. i recommend using the same ker...
-
I decided to have another go at runit , this time on my gentoo . I had been thinking about this, since I noticed this on
-
I noticed while updating my void that kernels were being updated, but old ones weren't being removed. Removing orphan packages didn'...
-
this idea has been knocking around in my head for a while. i want to document it, while it is still there and to flush it out later.. i us...
-
vision: portable internet router, to carry on my travels, or use at home. openwrt on a portable (thin-client/netbook) device. internet sour...
-
ref: http://wiki.gentoo.org/wiki/portage Gentoo is Portage. Portage is Gentoo. Getting portage settings right is vitally important. It...
-
I have no sound, on my recent gentoo install. LXQT Mixer wouldn't open. I don't even get any error/warning messages. This is not ...