This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OS=`uname` | |
IO="" # store IP | |
case $OS in | |
Linux) IP=`/sbin/ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'`;; | |
FreeBSD|OpenBSD) IP=`/sbin/ifconfig | grep -E 'inet.[0-9]' | grep -v '127.0.0.1' | awk '{ print $2}'` ;; | |
SunOS) IP=`/sbin/ifconfig -a | grep inet | grep -v '127.0.0.1' | awk '{ print $2} '` ;; | |
*) IP="Unknown";; | |
esac | |
echo "$IP" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
友情提示: | |
如果饭组太活跃影响到您的正常工作, 可分以下情况处理: | |
if 饭组很无聊 and 不想待了: | |
请在聊天窗口直接输入 /leave 来退出此群组 | |
elif 希望潜水 or 不想在这个时段聊天: | |
在聊天窗口输入 /alertsoff 来关闭所有聊天提醒,你还可以使用 /alertson [text] 来指定只在关键词text出现的时候收到提醒 | |
else: | |
在聊天窗口输入 /help 查看你需要的功能 | |
PS: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export DISPLAY=$(tr '\000' '\n' < /proc/`pidof X`/cmdline | egrep '^:[0-9]+') | |
OR some what: | |
export DISPLAY=$(tr '\000' '\n' < /proc/`pidof Xorg`/cmdline | egrep '^:[0-9]+') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ps axu | grep [a]pache2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
python -c 'import googl; print googl.Googl("<your_google_api_key>").shorten("'$someurl'")[u"id"]' | |
Google URL shortener | |
(1) required: python-googl ( install by: pip install python-googl ) | |
(2) get from google API console https://code.google.com/apis/console/ | |
curl -s -d'&url=URL' http://goo.gl/api/url | sed -e 's/{"short_url":"//' -e 's/","added_to_history":false}/\n/' | |
googl () { curl -s -d "url=${1}" http://goo.gl/api/url | sed -n "s/.*:\"\([^\"]*\).*/\1\n/p" ;} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ip-where { wget -qO- -U Mozilla http://www.ip-adress.com/ip_tracer/$1 | html2text -nobs -style pretty | sed -n /^$1/,/^$/p;} | |
ip-where `curl ifconfig.me` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# ~/.xinitrc | |
# Executed by startx (run your window manager from here) | |
# Set up screens and set background | |
if [ `xrandr | grep -c ' connected '` -eq 2 ]; then # dual-monitor | |
if [ `xrandr | grep VGA-1 | grep -c ' connected '` -eq 1 ]; then | |
xrandr --output LVDS-1 --auto --primary --output VGA-1 --auto --right-of LVDS-1 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MFS_HOME="/mfs/user/`whoami`" | |
source "$MFS_HOME/sysutils/config/bashrc" | |
OlderNewer