2012年1月30日(月) 18:57
written by sirius [玄箱] [この記事のURL] [コメントを書く] [コメント(0)] [TB(0)]
2012年1月29日(日) 21:04
| 玄箱/HG 1 号機: | 内向きサーバ(Fedora12) | → | 内向きサーバ(Fedora12) |
| 玄箱/HG 2 号機: | MP3 置き場(Fedora11) | → | 外向きのメールサーバ(Debian squeez) |
| 玄箱/HG 3 号機: | 外向きメールサーバ(MontaVista Linux) | → | 内向きサーバのバックア>ップ(Debian squeez) |
| HGLAN 1 号機: | TV 録画(今は使っていない) | → | MP3 置き場 |
| HGLAN 2 号機: | ISO 置き場(バックアップ) | → | 予備 |
| HLWG: | 予備 | → | 独立セグメントの無線ア>クセスポイント化 |
written by sirius [/Linkstation] [この記事のURL] [コメントを書く] [コメント(0)] [TB(0)]
2012年1月25日(水) 18:18
written by sirius [玄箱] [この記事のURL] [コメントを書く] [コメント(0)] [TB(0)]
2012年1月21日(土) 21:43
written by sirius [玄箱] [この記事のURL] [コメントを書く] [コメント(0)] [TB(0)]
2011年7月30日(土) 19:41
written by sirius [その他] [この記事のURL] [コメントを書く] [コメント(0)] [TB(0)]
2011年4月13日(水) 20:08
written by sirius [デジモノ] [この記事のURL] [コメントを書く] [コメント(0)] [TB(0)]
2011年4月5日(火) 22:01
written by sirius [Android] [この記事のURL] [コメントを書く] [コメント(4)] [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月31日(木) 20:17
@echo off set LOGDIR=C:¥inetpub¥logs¥LogFiles¥W3SVC1 set LOG=u_nc for %%i in (%LOGDIR%¥%LOG%????.log) do set LASTFILE=%%i for %%i in (%LOGDIR%¥%LOG%????.log) do if not %LASTFILE%==%%i set PREFILE=%%i C:¥webalizer-2.21-02-cygwin¥webalizer.exe -c C:¥webalizer-2.21-02-cygwin¥webalizer.conf -N 0 %PREFILE% C:¥webalizer-2.21-02-cygwin¥webalizer.exe -c C:¥webalizer-2.21-02-cygwin¥webalizer.conf %LASTFILE%
written by sirius [WindowsWebServer2008] [この記事の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月28日(月) 20:44
$ wget http://android.git.kernel.org/repo $ chmod 755 repo $ mv repo ~/bin/ $ mkdir mydroid $ cd mydroid $ repo init -u git://android.git.kernel.org/platform/manifest.git $ repo sync
written by sirius [Android] [この記事のURL] [コメントを書く] [コメント(4)] [TB(0)]
2011年3月27日(日) 13:08
written by sirius [デジモノ] [この記事のURL] [コメントを書く] [コメント(0)] [TB(0)]
2011年3月14日(月) 20:21
written by sirius [その他] [この記事のURL] [コメントを書く] [コメント(0)] [TB(0)]
MySketch 2.7.2 written by 夕雨