/ 雑記帳

bash 変数が定義されているか?

#!/bin/bash

hen1=`ps aux | grep quimup | grep bin | awk '{print $2}'`

echo "$hen1"

if [ -n "${hen1}" ] ; then

echo "--------------------------"

ps aux | grep quimup

echo "--------------------------"

kill $hen1

else

echo "quimupは起動されていません。"

fi


— posted by くま at 09:16 am   pingTrackBack [0]

localtime

# cd /etc/
# ll localtime
# rm localtime
# ln -s /usr/share/zoneinfo/Japan localtime

— posted by くま at 04:13 pm   pingTrackBack [0]

samba設定

# pdbedit -a root
new password:
retype new password:
Unix username: root
NT username:
Account Flags: [U ]
User SID: S-1-5-21-1024304826-547193022-2962745630-1000
Primary Group SID: S-1-5-21-1024304826-547193022-2962745630-513
Full Name: root
Home Directory: ¥¥voyage¥root
HomeDir Drive:
Logon Script:
Profile Path: ¥¥voyage¥root¥profile
Domain: VOYAGE
Account desc:
Workstations:
Munged dial:
Logon time: 0
Logoff time: never
Kickoff time: never
Password last set: 火, 12 5月 2015 10:43:17 GMT
Password can change: 火, 12 5月 2015 10:43:17 GMT
Password must change: never
Last bad password : 0
Bad password count : 0
Logon hours : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

— posted by くま at 07:54 pm   pingTrackBack [0]

メモ

mount -t ntfs -o iocharset=utf8,umask=0222 /dev/sdb1 /var/lib/mpd/music

— posted by くま at 03:31 pm   pingTrackBack [0]

1

1

— posted by at  

debian_version 7.8 samba-REGZA

一部ネット情報では不可能と言われているがdebianでも3.0系sambaならREGZAと接続出来る。
     
# smbpasswd -a kkuma
# cat /etc/samba/smb.conf
#======================= Global Settings =======================
     
[global]
workgroup = WORKGROUP
server string = Samba Server Version %v
log file = /var/log/samba/log.%m
max log size = 50
unix extensions = No
idmap config * : backend = tdb
hosts allow = 127., 192.168.11.
cups options = raw
dos charset = CP932
unix charset = UTF-8
     
[homes]
comment = Home Directories
path = %H/samba
read only = No
     
[printers]
comment = All Printers
path = /var/spool/samba
printable = Yes
print ok = Yes
browseable = No
     
[video]
comment = Video Directories
path = /var/video
read only = No
create mask = 0777
directory mask = 0777
guest only = Yes
guest ok = Yes
     
# /etc/init.d/samba restart

— posted by くま at 12:18 pm   pingTrackBack [0]

CentOS6.5 csh if

使用するシェルによってif部分の記述が異なるのは本当に使いにくい。
goto 文は csh でしか使えない。

#!/bin/csh

#/usr/local/abin/ETHER-VOYAGE

sudo ether-wake -i eth0 00:0A:B9:44:FC:B5

case1:

sleep 1

#

set host1=192.168.11.12

set hen1=`ping -c 1 "$host1" | grep ttl | awk '{print $8}'`

set hen2 = ms

echo "---------"

echo "$hen1"

echo "$hen2"

echo "---------"

if ( "$hen1" == "$hen2" ) then

echo "(_´Д`) アイーン"

sshpass -p "we300ab" ssh -o StrictHostKeyChecking=no root@arch

else

echo "APU1Cが起動していません。"

goto case1

sleep 1

endif


— posted by くま at 11:39 am   pingTrackBack [0]

対話 スクリプト rsync 自動化

#!/bin/csh

echo "Input dir_1"

echo ""

echo "/usr/local/abin"

echo ""

echo "/var/video/@top-souko"

echo ""

echo "/var/video/CD-MOTO2"

echo ""

echo "/var/video/@BACUP"

echo ""

echo "/var/video/@DOCUMENT"

echo ""

#

set dir_1 = $<

echo "------------------------------------------"

#

#現在位置

#

set PWD_1=`pwd`

#

cd dir_1

cd ../

#

#配下ディレクトリー設定

#

set PWD_2=`pwd`

echo ""

echo "$PWD_2/"

#

#実行ディレクトリーへ戻る

#

cd $PWD_1

echo ""

#ls

echo "------------------------------------------"

echo "192.168.11.3:$PWD_2/"

echo ""

echo "192.168.11.4:$PWD_2/"

echo ""

echo "Output dir_2"

echo ""

set dir_2 = $<

echo ""

echo "Start rsync...."

#rsync -arpt -v --delete $dir_1 $dir_2

/usr/bin/rsync -arpt -v --rsh="/usr/bin/sshpass -p "xxxxxx" ssh -o StrictHostKeyChecking=no -l root" $dir_1 $dir_2


— posted by くま at 11:23 am   pingTrackBack [0]

ssh 自動化

http://server-setting.info/centos/sshpass-ssh-auto-connect.html

— posted by くま at 10:17 pm   pingTrackBack [0]

 

今更ですがatok

http://shimaq.jugem.jp/?eid=8
http://support.justsystems.com/faq/1032/app/servlet/qadoc?QID=044668&m=jui4x0169

— posted by くま at 02:31 pm   pingTrackBack [0]

<< 2024.11 >>
SMTWTFS
     12
3456789
10111213141516
1718 1920212223
2425262728 2930
 
























T: Y: ALL: Online:
ThemePanel
  • Basic
Created in 0.0454 sec.