Skip to main content

Posts

Showing posts from 2016

CL and LF, /bin/bash^M: bad interpreter:

Windows CR and LF Linux: LF only Files saved in Windows and they have errors when exectured in the Linux. /bin/bash^M: bad interpreter: そのようなファイルやディレクトリはありません /bin/bash^M: bad interpreter: No such file or directory It is because files are stored with \r\n and it needs to be corrected with \n. cat -e displays LF as $ and CR as ^M . cat -e filename http://totech.hateblo.jp/entry/2014/03/19/174129 http://d.hatena.ne.jp/JiaLu/20090911/1252627589

how to write blog

Referring to the following page. http://ameblo.jp/sumitak1329/entry-11593572421.html https://youland.net/enclose-line http://kawakamitakehiro.com/wakuwaku/ http://ameblo.jp/sugarandspice-meg/entry-12095507450.html http://girly-tips.top/blog/ameblo/post-41 https://youland.net/enclose-line <div style="background: #ffeeee; border: 2px dotted #ff0000; padding: 10px;"> 枠内の記事本文</div><br /> 枠内の記事本文 <div style="background:#eeeeff; padding:10px; border:2px dotted #0000ff;">枠内の記事本文</div><br> 枠内の記事本文 <legend>タイトル</legend>枠の中の文章</fieldset> タイトル 枠の中の文章 <div style="border-style: solid; border-width: 1px;"> 枠線で囲まれる本文</div> 枠線で囲まれる本文 <div style="background:#f7f7f7; padding:10px; border-radius: 10px; border: 2px dotted #CCCCCC;">枠内の記事本文</div><br> 枠内の記事本文

Checking OS version

Checking the kernel version [root@ip-172-31-27-217 cron.daily]# cat /proc/version  Linux version 2.6.32-358.14.1.el6.x86_64 (mockbuild@x86-022.build.eng.bos.redhat.com) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC) ) #1 SMP Mon Jun 17 15:54:20 EDT 2013 [root@ip-172-31-27-217 cron.daily]# uname -a Linux ip-172-31-27-217.ap-northeast-1.compute.internal 2.6.32-358.14.1.el6.x86_64 #1 SMP Mon Jun 17 15:54:20 EDT 2013 x86_64 x86_64 x86_64 GNU/Linux Checking OS version [root@ip-172-31-27-217 cron.daily]# cat /etc/redhat-release  Red Hat Enterprise Linux Server release 6.4 (Santiago) Referring to the page below. http://qiita.com/ritukiii/items/60a3ac4734fc52748cee

cron/crontab

Referring to the page: http://qiita.com/katsukii/items/d5f90a6e4592d1414f99 Step1: Checking Daemon  [root@ip-172-31-27-217 cron]# service crond status crond (pid  1306) is running... Step2:  Editting shell: date command and ping 8.8.8.8 and write the outputs into hoge.txt [root@ip-172-31-27-217 ~]# more ping.sh  date >> hoge.txt; ping -c 1 8.8.8.8 | grep 'from'  >> hoge.txt Step3.  Editting crontab [root@ip-172-31-27-217 ~]# crontab -e */10 * * * * cd /root; ./ping.sh Result  [root@ip-172-31-27-217 ~]# more hoge.txt  Mon Oct 31 03:20:01 EDT 2016 64 bytes from 8.8.8.8: icmp_seq=1 ttl=59 time=3.53 ms Mon Oct 31 03:30:01 EDT 2016 64 bytes from 8.8.8.8: icmp_seq=1 ttl=59 time=3.51 ms Mon Oct 31 03:40:01 EDT 2016 64 bytes from 8.8.8.8: icmp_seq=1 ttl=59 time=3.60 ms Mon Oct 31 03:50:01 EDT 2016 64 bytes from 8.8.8.8: icmp_seq=1 ttl=59 time=3.54 ms Checking the crontab

DDNS: Dynamic DNS on AWS

Referring to the following page http://www.noip.com/support/knowledgebase/installing-the-linux-dynamic-update-client/ Step1: Creating account on https://www.noip.com/ Step2: Following steps 1. cd /usr/local/src 2. wget http://www.no-ip.com/client/linux/noip-duc-linux.tar.gz 3. tar xzf noip-duc-linux.tar.gz 4. cd no-ip-2.1.9 5. make <<< 6. make install Step3: NO GCC so install gcc << Step2-5 [root@ip-172-31-27-217 noip-2.1.9-1]# yum install gcc Loaded plugins: amazon-id, rhui-lb, security Setting up Install Process Resolving Dependencies --> Running transaction check Step4:  [root@ip-172-31-27-217 noip-2.1.9-1]# /usr/local/bin/noip2 -C Auto configuration for Linux client of no-ip.com. Multiple network devices have been detected. Please select the Internet interface from this list. By typing the number associated with it. 0 eth0 1 tun0 0 Please enter the login/email string for no-ip.com  xxxxx@gmail.com Please enter the password for us

ping sweep by ping command

sweeping from 1 to 15: -c: count of ping -t: TTL option -w: timeout -- second bash-3.2$ for i in {1..15}; do ping -c 1 -w 1 10.0.1.$i | grep 'from'; done 64 bytes from 10.0.1.1: icmp_seq=0 ttl=255 time=184.080 ms 64 bytes from 10.0.1.12: icmp_seq=0 ttl=64 time=0.057 ms 64 bytes from 10.0.1.13: icmp_seq=0 ttl=64 time=322.238 ms 64 bytes from 10.0.1.14: icmp_seq=0 ttl=64 time=5.747 ms

SNMP mib file installation

Step1: Installing private MIB file and changing SNMP configuration on PC Refeering to the following link for private mibs: http://changineer.info/server/monitoring/monitoring_snmp.html http://wiki.pomme-tech.com/index.cgi?page=%A5%D7%A5%E9%A5%A4%A5%D9%A1%BC%A5%C8MIB%A4%CE%C4%C9%B2%C3&print=1 http://www.lesstep.jp/step_on_board/linux/23/ Refeering to the following link for errors related to mibs: http://www.zabbix.jp/node/3056 http://serverfault.com/questions/440319/did-not-find-zerodotzero-in-module-snmpv2-smi Step2. installing private mib files in an appropriate directory(/usr/share/snmp/private-bims) Step3. changing snmp.conf files. You may need to create an empty new file NOT snmpd.conf. ---------------------------------------- /etc/snmp/snmp.conf MIBDIRS /usr/share/snmp/mibs:/usr/share/snmp/private-bims MIBS all ---------------------------------------- Step4: Checking the output before and after installing private mib files. You don't need to restart th

SNMP mib tips: snmpwalk & snmptranslate

Referring to this web site: https://gist.github.com/bahootyper/575190 The following explanations are about snmpwalk & snmptranslate command options. #Displayes every OID $ snmptranslate -Tp #Dispaly OID label(MIB name) from OID $ snmptranslate .1.3.6.1.4.1.14823.2.2.1.1.2.1.1.2 WLSX-SWITCH-MIB::userPhyAddress #Dispaly MIB tree name from OID label #-IR: label,  -Tp: tree option $ snmptranslate -IR -Tp nUser6Name +-- -R-- String    nUser6Name(3)          Textual Convention: DisplayString          Size: 0..128 #Dispaly MIB tree name from OID label #-IR: label,  -Tp: tree option $ snmptranslate -Tp .1.3.6.1.4.1.14823.2.2.1.14.1.2.1.3 +-- -R-- String    nUser6Name(3)          Textual Convention: DisplayString          Size: 0..128 # OID's detailed option $ snmptranslate -Td .1.3.6.1.4.1.14823.2.2.1.14.1.2.1.3 WLSX-USER6-MIB::nUser6Name nUser6Name OBJECT-TYPE   -- FROM WLSX-USER6-MIB   -- TEXTUAL CONVENTION DisplayString   SYNTAX OCTET STRING (0..1

MAC OS TFTP Server

Referring to the link: MAC TFTP Page http://takuya-1st.hatenablog.jp/entry/2016/02/27/030544 http://shantiworks.info/2013/10/30/mac-os-x%E3%81%AEtftp%E3%82%B5%E3%83%BC%E3%83%90%E3%82%92%E5%88%A9%E7%94%A8%E3%81%99%E3%82%8B/ launchctl Command Page http://macwiki.osdn.jp/wiki/index.php/%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89/launchctl TFTP needs file overwrite http://hints.macworld.com/article.php?story=20070218233806794 " the files must already exist before writing to them" Step1: MAC OS has pre-set TFTP program. It needs to be activated. Step2: Create local folder for tftp repository. $ cd ~ $ mkdir TFTP $ chmod 755 TFTP $  echo hogehoge >> test.html $ ls test.html Step3: replace "/private/tftpboot" with "your created local folder" $ sudo vi /System/Library/LaunchDaemons/tftp.plist Finish tftp: $ sudo launchctl unload -w /System/Library/LaunchDaemons/tftp.plist Start tftp: $ sudo launchctl load -w /System/Libra

MAC USB console of SRC06USB

No need to download any software for the Buffalo's SRC06USB. Referring to this silte http://www.ytsuboi.org/wp/archives/1219 http://qiita.com/tukiyo3/items/08ce4b75a8c8dd6d1c43 http://swiftlife.hatenablog.jp/entry/2016/01/13/133640 There are two ways: *cu -l command Aruba-no-MacBook-Air-2:~ aruba$  sudo cu -l /dev/tty.usbserial-FTK1S1BK Password: Connected. 6c:f3:7f:c5:a7:da# cu: Got hangup signal Disconnected. Or *screen command $ ls /dev/tty.*  /dev/tty.Bluetooth-Incoming-Port  /dev/tty.usbserial-FTK1S1BK  $ screen /dev/tty.usbserial-FTK1S1BK 9600

grub: recovery

参考リンク http://lunatear.net/archives/000328.html GRUB > root  [TABを押す] Possible disks are: fd0 GRUB > root ( hd0,[TABを押す] Possible partitions are: Partition num: 0, Filesystem type is ext2fs, partition type 0x83 rootコマンドでカーネルイメージのありそうなところのアタリをつけて「kernel /」のタブ補完 GRUB > root ( hd0,1) GRUB > kernel /[TAB] Possible files are: vmlinuz-2.4.18-3 initrd-2.4.18-3xxx /bootのマウント先だったので GRUB > kernel /vmlinuz-2.4.18-14 等としてエンターするとkernelの場所をGRUBに覚えさせることが出来る このケースではinitrdのファイルもあるので、以下のようにして同様に指示してしまいます。 GRUB > initrd /initrd-2.4.18-3.img