Skip to main content

Posts

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 ...

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 p...

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...