ホーム » Linux (ページ 6)

Linux」カテゴリーアーカイブ

2024年3月
 12
3456789
10111213141516
17181920212223
24252627282930
31  

カテゴリー

アーカイブ

ブログ統計情報

  • 77,426 アクセス



Synology NAS で zip

Synology NAS 内(SSH 接続)で,zip ファイルを扱えないかと…
検索すると,Linux 環境では zip や unzip があるらしい.
SSH で接続して確認すると,zip はあるが unzip は command not found .
さらに検索すると Synology Forum に情報があった.
 Unzip?
7z コマンドが利用できるみたい.

Iwao@DS116:~$ zip
Copyright (c) 1990-2008 Info-ZIP - Type 'zip "-L"' for software license.
Zip 3.0 (July 5th 2008). Usage:
zip [-options] [-b path] [-t mmddyyyy] [-n suffixes] [zipfile list] [-xi list]
  The default action is to add or replace zipfile entries from list, which
  can include the special name - to compress standard input.
  If zipfile and list are omitted, zip compresses stdin to stdout.
  -f   freshen: only changed files  -u   update: only changed or new files
  -d   delete entries in zipfile    -m   move into zipfile (delete OS files)
  -r   recurse into directories     -j   junk (don't record) directory names
  -0   store only                   -l   convert LF to CR LF (-ll CR LF to LF)
  -1   compress faster              -9   compress better
  -q   quiet operation              -v   verbose operation/print version info
  -c   add one-line comments        -z   add zipfile comment
  -@   read names from stdin        -o   make zipfile as old as latest entry
  -x   exclude the following names  -i   include only the following names
  -F   fix zipfile (-FF try harder) -D   do not add directory entries
  -A   adjust self-extracting exe   -J   junk zipfile prefix (unzipsfx)
  -T   test zipfile integrity       -X   eXclude eXtra file attributes
  -y   store symbolic links as the link instead of the referenced file
  -e   encrypt                      -n   don't compress these suffixes
  -h2  show more help
  -yf  store files/directories that symbolic links point to in an archive
  -cp  codepage, ex: fre,ger,ita,spn,cht,chs,jpn,krn,ptb,rus,dan,nor,sve,nld,plk,ptg,hun,trk,csy

Iwao@DS116:~$ unzip
-sh: unzip: command not found
Iwao@DS116:~$ 7z

7-Zip 9.20  Copyright (c) 1999-2010 Igor Pavlov  2010-11-18
p7zip Version 9.20 (locale=en_US.utf8,Utf16=on,HugeFiles=on,2 CPUs)

Usage: 7z <command> [<switches>...] <archive_name> [<file_names>...]
       [<@listfiles...>]

<Commands>
  a: Add files to archive
  b: Benchmark
  d: Delete files from archive
  e: Extract files from archive (without using directory names)
  l: List contents of archive
  t: Test integrity of archive
  u: Update files to archive
  x: eXtract files with full paths
<Switches>
  -ai[r[-|0]]{@listfile|!wildcard}: Include archives
  -ax[r[-|0]]{@listfile|!wildcard}: eXclude archives
  -bd: Disable percentage indicator
  -i[r[-|0]]{@listfile|!wildcard}: Include filenames
  -m{Parameters}: set compression Method
  -o{Directory}: set Output directory
  -p{Password}: set Password
  -r[-|0]: Recurse subdirectories
  -scs{UTF-8 | WIN | DOS}: set charset for list files
  -sfx[{name}]: Create SFX archive
  -si[{name}]: read data from stdin
  -slt: show technical information for l (List) command
  -so: write data to stdout
  -ssc[-]: set sensitive case mode
  -t{Type}: Set type of archive
  -u[-][p#][q#][r#][x#][y#][z#][!newArchiveName]: Update options
  -v{Size}[b|k|m|g]: Create volumes
  -w[{path}]: assign Work directory. Empty path means a temporary directory
  -x[r[-|0]]]{@listfile|!wildcard}: eXclude filenames
  -y: assume Yes on all queries
Iwao@DS116:~$    


Synology NAS で zip , unzip , 7z
Linux での zip コマンド


NAS で zip コマンドを使用したページ
https://itl.mydns.jp/i_Tools/up_bg_s/
up_bg_s
http://jml.mish.work/i-tools/360-panorama.html
http://jml.mish.work/i-tools/how-to-up-bg.html

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

球が作成できない

背景画像のアップロードで,球を生成してそれに貼り付ける.
コード自体はそれほど難しくないので,1 日位でできると思ってた.
Windows のコンソール AP で,次の様なコードを書いてテスト.
MakeBG.cpp
make_bg.hxx


#include "MessBar.hxx"
#include "i_Trace.hxx"
#include "gonsprm2.hxx"
#include "Htm_thrj.hxx"

//*******************************************************************************
// make bg files imo and html
// Create : 2018/04/19
//*******************************************************************************
inline bool MakeBG (c_tstring& dibPath)
{
    tstring ext = ::Path_GetExtLow(dibPath) ;
    if      (ext == _T("bmp")) { ;              }
    else if (ext == _T("jpg")) { ;              }
    else if (ext == _T("png")) { ;              }
    else                       { return false ; }
    {
        tstring imoPath = ::Path_ChangeExt(dibPath,_T(".imo")) ;
        tstring htmName = ::Path_ChangeExt(dibPath,_T(".html")) ;
        tstring dmpName = ::Path_ChangeExt(dibPath,_T(".ipl")) ;
        {
            long div = 90/5 ;
            v_Vd3A pntsAry = ::BuildSphere(div) ;
            {
                std::tout << pntsAry.size() << std::endl ;
                if (pntsAry.size() > 0) {
                    Vd3A pnts = pntsAry[0] ;
                    std::tout << pnts.size() << std::endl ;
                    }
                tstring str = ::v_V3_To_tstring(pntsAry,_T(",")) ;
                {
                    std::tout << str << std::endl ;
                    }
                ::SaveText(dmpName.c_str(),str) ;
                }
            v_Vd2A  txuvAry = ::SetTextureUV(pntsAry) ;
                    pntsAry = ::V3_Scale (pntsAry,Vd3(20.)) ;
            Gons1   gons1 = ::Gons_BuildFace(pntsAry,txuvAry,dibPath.c_str()) ;
            GonsA   ga ;
                    ga.push_back(gons1) ;
            Ed3     es = ::GonsA_GetExtent(ga) ;
            {
                std::tout << imoPath << _T("\t") ;
                std::tout << ::V3_To_tstring(es.Volume()) << std::endl ;
                }
            if (es.Volume() != Vd3(0)) {
                es = Ed3(es.L*0.01,es.G*0.01) ;
                ::GonsA_ToOBJ(ga,imoPath.c_str()) ;
                ::HT_Make_three_js_html(imoPath.c_str(),es) ;
                }
            }
        }
    return true ;
    }

//*******************************************************************************
// Make BG
// Create : 2018/04/19
//*******************************************************************************
int _tmain (int argc,TCHAR* argv[])
{
    _tsetlocale(LC_ALL,_T("")) ;
    {
        double s = sin(rad(30)) ;
        double c = cos(rad(30)) ;
        std::tout << ::To_tstring(rad(30)) << _T("\t") << ::To_tstring(s) << _T("\t") << ::To_tstring(c) << std::endl ;
        }
    if (argc > 1) {
        v_tstring argAry ;
        for (int index=1 ; index<argc ; index++) {
            tstring av = argv[index] ;
            ::MakeBG(av) ;
            }
        }
    else {
        tstring buf ;
        buf.resize(1000) ;
        {
            while (std::terr << _T("dib ? =") , std::tin.getline(&buf[0],buf.size()))
            {
                tstring str = buf.c_str() ;
                if      (str == _T("q"))   { break ; }
                else if (str == _T("Q"))   { break ; }
                str = ::QuotM_Del_All(str) ;
                if (str.empty())           { continue ; }
                if (::File_IsNothing(str)) { continue ; }
                tstring dib_file = str ;
                ::MakeBG(dib_file) ;
                }
            }
        }
    return 0 ;
    }

#include "MessBar.cxx"

今度は,DS116 でビルドして実行すると,

Iwao@DS116:/var/.../Test/up_bg/data$ ./a.out
0.523599        98314745853377985068733249901357667205561433229409406145971019710277043155206326909160297391588106447153156445277590513896008090831662627743743127151181611161993303763348552511914898438567008016612049817143085994563143448055356356529593034366351316506187159487365573007925410016860727208738652774465536.000000  98321247861193438769252981549279948821735544950351014769381393881588573259178110828643912278175146924986161470094082713103803921735703931192359519739047155548857037547932930737608178537416409042994283830606984599100883034181136178714087912736395732787698542049681305006129736011480288874859116047106048.000000
dib ? =

本当は,

C:\Users\Iwao\...\i_Tools.tmp>\\DevXP\C_Drive\Temp\DS11x\MakeBG\Release.060\MakeBG.exe
0.523599        0.500000        0.866025
dib ? =

cmath が使えない様で,検索すると「-lm でコンパイルが通る」と言うのは見つかる.
が,コンパイルの問題ではなく,実行でうまくない.


当然ではあるが,DS115j でも同様.
試しに,opkg update と opkg install gcc .
root@DS116:/var/…/Iwao# opkg update
Downloading http://pkg.entware.net/binaries/armv7/Packages.gz
Updated list of available packages in /opt/var/opkg-lists/packages
root@DS116:/var/…/Iwao# opkg install gcc
Upgrading gcc on root from 6.3.0-1 to 6.3.0-1a…
Downloading http://pkg.entware.net/binaries/armv7/gcc_6.3.0-1a_armv7soft.ipk
Configuring gcc.
root@DS116:/var/…/Iwao#
もう一度,ビルドして実行すると,
Iwao@DS116:/var/…/Test/up_bg/data$ g++ MakeBG.cpp
Iwao@DS116:/var/…/Test/up_bg/data$ ./a.out
0.523599 0.500000 0.866025
dib ? =
予想以上に時間がかかってしまったが,何とか…
daikoku_edit.html


2019/02/13 リンクなどを修正

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

opkg install tree

以前 DS115j には tree コマンドを入れていたが,DS116 はまだだったので…

Iwao@DS116:/tmp/http$ sudo -i
Password:

root@DS116:~# opkg install tree
-ash: opkg: command not found

root@DS116:~# cd /var/services/homes/Iwao/
root@DS116:/var/services/homes/Iwao# source ./set_ds_inc.sh
root@DS116:/var/services/homes/Iwao# opkg -v
opkg version 0.1.8
root@DS116:/var/services/homes/Iwao# opkg install tree
Installing tree (1.7.0-1) to root...
Downloading http://pkg.entware.net/binaries/armv7/tree_1.7.0-1_armv7soft.ipk
Collected errors:
 * opkg_install_pkg: Package tree md5sum mismatch. Either the opkg or the package index are corrupt. Try 'opkg update'.
 * opkg_install_cmd: Cannot install package tree.
root@DS116:/var/services/homes/Iwao# opkg update
Downloading http://pkg.entware.net/binaries/armv7/Packages.gz
Updated list of available packages in /opt/var/opkg-lists/packages
root@DS116:/var/services/homes/Iwao# opkg install tree
Installing tree (1.7.0-1) to root...
Downloading http://pkg.entware.net/binaries/armv7/tree_1.7.0-1_armv7soft.ipk
Configuring tree.
root@DS116:/var/services/homes/Iwao# tree
.
├── gcc_test
│   ├── 20170922.out
│   ├── a.out
│   ├── editad
│   ├── EditAd.cpp
│   ├── edit_ad.php
│   └── T_P_ini.cpp
├── set_ds_inc.sh
├── Temp
│   └── rc.local
└── www
    └── dmp_   .php

3 directories, 9 files
tree コマンド実行
Synology NAS tree
Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

IIS+PHP-3

さらに次の様な exe の起動.
   exec (change_sp(“./imotowgl”)) ;
あまり関係ないが php と同じ場所に imotowgl と IMOtoWGL.exe が存在する.


この指定では,DS115j ではうまく動作しているが IIS 環境では起動できないみたい.
次の様に exe を付けるか,大文字などファイル名を正しく指定する必要があるみたい.
   exec (change_sp(“./imotowgl.exe”)) ;
   exec (change_sp(“./IMOtoWGL”)) ;
change_exe 関数を追加することに.


php の動作を確認していて,何かうまく動作しない.
と思ったら,「既定のドキュメント」の設定.


change_exe は,
  function change_exe ($path) {
     $exe = $path ;
     if (DIRECTORY_SEPARATOR == ‘/’) { $exe = strtolower($exe) ; }
     else { $exe = $exe . “.exe” ; }
     $exe = str_replace (“/”,DIRECTORY_SEPARATOR,$exe) ;
     return $exe ;
     }


さらに実行ファイルの場所も,相対位置ではなく change_cmd 内で求める様に変更.
 <?php
   include ($_SERVER[“DOCUMENT_ROOT”] . “/…/i_lib.php”) ;
 // exec (change_sp(“./bin/DrawNow”)) ;
   exec (change_cmd(“DrawNow”)) ;
   readfile(“./drawnow.htm”) ;
   ?>
動作は,DrawNow

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

IIS+PHP-2

先日 php のインクルードなどに PHP_OS を利用していたが,
  $base = “/…/web” ;
  if (PHP_OS == ‘WINNT’) { $base = “c:/…/web” ; }
  else { $base = “/…/web” ; }
  include ($base . “/_lib/…/log.php”) ;
$_SERVER[“DOCUMENT_ROOT”] を見つけたので,
  include ($_SERVER[“DOCUMENT_ROOT”] . “/_lib/…/log.php”) ;


他に,実行ファイルは OS に合った指定が必要な様で,
 <?php
   include ($_SERVER[“DOCUMENT_ROOT”] . “/…/log.php”) ;
   logging () ;
   exec (change_sp(“./bin/DrawNow”)) ;
   // …
   ?>
Synology/DrawNow/

IIS 7/DrawNow/

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

DS115j 3D データ読込

今度は,imo(obj を拡張した 3D データ)の読込み.


次の様なコードで …/…imo  -nan -nan -nan となってしまう.
   GonsA ga = ::OBJ_ToGonsA(imoFile.c_str()) ;
   std::tout << imoFile << _T("\t") ;
   std::tout << ::V3_To_tstring(::GonsA_GetVolume(ga)) << std::endl ;


単純に読込んで,保存するのは OK .
   v_tstring txtAry = ::LoadTextFile(imoName.c_str()) ;
   ::SaveTextFile((imoName+_T(“.mox”)).c_str(),txtAry) ;
3D データとして取り込み,出力すると,全体的に -nan や nan となる.
   GonsA gt = ::OBJ_ToGonsA(imoName.c_str()) ;
   ::GonsA_ToOBJ(gt,_T(“./7_boxes.mox”)) ;


次の様にすると
   long v1 = ::ttoi4(_T(“10”)) ;
   long v2 = ::ttoi4(_T(“10 “)) ;
   long v3 = ::ttoi4(_T(“10.5”)) ;
   double f1 = ::ttof (_T(“10”)) ;
   double f2 = ::ttof (_T(“10 “)) ;
   double f3 = ::ttof (_T(“10.5”)) ;
   double d1 = ::ttod (_T(“10”)) ;
   double d2 = ::ttod (_T(“10 “)) ;
   double d3 = ::ttod (_T(“10.5”)) ;
   Vl3 v(v1,v2,v3) ;
   Vd3 f(f1,f2,f3) ;
   Vd3 d(d1,d2,d3) ;
   std::tout << ::V3_To_tstring(v) << std::endl ;
   std::tout << ::V3_To_tstring(f) << std::endl ;
   std::tout << ::V3_To_tstring(d) << std::endl ;
本来は,
  10 10 10
  10 10 10.5
  10 10 10.5
DS115j では,
  10 10 10
  0 0 0
  -nan -nan -nan


内部的に呼んでいるのは,strtol と strtod など.


2017/06/20
atof も同様.
sscanf を利用することで対応.
  double ttod_scan (LPCTSTR str) {
     double value = 0 ;
     sscanf(str,_T(“%lg”),&value) ;
     return value ;
     }
 
原因と言うか対応は次の内容と同じなのかとは思うが,
 個人的に理解できるレベルには達していない.
Armadillo-840でstrtodを使った浮動小数点文字列の変換が出来ない

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

DSM 更新で…

DSM を更新した影響か? g++ などが通らなくなってしまった.


sudo -i
 
mkdir -p /volume1/@entware-ng/opt
ln -sf /volume1/@entware-ng/opt /opt
 
wget -O - http://pkg.entware.net/binaries/armv7/installer/entware_install.sh | /bin/sh
 
root@DS115j:/etc# cat rc.local
#!/bin/sh
#
/bin/ln -sf /volume1/@entware-ng/opt /opt
/opt/etc/init.d/rc.unslung start
#
 
/root/.profile
. /opt/etc/profile
 
reboot

sudo -i
opkg -v


また,更新してしばらく?は,何か動作が安定していない気がする.
php や c++ での動作が何か変?

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

IIS+PHP

先週まで DS115j 上の PHP と exe環境を作っていたが,今度は IIS 上の PHP .
次の所を参考にさせてもらった.
 Windows 8/7/Vista に PHP をインストール
 IIS での PHP Web サイトの構成
以前の Win7 に IIS を入れた環境に設定.


PHP がうまく動作しているかの確認は,
 コマンドプロンプトで,php -v や php -r “phpinfo() ;” .

 次の内容を php として保存し,ブラウザで開く.
  <?php phpinfo(); ?>


DS115j 上で動かしたものと同等の日時の表示は,何とか動作する様になった.
ほとんどが C++ のコードなので,今回の範囲ではあまり変更はなかった.
ただ exe を呼出す PHP のパスの指定や %TMP% にあたる部分がいろいろとありそう.
パス区切りは,’/’,’\’,’\\’ などで動作するみたいだが完全なのは ‘\\’ か?
ハードコードの部分は ‘/’ として PHP_OS により ‘\\’ に変換する関数を用意する.
 コードは次の様なもの.
   function Path_Normalize ($path_) {
     $path = $path_ ;
     if (PHP_OS == ‘WINNT’) {
       $path = str_replace (“/”,DIRECTORY_SEPARATOR,$path) ;
       }
     return $path ;
     }


単に,str_replace で良さそう.
  $path = str_replace (“/”,DIRECTORY_SEPARATOR,$path) ;
c の関数マクロの様な使い方はわからなかったので,change_sp($path) の関数とした.
さらに,php ファイルのインクルードは次の様な感じで振り分け.
   if (PHP_OS == ‘WINNT’) {
     include (“./lib.php”) ;
     }
   else {
     include (“/…/i_lib/2017.06/lib.php”) ;
     }


用途によっては,realpath でもいける?

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

DS115j Web での日本語

DS115j の標準出力をブラウザで表示すると,日本語部分が表示できない.


コードはこんな感じ.

  #include	"i_DrawLg.hxx"
  #include	<iostream>
  int	_tmain	(int argc,TCHAR* argv[])
  {
	_tsetlocale(LC_ALL,_T("")) ;
	tstring	orgCode1 = _T("ostrstream-%E3%81%AE%E5%88%A9%E7%94%A8%E3%81%A7%E3%83%A1%E3%83%A2%E3%83%AA%E3%83%AA%E3%83%BC%E3%82%AF/") ;
	tstring	orgCode2 = _T("url=http%3A%2F%2Fiwao.synology.me%2Fwordpress%2Fdev%2F2011%2F12%2F01%2Fvirtual-pc-%25E3%2581%258C%25E9%2581%2585%25E3%2581%2584%2F&usg=AFQ") ;
	tstring	deco_1_1 = ::PL_Decode_url(orgCode1) ;
	tstring	deco_2_1 = ::PL_Decode_url(orgCode2) ;
	tstring	deco_1_2 = ::PL_Decode_url(deco_1_1) ;
	tstring	deco_2_2 = ::PL_Decode_url(deco_2_1) ;
	std::tout <<    tstring(orgCode1.c_str()) << std::endl ;
	std::tout <<  ::UTF8_To(deco_1_1.c_str()) << std::endl ;
	std::tout <<  ::UTF8_To(deco_1_2.c_str()) << std::endl ;
	std::tout <<    tstring(orgCode2.c_str()) << std::endl ;
	std::tout <<  ::UTF8_To(deco_2_1.c_str()) << std::endl ;
	std::tout <<  ::UTF8_To(deco_2_2.c_str()) << std::endl ;
	return	0 ;
	}

コンソールでの出力 Iwao@DS115j:~/www/T_php/temp/test/DecodeU$ Iwao@DS115j:~/www/T_php/temp/test/DecodeU$ php index.php <pre> ostrstream-%E3%81%AE%E5%88%A9%E7%94%A8%E3%81%A7%E3%83%A1%E3%83%A2%E3%83%AA%E3%83%AA%E3%83%BC%E3%82%AF/ ostrstream-の利用でメモリリーク/ ostrstream-の利用でメモリリーク/ url=http%3A%2F%2Fiwao.synology.me%2Fwordpress%2Fdev%2F2011%2F12%2F01%2Fvirtual-pc-%25E3%2581%258C%25E9%2581%2585%25E3%2581%2584%2F&usg=AFQ url=http://iwao.synology.me/wordpress/dev/2011/12/01/virtual-pc-%E3%81%8C%E9%81%85%E3%81%84/&usg=AFQ url=http://iwao.synology.me/wordpress/dev/2011/12/01/virtual-pc-が遅い/&usg=AFQ </pre> Iwao@DS115j:~/www/T_php/temp/test/DecodeU$
ブラウザでの出力 ostrstream-%E3%81%AE%E5%88%A9%E7%94%A8%E3%81%A7%E3%83%A1%E3%83%A2%E3%83%AA%E3%83%AA%E3%83%BC%E3%82%AF/ ostrstream- ostrstream- url=http%3A%2F%2Fiwao.synology.me%2Fwordpress%2Fdev%2F2011%2F12%2F01%2Fvirtual-pc-%25E3%2581%258C%25E9%2581%2585%25E3%2581%2584%2F&usg=AFQ url=http://iwao.synology.me/wordpress/dev/2011/12/01/virtual-pc-%E3%81%8C%E9%81%85%E3%81%84/&usg=AFQ url=http://iwao.synology.me/wordpress/dev/2011/12/01/virtual-pc-

どこかの設定の問題とは思うが,場所がわからない.
それとも,変換がかかる部分を NOP とすべきか?


2017/06/02
Linux の場合 UTF8 となっていると思うので,::UTF8_To をしなくても良いはず.
Windows の場合は,tstring への変換(UTF8 から S-JIS または UTF16)が必要.
UTF8_To を _MSC_VER で振り分ける様に修正.


と思ってやって,上のコードではクリアしたが,
他にもうまくないコードがある様で,drawlog.htm が途中で切れている.
(/tmp/…/i_Tools.tmp/…/dump.txt は意図したデータで出力されている)


html 出力 (HtmOut::Export) の ::SaveUTF8 から呼んでいる ::To_UTF8 も同様に修正.
Windows の場合は,tstring (S-JIS または UTF16)から UTF8 の変換が必要.

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

Synology g++ DrawLog.cpp

前回 mac 上で動作する様にしたものを DS115j に.
CPATH などの設定も mac と同じ様な感じで指定.


php から呼び出し,実行ファイルが起動していることは確認できていた.
 DSM の「リソース モニタ」-「プロセス」で確認.
が,結果が正しく表示されない.
ssh で接続しての起動では正しく動作している.
原因は,デバッグ用にデータをダンプしていたディレクトリのアクセス権の設定.
書き込み可能にして OK

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

ubuntu 環境の再設定

mac 上の仮想マシンに入れた ubuntu
暫く使ってなかったので,LAN 環境などが当時の古いまま.
ubuntu は昨日更新して 16.04 LTS .
外にアクセスするルートは DHCP が使えるが,もう一つの LAN はDHCP サーバがない.
Win PC や mac からは特に問題なく使えてたが,ubuntu は安定しない?
IP を固定することで対応.
「接続を編集する…」-「編集」-「IPv4設定」で,169.254.xx.xx ,255.255.0.0 と指定.


WSS,WD Cloud,DS115j などにアクセス可能となった.
IIS など Web サーバは,IP でないと接続できないものもあり.

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

sh でエラー

sh を作成して実行すると,
  iwao@VB-Ubuntu:~/Documents$ sh mount_error.sh
  mount_error.sh: 1: mount_error.sh: sudo: not found
以前作成したものと比較したが,Ubuntu 上では見分けがつかなかった.
Windows 環境にコピーして,MIFES で開くとそれぞれで文字コードが異なる.
エラーになる sh をバイナリで開くと,EF BB BF が付加されていた.
どうも Ubuntu 上で利用したツールで,保存時に UTF-8 BOM 付としてしまったみたい.

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

Ubuntu で include

プラットフォームに依存しない C++ コードのコンパイルのテストなどを目的に,Ubuntu 環境に設定中…
MonoDevelop で,プロジェクトごと?のインクルードパスの設定は見つけた.
  メニューの「プロジェクト」の一番下に「~のオプション」.
  「ビルド」-「コード生成方法」-「パス」のタブ.
テストしたい(共通の)コードはネットワーク上にあるので,WinXP 上の Eclipse では,環境変数を利用していた.
  DEVXP_SRC=\\DevXP\C_Drive\~\Develop\_.SRC
  C_INCLUDE_PATH=%DEVXP_SRC%\__CPR_:~
  CPLUS_INCLUDE_PATH=%C_INCLUDE_PATH%
Mac では(Xcode では),設定がよくわからず,main.cpp にフルパスで書いていた.
  #include “/Volumes/C_Drive/~/_.SRC/Test/TestMem.cpp”


Linux ではマウントする必要があるみたいでここを参考にさせてもらって設定.
  この時,sudo mount -t smbfs //devxp/c_drive /mnt/~ で
    mount error: could not resolve address for devxp: Unknown error
  sudo mount -t smbfs //192.168.0.10/c_drive ~ で通る様になった.
MonoDevelop で,/mnt/DevXP/C_Drive/~ を指定してコンパイルが通る様になった.
また,Eclipse でもメニューの「プロジェクト」-「プロパティ」,「C/C++ 一般」-「パスおよびシンボル」に設定がある.


環境変数としての設定はちょっとわからず.やったとこまで.
  DEVXP_SRC=”/mnt/DevXP/C_Drive/Documents and Settings/~/_.SRC”
  ” または ‘ でくくる必要がある?
  ls などの時は,ls “$DEVXP_SRC”  (シングルクォーテーションではうまくないみたい).


2019/09/09
Linux から Windows 環境への接続
g++ インクルードパスの設定

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

Mono

ここを参考にさせてもらって,MonoDevelop をインストール.
C# のコンソールプロジェクトで作成したスケルトンのまま,ビルド,実行はすんなり動作した.
先日作成したフォームを塗りつぶすコードも,プロジェクトをそのままコピーして実行できる.
     private void Form1_Paint(object sender, PaintEventArgs e)
     {
       LinearGradientBrush brush = new LinearGradientBrush
            (ClientRectangle,Color.Green,Color.White,LinearGradientMode.ForwardDiagonal);
       e.Graphics.FillRectangle(brush,ClientRectangle);
     }
VisualC#.NET プログラミング入門にある AssemblyViewer も起動はしている.
機能の動作はエラーとなることもあるが,これはこの exe などの制限かもしれない.
VS 2005 で生成できる C# のスクリーン セーバ スタート キットも実行できる.
  /c で設定画面を表示して rss を指定しても,RSS の読込が正しく行われない?
   → と思ったが,やり直したら?正しく RSS が読めている.
     mono SSaveCS.exe [/c]


VB.NET のプロジェクトは生成できるが,ビルドしようとするとコンパイラがないとのエラー.
検索して,vbnc をインストール.
コンソール AP は通る様になったが,Windows フォームではコンパイルエラー?
  Application.Designer.vb
    Me.MainForm = Global.WinApVB.FormVB
      ’WinApVB.FormVB’ is a type and cannot be use as an expression.(VBNC30691)
    VB Windows フォームには対応していないのか?

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

su でパスワードが…

su でパスワードが入らない.
そもそも,いつどこで設定したのか記憶がない.
sudo でのパスワードは通る.
検索すると,
  [linux]Ubuntuは初期状態ではrootが使えない
  Ubuntu Linuxのルートパスワード

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.