Search

'설정'에 해당되는 글 4건

  1. 2019.02.22 리눅스 미러사이트 설정
  2. 2017.02.28 Java Applet 설정
  3. 2016.11.07 임계영역 설정 Ctirical Section
  4. 2013.12.02 CISCO packet tracer VPN client 설정

리눅스 미러사이트 설정

Server/Linux Server 2019. 2. 22. 10:57 Posted by TanSanC
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

칼리리눅스 미러사이트 설정






apt-get update 시 미러사이트가 설정되어 있지 않아 정상적으로 수행되지 않는 경우가 있다.




그런 경우 미러사이트를 설정하는 방법





1.  /etc/apt/sources.list 파일을 열기


vi /etc/apt/sources.list







2. 미러사이트 설정



deb http://us.archive.ubuntu.com/ubuntu/ trusty main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty main restricted



참고 : https://zetawiki.com/wiki//etc/apt/sources.list





3. 참고용 미러사이트 


CentOS


카이스트 : http://ftp.kaist.ac.kr/CentOS/

다음 : http://ftp.daum.net/centos/

네오위즈 : http://ftp.neowiz.com/centos/

네이버 : http://mirror.navercorp.com/centos


우분투



  카이스트 :  http://kr.archive.ubuntu.com/ubuntu-releases/

  다음 :  http://ftp.daum.net/ubuntu-releases/

  네오위즈 : http://ftp.neowiz.com/ubuntu-releases/








'Server > Linux Server' 카테고리의 다른 글

CentOS 리눅스 USB 부팅  (2) 2013.04.29

Java Applet 설정

Programming/JAVA,JSP 2017. 2. 28. 12:58 Posted by TanSanC
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

Java Applet 설정





Java Applet 구동 시





Apache 서버에




AmitApplet.java 를 AmitJavaApplication.jar 로 Export(Java->JAR file) 한다.


package test.Amit;

import java.awt.BorderLayout;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.Map;

import javax.swing.JApplet;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextArea;
import javax.swing.JTextField;

public class AmitApplet extends JApplet {

	public void init() {

		try {
			for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
				if ("Nimbus".equals(info.getName())) {
					javax.swing.UIManager.setLookAndFeel(info.getClassName());
					break;
				}
			}
		} catch (ClassNotFoundException ex) {
			java.util.logging.Logger.getLogger(AmitApplet.class.getName()).log(java.util.logging.Level.SEVERE, null,
					ex);
		} catch (InstantiationException ex) {
			java.util.logging.Logger.getLogger(AmitApplet.class.getName()).log(java.util.logging.Level.SEVERE, null,
					ex);
		} catch (IllegalAccessException ex) {
			java.util.logging.Logger.getLogger(AmitApplet.class.getName()).log(java.util.logging.Level.SEVERE, null,
					ex);
		} catch (javax.swing.UnsupportedLookAndFeelException ex) {
			java.util.logging.Logger.getLogger(AmitApplet.class.getName()).log(java.util.logging.Level.SEVERE, null,
					ex);
		}
		// 

		try {
			java.awt.EventQueue.invokeAndWait(new Runnable() {
				public void run() {
					initComponents();
				}
			});
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}

	private void initComponents() {

		// String defaultCmd = "\\\\192.168.10.17\\tt\\notepad.exe";
		final String defaultCmd = "notepad.exe test.jsp";
		commandTextField = new JTextField();
		logTextArea = new JTextArea();
		runtimeButton = new JButton("getRuntime");
		processBuilderButton = new JButton("processBuilder");
		JPanel topPanel = new JPanel();

		setLayout(new BorderLayout());

		topPanel.setLayout(new GridLayout(4, 1));
		topPanel.add(new JLabel("Command"));
		topPanel.add(commandTextField);
		topPanel.add(runtimeButton);
		topPanel.add(processBuilderButton);
		add(BorderLayout.NORTH, topPanel);
		add(BorderLayout.CENTER, logTextArea);

		runtimeButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				// TODO Auto-generated method stub
				if (commandTextField.getText().length() == 0) {
					try {
						Runtime.getRuntime().exec(defaultCmd);
					} catch (Exception e1) {
						// TODO Auto-generated catch block
						logTextArea.setText(e1.getMessage());
						e1.printStackTrace();
					}
				} else {
					try {
						Runtime.getRuntime().exec(commandTextField.getText());
					} catch (Exception e1) {
						// TODO Auto-generated catch block
						logTextArea.setText(e1.getMessage());
						e1.printStackTrace();
					}
				}
			}
		});
		processBuilderButton.addActionListener(new ActionListener() {
			public synchronized void actionPerformed(ActionEvent e) {
				// TODO Auto-generated method stub
				if (commandTextField.getText().length() == 0) {

					try {
						ProcessBuilder launcher = new ProcessBuilder();
						Map environment = launcher.environment();
						launcher.redirectErrorStream(true);
						launcher.directory(new File("\\\\192.168.10.17\\tt\\"));

						// environment.put("test.jsp", defaultCmd);
						launcher.command("notepad.exe");
						Process p = launcher.start(); // And launch a new
														// process

					} catch (Exception e2) {
						logTextArea.setText(e2.getMessage());
						e2.printStackTrace();
					}
				} else {
					try {
						ProcessBuilder pb = new ProcessBuilder(commandTextField.getText());
						pb.start();

					} catch (Exception e1) {
						// TODO Auto-generated catch block
						logTextArea.setText(e1.getMessage());
						e1.printStackTrace();
					}
				}
			}
		});
	}

	@SuppressWarnings("unchecked")
	public void launchScript(String cmd, String args) {
		try {
			System.out.println("args value : = " + args);
			System.out.println("cmd value : = " + cmd);
			System.out.println("Full command:  = " + cmd + " " + args);
			if (cmd != null && !cmd.trim().equals("")) {
				if (args == null || args.trim().equals("")) {
					final String tempcmd = cmd;
					AccessController.doPrivileged(new PrivilegedAction() {
						public Object run() {
							try {
								Runtime.getRuntime().exec(tempcmd);
							} catch (Exception e) {
								System.out.println("Caught exception in privileged block, Exception:" + e.toString());
							}
							return null; // nothing to return
						}
					});
					System.out.println(cmd);
				} else {
					final String tempargs = args;
					final String tempcmd1 = cmd;
					AccessController.doPrivileged(new PrivilegedAction() {
						public Object run() {
							try {
								Runtime.getRuntime().exec(tempcmd1 + " " + tempargs);
							} catch (Exception e) {
								System.out.println("Caught exception in privileged block, Exception:" + e.toString());
							}
							return null; // nothing to return
						}
					});
					System.out.println(cmd + " " + args);
				}
			} else {
				System.out.println("execCmd parameter is null or empty");
			}
		} catch (Exception e) {
			System.out.println("Error executing command --> " + cmd + " (" + args + ")");
			System.out.println(e);
		}
	}

	JButton runtimeButton;
	JButton processBuilderButton;
	JTextField commandTextField;
	JTextArea logTextArea;
}






test.jsp 를 준비한다.




<%@page contentType="text/html" pageEncoding="UTF-8"%>

<!DOCTYPE html>

<html>

    <head>

        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

        <title>My first WebApplication using NetBeansIDE</title>

    </head>

    <body>

        <h1>Hello World!</h1>

        <br />

        <p>WebApplication using NetBeansIDE...</p>

        

        <!-- Embedding Applet -->

<applet code="test.Amit.AmitApplet" archive="AmitJavaApplication.jar" width="400" height="350"></applet>

    </body>

</html>









Apache 는 Apache 비트에 맞는 Java 를 연결시키고


Applet 은 32비트에서 돌아간다

(컴퓨터에 32비트 Java JRE가 설치되어 있어야한다.)








Apache ROOT 폴더의 구조






Config















임계영역 설정 Ctirical Section

Programming/C,CPP,CS 2016. 11. 7. 11:07 Posted by TanSanC
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

임계영역 설정 Ctirical Section








CreateMutex
Critical Section Objects
DeleteCriticalSection
EnterCriticalSection
InitializeCriticalSectionAndSpinCount
LeaveCriticalSection
Synchronization Functions
TryEnterCriticalSection






void WINAPI InitializeCriticalSection( LPCRITICAL_SECTION lpCriticalSection );

void WINAPI DeleteCriticalSection( LPCRITICAL_SECTION lpCriticalSection );

void WINAPI EnterCriticalSection( LPCRITICAL_SECTION lpCriticalSection );

void WINAPI LeaveCriticalSection( LPCRITICAL_SECTION lpCriticalSection );

BOOL WINAPI TryEnterCriticalSection( LPCRITICAL_SECTION lpCriticalSection );








1. 임계영역 변수선언

CRITICAL_SECTION cs;


2. 초기화

InitializeCriticalSection( &cs );


3. 사용


임계영역 진입

EnterCriticalSection( &cs );


임계영역 탈출

LeaveCriticalSection( &cs );


4. 삭제

DeleteCriticalSection( &cs );






CISCO packet tracer VPN client 설정

CiscoNetwork 2013. 12. 2. 17:16 Posted by TanSanC
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

aaa new-model

aaa authentication login GROUPNAME local

aaa authorization network GROUPNAME local

username USERNAME password 0 PASSWORD


crypto isakmp policy 1

 encr 3des

 authentication pre-share

 group 2


crypto isakmp client configuration group GROUPNAME

key KEYVALUE

pool IPPOOL


crypto ipsec transform-set TRANSFORMSETNAME esp-3des esp-md5-hmac


crypto dynamic-map DYNAMICMAPNAME 10

set transform-set TRANSFORMSETNAME

reverse-route


crypto map CLIENTMAP client authentication list GROUPNAME

crypto map CLIENTMAP isakmp authorization list GROUPNAME

crypto map CLIENTMAP client configuration address respond

crypto map CLIENTMAP 10 ipsec-isakmp dynamic DYNAMICMAPNAME


원하는 인터페이스

crypto map CLIENTMAP


ip local pool IPPOOL 172.16.12.100 172.16.12.120



클라이언트 접속시

GROUPNAME

KEYVALUE

router ip

USERNAME

PASSWORKD



'CiscoNetwork' 카테고리의 다른 글

Domain, WorkGroup ?  (0) 2016.03.07
ipTIME 공유기 포트 미러링 지원 제품 및 설정방법  (0) 2015.09.16
UTP5 cables PPT  (0) 2013.04.29
시스코 라우터 디폴트 값 확인 사이트  (0) 2013.01.25
실습장비 관련 정보  (0) 2013.01.25