-
db 생성Flower in my dev/SQLite3 2015. 4. 8. 10:34
명령 뒤에 db명을 적어주면 끝 하지만 아무작업을 안하면 db가 생성이 안된다는 것 sqlite3 test.db 아무 테이블이나 만들어주기. create table account( id integer primary key, pw integer not null ); 초기 데이터를 넣고 확인 insert into account(id, pw) values('1234', '5678'); select * from account; 결과를 보기 힘들면 .header on .mode column 그리고 다시 select * from account;
-
sqlite3 설치Flower in my dev/SQLite3 2015. 4. 8. 10:22
해당 사이트에서 버전 확인 http://sqlite.org/download.html 해당파일의 속성에서 파일 이름만 wget http://www.sqlite.org/붙여넣기 ex) wget http://www.sqlite.org/sqlite-autoconf-3080803.tar.gz 소스파일을 다운받고 압축을 풀려고 하니 gzip: stdin: not in gzip format tar: Child returned status 1 tar: Error is not recoverable: exiting now 위와 같은 에러 발생... 안풀려서 버전다운... wget http://www.sqlite.org/sqlite-autoconf-3070603.tar.gz 그리고 순차적으로 ./configure make ..
-
파일전송 scp, rsyncFlower in my ops/Linux 2015. 4. 7. 17:31
*scp 파일 보내기 scp test.txt flower@192.168.0.100.80:/home/flower 파일 가져오기 scp -r flower@192.168.0.100.80:/home/flower/test.txt /var/www/ *rsync 파일 보내기 rsync -avz test/ root@192.168.0.101:/home/ 파일 가져오기 rsync -avzh root@192.168.0.100:/home/tarunika/rpmpkgs /tmp/myrpms 파일과 경로는 자리만 바꿔주면 되고 옵션만 잘 써주면 문제없이 잘됨.
-
<PYTHON>SQLite3 접속Flower in my dev/Python 2015. 4. 6. 14:29
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 import sqlite3 con = sqlite3.connect("test.db") cursur = con.cursor() data = [(1, "Korea"), (2, "USA"), (3, "China"), (4, "Japan")] cursor.execute("create table world(no, nation)") cursor.executemany("insert into world values(?,?)", data) print 'Last rowid:' + str(cursor.lastrowid) print 'Row count:' + str(cursor.rowcount) c..
-
<PYTHON>PostgreSql 접속Flower in my dev/Python 2015. 4. 6. 14:10
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 import psycopg2 conn_string = "dbname = 'testDB' user='flower' host = 'localhost' password = 'qwe123'" try: conn = psycopg2.connect(conn_string) except: print "error database connection" cur = conn.cursor() sql_string = "SELECT datname FROM pg_database" cur.execute(sql_string) result = cur.fetchall() print "\nShow me the databases:\n" for row in rows: pr..
-
PostgreSQL 설치 -> DB 생성Flower in my dev/PostgreSQL 2015. 4. 6. 11:45
On CentOS 6.6 yum -y install postgresql-server service postgresql initdb service postgresql start cd /var/lib/pgsql/data/ vi pg_hba.conf vi postgresql.conf service postgresql restart iptables -A INPUT -p tcp --sport 5432 -j ACCEPT service iptables restart su - postgres psql postgres alter user postgres password 'qwe123' create user flower with password 'qwe123'; create database testDB with encod..
-
<PYTHON>vim configFlower in my dev/Python 2015. 4. 6. 09:58
[Oh my zsh ~/.zshrc] # If you come from bash you might have to change your $PATH. # export PATH=$HOME/bin:/usr/local/bin:$PATH # Path to your oh-my-zsh installation. export ZSH="/Users/flower/.oh-my-zsh" export PATH="/usr/local/sbin:$PATH" export PYENV_ROOT="$HOME/.pyenv" export PATH="$PYENV_ROOT/bin:$PATH" export IPADDR="ifconfig en0 | grep inet | grep -v inet6 | cut -d ' ' -f2" export IPDNS="c..