터미널동작을 처리하는 /bin/bash가 적용이 안되서 그렇다
보통 /etc/passwd에 설정을 잘못한경우
이건 위에거 보고 수정
계정별 profile이 제대로 안먹힌경우.
이건 다른계정보고 수정
수정하고 로그인하면 제대로 된다.
터미널동작을 처리하는 /bin/bash가 적용이 안되서 그렇다
보통 /etc/passwd에 설정을 잘못한경우
이건 위에거 보고 수정
계정별 profile이 제대로 안먹힌경우.
이건 다른계정보고 수정
수정하고 로그인하면 제대로 된다.
작업중 필요없어져서 삭제하려다가 저장
Xml 이용해서 정보 저장하는코드. 오브젝트 네임을 바꿨는데 이 과정에서 오류가 약간 있을수도..
import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; import org.w3c.dom.Attr; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.xml.sax.SAXException; public class SchoolDao { private final Document document; private final Node root; private final File file; public SchoolDao() throws ParserConfigurationException, FileNotFoundException, SAXException, IOException { this("conf", "server.xml"); } public SchoolDao(String filePath, String fileName) throws ParserConfigurationException, FileNotFoundException, SAXException, IOException { file = new File(filePath, fileName); if (file.exists() && file.isFile()) { document = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new FileInputStream(file)); root = document.getFirstChild(); } else { document = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument(); root = document.createElement("root"); document.appendChild(root); new File(filePath).mkdirs(); file.createNewFile(); } } public void addSchool(SchoolObject so) { Node school = document.createElement("server"); addNode(school, "name", so.getName()); addNode(school, "score", so.getScore()); root.appendChild(school); } private void addNode(Node parent, String nodeName, String nodeContent){ Node tmpNode; // Attr tmpAttr; tmpNode = document.createElement(nodeName); tmpNode.setTextContent(nodeContent); // ((Element)tmpNode).setAttributeNode(tmpAttr); parent.appendChild(tmpNode); } public void write() throws TransformerException { TransformerFactory transformerFactory = TransformerFactory.newInstance(); Transformer transformer = transformerFactory.newTransformer(); DOMSource source = new DOMSource(document); StreamResult result = new StreamResult(file); transformer.transform(source, result); // Output to console for testing StreamResult consoleResult = new StreamResult(System.out); transformer.transform(source, consoleResult); } public static void main(String[] args) throws FileNotFoundException, ParserConfigurationException, SAXException, IOException, TransformerException { SchoolDao dao = new SchoolDao(); SchoolObject so = new SchoolObject("schoolname"); so.setScore(100); dao.addHost(so); dao.write(); } }
우분투 로그인하니까 you’ve got mail..
또 무슨 오류가?
cat /var/mail/root
........ ........ .......... run-parts: failed to exec /etc/cron.hourly/readweb: Exec format error run-parts: /etc/cron.hourly/readweb exited with return code 1
써있는대로… 실행이 안되서 오류가 났다고 하는건데
readweb 스크립트는 curl을 이용해서 특정 웹페이지를 저장하는 역할을 한다
검색을 해 보니
http://askubuntu.com/questions/264607/bash-script-not-executing-from-crontab
원인은 cron에는 path를 잡아주지 않기 때문에 실행명령어를 full path로 적어주거나 path를 따로 잡아줘야함
해결책 :
/usr/bin/curl 처럼 full path로 쓰거나
PATH=/usr/bin
를 잡아줘야하는데…
그냥 명령어를 full path로 명시하는게 낫지 않을까
비밀번호 저장에 특화된 암호화로 매 실행시마다 값이 변경된다.
글자수 제한이 있는것이 특징
자세한건 검색으로
테스트코드 첨부
public static void main(String[] args){ BCryptPasswordEncoder encoder1 = new BCryptPasswordEncoder(); String seed1 = "012345678901234567890123456789"; String result1 = encoder1.encode(seed1); System.out.println(result1); String seed2 = "01234567890123456789012345678901234567890123456789012345678901234567890"; String result2 = encoder1.encode(seed2); System.out.println(result2); String seed3 = "012345678901234567890123456789012345678901234567890123456789012345678901";//최대글자수 String result3 = encoder1.encode(seed3); String seed4 = "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"; System.out.println(result3); System.out.println(); System.out.println(encoder1.matches(result1, seed1)); System.out.println(encoder1.matches(seed1, result1)); System.out.println(encoder1.matches(seed2, result2)); System.out.println(encoder1.matches(seed3, result3)); System.out.println(encoder1.matches(seed4, result3)); }