shellscript

サンプルコード:
MACCESS=`date -d yesterday +%Y%m%d`
FILE=”access_$MACCESS.log.tgz”
cd/data/nginx/log ...

Linux

1.現在のディレクトリの場所を確認
# pwd
/opt/jmeter/data

2.リンクのパスを確認
# cd/etc/init.d
# pwd
/etc/init.d ...

Software

1.インデックスを作成
db.collection.ensureIndex({key:1})

2.インデックスを参照
db.collection.stats()

3.インデックスのクエリをチェッ ...

PHP

PHPコード:
<?php
$str=array(4,8,2,7,10,0,3,12,11);
for ($I = 0; $I <= count($str); $I++) if (in_array( ...

Software

1.primary keyを追加
ALTER TABLE テーブル名 ADD PRIMARY KEY(カラム名);

2.primary keyを削除
ALTER TABLE table_name DROP ...

PHP

1.round()
echo round(3.4);//3
echo round(3.5);//4
echo round(3.6);//4
echo round(3.6, 0);//4
echo ...

PHP

PHPコード:
$rand = mt_rand(0,1);
if( $rand==0 )
{
$array = array(36,35,16,29,30);
}
elseif( $ran ...

PHP

phpコード
<?php
//USER AGENTを取得
$agent = strtolower($_SERVER);
//データを分析
$is_pc = (strpos($agent, ...

PHP

phpコード:
<?php function devicetype_get(){
$agent = strtolower($_SERVER);
$type = ‘other’; ...

Software

C#コード
using System;namespace ArrayApplication{
class InfoArray
{
static void Main(string n = new int; ...

C++

C#コード
using System;namespace ArrayApplication{
class MyArray
{
static void Main(string n = new int; ...

PHP

PHPコード
<?php
header(‘HTTP/1.1 200 OK’);
header(‘HTTP/1.1 404 Not Found’);

shellscript

shellコード:
#!/bin/bash
#useradd andpassword
echo “please input username:”
read name
ec ...

shellscript

shellコード:
#!/bin/bash
FILE=’20161204cft.csv’
MYSQL=’/usr/local/mysql/bin/mysql’ ...

shellscript

方法1
numbers=(122 134 132 154 160 189)

while true
do
index=$(($RANDOM % ${#numbers}))
echo numbe ...

Linux

1.エラー情報
# rpm -ivh MarkLogic-RHEL6-8.0-6.x86_64.rpm
error: Failed dependencies:
libc.so.6(GLIBC_2.11) is ...

Linux

1.memcachedのインストール
# wget
# wget
# tar zxf libevent-2.0.10-stable.tar.gz
# cd libevent-2.0.10-stable ...

shellscript

参考コード:
#!/bin/bash

HOSTNAME=”XXX.XXX.XXX.157″
PORT=”3306″
USERNAME=”r ...