<< 前のページ
2012年4月18日(水) 21:02
# fdisk /dev/sda The number of cylinders for this disk is set to 243201. There is nothing wrong with that, but this is larger than 1024, and could in certain setups cause problems with: 1) software that runs at boot time (e.g., old versions of LILO) 2) booting and partitioning software from other OSs (e.g., DOS FDISK, OS/2 FDISK) Command (m for help):p Disk /dev/sda: 2000.3 GB, 2000398934016 bytes 255 heads, 63 sectors/track, 243201 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 1 18446744073709527403 18446744073515049824 83 Linux Command (m for help):
# mke2fs -j /dev/sda1 # mkswap /dev/sda2
# mkdir /mnt2 # mount /dev/sda1 /mnt2
# cd /mnt # tar cf - . | (cd /mnt2;tar xvf -)
# fdisk -l /dev/hda
Disk /dev/hda: 2000.3 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 1 18446744073709527403 18446744073515049824 83 Linux
/dev/hda2 243136 243201 530145 82 Linux swap
# df
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/ram 11895 9505 2390 80% /
/dev/hda1 1922336432 575110640 1249576700 32% /mnt
# hdparm -i /dev/hda
/dev/hda:
Model=Hitachi HDS5C3020ALA632, FwRev=ML6OA800, SerialNo=XXXXXXXXXXXXXX
Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs }
RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=56
BuffType=DualPortCache, BuffSize=26129kB, MaxMultSect=16, MultSect=16
CurCHS=16383/16/63, CurSects=-66060037, LBA=yes, LBAsects=268435455
IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
PIO modes: pio0 pio1 pio2 pio3 pio4
DMA modes: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 udma5 *udma6
written by sirius [その他] [この記事のURL] [コメントを書く] [コメント(0)] [TB(0)]
2011年7月30日(土) 19:41
written by sirius [その他] [この記事のURL] [コメントを書く] [コメント(0)] [TB(0)]
2011年4月4日(月) 20:27
written by sirius [その他] [この記事のURL] [コメントを書く] [コメント(0)] [TB(0)]
2011年4月1日(金) 20:44
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0"
metadata-complete="true">
<display-name>MySQL Test</display-name>
<description>
MySQL Test
</description>
<servlet>
<servlet-name>Testservret</servlet-name>
<servlet-class>Testservret</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Testservret</servlet-name>
<url-pattern>/MySQL</url-pattern>
</servlet-mapping>
</web-app>
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.sql.DriverManager;
import java.sql.Connection;
import java.sql.Statement;
import java.sql.ResultSet;
public class Testservret extends HttpServlet {
Connection con = null;
Statement objSql= null;
ResultSet rs = null;
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException{
response.setContentType("text/html; charset=utf8");
PrintWriter out = response.getWriter();
out.println("<html>");
out.println("<head>");
out.println("<meta http-equiv=¥"Content-Type¥" content=¥"text/html; charset=utf8¥">");
out.println("<title>データベーステスト</title>");
out.println("</head>");
out.println("<body>");
out.println("<table border=1>");
try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
// データベースへ接続
con = DriverManager.getConnection("jdbc:mysql://localhost/local?characterEncoding=utf8","test_user","password");
con.setReadOnly(true);
// JDBC 問い合わせ SQL 作成
objSql = con.createStatement();
// SQL 問い合わせ
rs = objSql.executeQuery("select * from test_table");
while( rs.next() ) {
out.println("<tr><td>"+rs.getString("no")+"</td>");
out.println("<td>"+rs.getString("name")+"</td>");
out.println("<td>"+rs.getInt("score")+"</td></tr>");
}
con.close();
}catch (ClassNotFoundException e){
out.println("ドライバのロードに失敗しました");
}catch (Exception e){
out.println(e.getMessage());
}
out.println("</table>");
out.println("</body>");
out.println("</html>");
}
}
@echo off %~d0 cd "%~p0" set JAVA_HOME=%cd%¥jdk1.6.0_24 set CLASSPATH=%CLASSPATH%;%cd%¥apache-tomcat-7.0.8¥lib¥servlet-api.jar;. set PATH=%PATH%;%JAVA_HOME%¥bin cd apache-tomcat-7.0.8¥webapps cmd.exe
> cd Test¥WEB-INF¥classes > javac -encoding utf8 Testservret.java
written by sirius [その他] [この記事のURL] [コメントを書く] [コメント(0)] [TB(0)]
2011年3月30日(水) 20:52
mysql> grant all on *.* to test_user@localhost identified by "password"; Query OK, 0 rows affected (0.00 sec)
mysql> create database local collate utf8_general_ci; Query OK, 1 row affected (0.00 sec)
mysql> use local; Database changed mysql> set character set utf8; Query OK, 0 rows affected (0.00 sec) mysql> create table test_table(no char(8) primary key, name text not null, score int); Query OK, 0 rows affected (0.03 sec)
mysql> show fields from test_table; +-------+---------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------+---------+------+-----+---------+-------+ | no | char(8) | NO | PRI | NULL | | | name | text | NO | | NULL | | | score | int(11) | YES | | NULL | | +-------+---------+------+-----+---------+-------+ 3 rows in set (0.01 sec)
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf8"> <title>jsp のテスト</title> </head> <body> <ul> <li><a href="insert.jsp">レコードの追加</a> <li><a href="display.jsp">レコードの表示</a> <li><a href="MySQL">サーブレットの実行</a> </ul> </body> </html>
<html>
<head><title>全レコードの追加</title></head>
<%@ page language="java" contentType="text/html; charset=utf8" %>
<%@ page import="java.sql.*" %>
<body>
<%
Connection con = null;
Statement objSql= null;
int rs = 0;
try {
// MySQL JDBC Driverのロード
Class.forName("com.mysql.jdbc.Driver");
/* データベースへ接続 */
con = DriverManager.getConnection("jdbc:mysql://localhost/local?characterEncoding=utf8","test_user","password");
// ――――― コネクションに対する操作 ―――――
// JDBC 問い合わせ SQL 作成
objSql = con.createStatement();
// SQL 問い合わせ
rs += objSql.executeUpdate("insert into test_table (no, name, score) values('12345678', '漢字の名前', 0)");
rs += objSql.executeUpdate("insert into test_table (no, name, score) values('00000001', 'name of alpha', 0)");
rs += objSql.executeUpdate("insert into test_table (no, name, score) values('00000002', '斎藤 ・・', 0)");
rs += objSql.executeUpdate("insert into test_table (no, name, score) values('00000005', '赤城 ・・・', 0)");
rs += objSql.executeUpdate("insert into test_table (no, name, score) values('01010101', '湯沢 ・', 0)");
rs += objSql.executeUpdate("insert into test_table (no, name, score) values('11111111', '唐沢 ・・〜', 0)");
rs += objSql.executeUpdate("insert into test_table (no, name, score) values('23232323', '新庄 ・・', 0)");
rs += objSql.executeUpdate("insert into test_table (no, name, score) values('21212121', '赤松 ・・', 0)");
rs += objSql.executeUpdate("insert into test_table (no, name, score) values('55555555', '榊 ・', 0)");
rs += objSql.executeUpdate("insert into test_table (no, name, score) values('99999999', '横木 ・・・', 0)");
rs += objSql.executeUpdate("insert into test_table (no, name, score) values('00000000', '町田 ・・', 0)");
//接続をクローズ
con.close();
out.println("テーブルに"+rs+"レコード追加しました。");
}catch (ClassNotFoundException e){
out.println("ドライバのロードに失敗しました");
}catch (Exception e){
out.println(e.getMessage( ));
}
%>
</body>
</html>
<html>
<head><title>jsp のテスト</title></head>
<%@ page language="java" contentType="text/html; charset=utf8" %>
<%@ page import="java.sql.*" %>
<body>
<table border="2">
<tr><td>id</td><td>name</td><td>score</td></tr>
<%
Connection con = null;
Statement objSql= null;
ResultSet rs = null;
try {
// MySQL JDBC Driverのロード
Class.forName("com.mysql.jdbc.Driver");
/* データベースへ接続 */
con = DriverManager.getConnection ("jdbc:mysql://localhost/local?characterEncoding=utf8","test_user","password");
// ――――― コネクションに対する操作 ―――――
// 読みだすだけなので、読み込み専用にする。
con.setReadOnly(true);
// JDBC 問い合わせ SQL 作成
objSql = con.createStatement();
// SQL 問い合わせ
rs = objSql.executeQuery("select * from test_table");
while( rs.next() ) {
out.println("<tr><td>"+rs.getString("no")+"</td>");
out.println("<td>"+rs.getString("name")+"</td>");
out.println("<td>"+rs.getInt("score")+"</td></tr>");
}
//接続をクローズ
con.close();
}catch (ClassNotFoundException e){
out.println("ドライバのロードに失敗しました");
}catch (Exception e){
out.println(e.getMessage( ));
}
%>
</table>
</body>
</html>
written by sirius [その他] [この記事のURL] [コメントを書く] [コメント(0)] [TB(0)]
2011年3月29日(火) 20:56
cd ..¥mysql-6.0.11-alpha-win32 bin¥mysqld.exe --defaults-file=my.ini
@echo off %~d0 cd "%~p0" set PATH=%cd%¥bin;%PATH% mysql -uroot -p
mysql> select host,user from mysql.user;
+-----------+------+
| host | user |
+-----------+------+
| 127.0.0.1 | root |
| localhost | |
| localhost | root |
+-----------+------+
3 rows in set (0.00 sec)
mysql> set password for root@localhost=password('secret');
Query OK, 0 rows affected (0.00 sec)
mysql> set password for root@127.0.0.1=password('secret');
Query OK, 0 rows affected (0.00 sec)
mysql> drop user ""@localhost;
Query OK, 0 rows affected (0.01 sec)
mysql> select host,user from mysql.user;
+-----------+------+
| host | user |
+-----------+------+
| 127.0.0.1 | root |
| localhost | root |
+-----------+------+
2 rows in set (0.00 sec)
mysql>quit
@echo off %~d0 cd "%~p0" cd mysql-6.0.11-alpha-win32 bin¥mysqladmin.exe" -u root -p shutdown set JAVA_HOME=%cd%¥jdk1.6.0_24 cd ..¥apache-tomcat-7.0.8 bin¥shutdown.bat
written by sirius [その他] [この記事のURL] [コメントを書く] [コメント(0)] [TB(0)]
2011年3月14日(月) 20:21
written by sirius [その他] [この記事のURL] [コメントを書く] [コメント(0)] [TB(0)]
2011年3月9日(水) 23:06
@echo off %~d0 cd "%~p0" set JAVA_HOME=%cd%¥jdk1.6.0_24 set PATH=%JAVA_HOME%¥bin;%PATH% cd apache-tomcat-7.0.8 Call bin\startup.bat
<tomcat-users> <role rolename="manager-script"/> <role rolename="manager-jmx"/> <role rolename="manager-status"/> <role rolename="manager-gui"/> <user username="tomcat" password="tomcat" roles="manager-script,manager-jmx,manager-status,manager-gui"/> </tomcat-users>
written by sirius [その他] [この記事のURL] [コメントを書く] [コメント(0)] [TB(0)]
2011年2月20日(日) 18:38
written by sirius [その他] [この記事のURL] [コメントを書く] [コメント(0)] [TB(0)]
2011年2月19日(土) 20:50
written by sirius [その他] [この記事のURL] [コメントを書く] [コメント(0)] [TB(0)]
2011年2月7日(月) 21:03
written by sirius [その他] [この記事のURL] [コメントを書く] [コメント(0)] [TB(0)]
2011年1月3日(月) 20:46
written by sirius [その他] [この記事のURL] [コメントを書く] [コメント(0)] [TB(0)]
2010年12月22日(水) 23:30
written by sirius [その他] [この記事のURL] [コメントを書く] [コメント(0)] [TB(0)]
2010年12月21日(火) 23:15
written by sirius [その他] [この記事のURL] [コメントを書く] [コメント(0)] [TB(0)]
2010年11月1日(月) 12:31
written by sirius [その他] [この記事のURL] [コメントを書く] [コメント(0)] [TB(0)]
2009年7月28日(火) 23:33
INTERNET --- ルータ1 --- DMZ
+------- ルータ2 ---宅内LAN
INTERNET --- MZK-04G --- MZK-W04G
| | | | | | |
| | | | | | +--- HG-LAN
| | | | | +----- HUB1(5ポート,1000Base)
| | | | +------- HUB2(8ポート,1000Base)
| | | +----+---- HUB3(8ポート,1000Base)
| | | +-+-- HUB4(8ポート,100Base)
| | | +-- HBR-AG54
| | |
| | +---- Webサーバ
| +------ メールサーバ、NTP サーバ、DNS サーバ(キャッシュ)
+-------- PC
written by sirius [その他] [この記事のURL] [コメントを書く] [コメント(0)] [TB(0)]
2009年6月19日(金) 19:10
written by sirius [その他] [この記事のURL] [コメントを書く] [コメント(0)] [TB(0)]
2009年5月14日(木) 00:41
written by sirius [その他] [この記事のURL] [コメントを書く] [コメント(0)] [TB(0)]
2009年5月14日(木) 00:39
written by sirius [その他] [この記事のURL] [コメントを書く] [コメント(0)] [TB(0)]
2008年6月11日(水) 18:29
written by sirius [その他] [この記事のURL] [コメントを書く] [コメント(0)] [TB(0)]
<< 前のページ
MySketch 2.7.2 written by 夕雨