Go to content

전체 글

(472)
여러 장비에서 자동으로 슬립모드로 들어가는 bash shell script 한참 머리 굴리다가 만들었다. ㅋㅋ windows에 ssh 서버를 설치해야 하고, (cygwin으로 하면 편한듯)각 ssh서버들에 id_rsa.pub을 .ssh/authorized_key로 복사해 넣어야 하는 단점이 있긴 하지만... #!/bin/bash if [[ -z $1 ]]; then RUN_IN_SEC=30 else RUN_IN_SEC=$1 fi PC_ADDR=( "root@172.20.31.27,linux" "ikko@172.20.31.26,windows" "root@localhost,linux" ) # Remote PC function Run_Remote_Suspend() { local variables=( `echo $@ | tr "," " "` ) local id_address=${var..
시스템 sleep 관련 event 발생시 자동실행 /etc/pm/sleep.d/ 에서 스크립트를 만들면 아래의 경우 자동으로 해당 스크립트를 실행해준다. hibernateresumethawsuspend 예제) #!/bin/bash PATH=/sbin:/usr/sbin:/bin:/usr/bin WAKEONLAN=/usr/bin/wakeonlan if [ ! -x $WAKEONLAN ]; then exit 0 fi case "${1}" in resume) wakeonlan 00:23:11:22:33:44 wakeonlan 00:24:11:22:33:44 ;; suspend|hibernate|thaw) # nothing ;; esac
일반적인 리눅스 bash command https://zignd.wordpress.com/2012/07/11/an-a-z-index-of-the-bash-command-line-for-linux/
이거슨 스누피님을 위한 포스트 #!/bin/bash # IPLIST Array로 선언 declare -a IPLIST # 굳이 선언하지 않아도 되지만 Global이므로 가독성을 위해 선언. NUMBER=0 # hostname을 $HOSTNAME 변수에 저장 HOSTNAME=`hostname` # 불필요한 local network의 IP는 출력하지 않도록 grep -v 옵션 추가하고 해당 출력된 리스트를 IPLIST 어레이에 저장. IPLIST=( `ifconfig | grep "inet addr" | sed 's/:/ /' | awk '{ print $3 }' | grep -v "127.0.0.1"` ) function ChooseNumber() { #함수 내부에서만 사용하기에 local 선언 local i=1 clear echo -..
ssh 접속이 느릴경우 When logging in, ssh daemon checks reverse DNS lookup. so only thing you have to do is, write one line in sshd_config of server. /etc/ssh/sshd_config: UseDNS no restart ssh daemon, and that's it.
우분투에 파이퍼폭스 4 정식 설치방법 아직 우분투 10.10, 10.04에는 firefox 3.x가 설치되어있다. 이미 firefox4.0 정식 출시된 상황. 업그레이드 하고자하면, 세번의 스탭만 밟으면 된다. sudo add-apt-repository ppa:mozillateam/firefox-stable sudo apt-get update sudo apt-get install firefox
한글 우분투의 기본 디렉토리 이름 바꾸기 $vi ~/.config/user-dirs.dirs의 내용을 아래와 같이 변경 # This file is written by xdg-user-dirs-update # If you want to change or add directories, just edit the line you're # interested in. All local changes will be retained on the next run # Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped # homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an # absolute path. No other format is su..
오랜만에 본 재밌는 개그 오랜만에 본 재밌는 개그가 있어서 이곳에 소개 직링크는 이곳. http://newkoman.mireene.com/tt/3792 어느 아내가 프로그래머 남편에게 「쇼핑하러 갈 때, 우유 하나 사와. 아, 계란 있으면 6개 사와」 남편은 잠시 후, 우유를 6개 사왔다. 아내는 물었다. 「왜 우유를 6개나 사왔어!」 남편「계란이 있길래 6개 사왔지…」 그러나 거기에 있는 댓글이 더더욱 대박...ㅋㅋㅋ 나도 댓글을 달려고 했으나, 어찌된 이유인지 난 차단되었다고...-_-; 어쨌거나 여기에 한번 남겨봄 #!/sh/bash export EGG=0 export MILK=0 if [ EGG -eq 1 ]; then while (( MILK >= 6 )); do let+=MILK done fi #echo EGG="$E..