Pages

Showing posts with label ip. Show all posts
Showing posts with label ip. Show all posts

Tuesday, March 12, 2013

Informative bash prompt

I hop between machines a lot at home. I want to know their IP address easily in addition to history count, user, and (if available) git branch in my .basrg
export PS1='($IP) [\!]\[\033[00;32m\]\u\[\033[01m\]@\[\033[00;36m\]\h\[\033[01m\]:\[\033[00;35m\]\w\[\033[00m\]\[\033[01;33m\]`git branch 2>/dev/null|cut -f2 -d\* -s`\[\033[00m\]\$ '
e.g

Thursday, July 7, 2011

modifications to up scripts for vpn


http://www.linuxselfhelp.com/howtos/PPP/PPP-HOWTO-23.html
In the scripts in etc/ppp/ip-up.d you can use




When the ppp link comes up, this script is called with the following
parameters
$1 the interface name used by pppd (e.g. ppp3)
$2 the tty device name
$3 the tty device speed
$4 the local IP address for the interface
$5 the remote IP address
$6 the parameter specified by the 'ipparam' option to pppd






Silly I missed that.


--
My Emacs Files At GitHub

Wednesday, July 6, 2011

script to return ip address of an interface

#!/bin/bash
sudo ifconfig ${1-eth1} | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'




--
My Emacs Files At GitHub