2월, 2018의 게시물 표시

AWS Cloud, Python, Use sshtunneling to store rds data in a local database

1. config.py ----------------------------------------------------------------------- #SSH  Cloud username = 'ubuntu' pkey = './aws.pem' pkey_password = '' gateway_url = 'anonymous.compute.amazonaws.com' local_bind_address = '0.0.0.0' local_port = 3307 #AmazoneDB remote_bind_address = 'anonymous.rds.amazonaws.com' remote_db_user = 'USERID' remote_db_password = 'PASSWORD' remote_port = 3306 select_db = 'DATABASE' #LocalTestDB dev_host = '192.168.0.XXX' dev_user = 'USERID' dev_password = 'PASSWORD' dev_port = 3306 db_charset = 'utf8' insert_db = 'DATABASE' ''' use mysql create database DATABASENAME; grant all privileges on DATABASENAME.* to USERID@localhost identified by 'PASSWORD'; grant all privileges on DATABASENAME.* to USERID@'%' identified by 'PASSWORD'; flush privileges; quit; END''' ''' create table logs ( seq i

ubuntu, reinstall apache2

$ sudo apt-get -o DPkg::Options::="--force-confmiss" --reinstall install apache2 $ sudo apt-get purge apache2 $ sudo apt-get install apache2 $ netstat -ntlp | grep apache2

macOS tree 명령어 설치

$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install )" $ brew install tree

구글클라우드 루트 비밀번호 활성화

$ sudo passwd root $ vi /etc/ssh/sshd_config --- PermitRootLogin yes PasswordAuthentication yes --- $ service sshd restart

macOS, ubuntu 설치

1. 부팅이미지 다운로드 및 설치 http://refit.sourceforge.net/#download 2. 부팅이미지 등록 명령어 $ sudo sh / efi/refit/enable-aways.sh 3.우분투 이미지 usb 삽입 4. 재부팅 후 command + R 5. Boot EFI \boot\gubx64.efi from 선택 6. Install ubuntu 선택

command, ubuntu, crontab nano를 vim으로 변경

$cd /bin $ mv nano nano_must_die $ ln -s /usr/bin/vim nano

centOS, python설치

$ yum install python $ wget https://pypi.python.org/packages/source/d/distribute/distribute-0.7.3.zip $ unzip distribute-0.7.3.zip $ cd distribute-0.7.3 $ python setup.py install $ easy_install pip $ pip install tornado $ pip install redis $ pip install python-dateutil $ pip install argparse $ unzip RedisLive-master.zip $ cd /root/RedisLive-master/src $ cp redis-live.conf.example redis-live.conf $ vi redis-live.conf

command, centOS, sqlite설치

$ sqlite3 -version $ yum install sqlite3

command, centOS, gcc 설치

$ yum install -y gcc gcc-c++

command, centOS, yum 설치

$ yum clean all $ rpm --rebuilddb $ yum update $ yum install -y epel-release $ rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

command, centOS, sz/rz설치

$ yum install -y lrzsz

command, ubuntu, ssh서버설치

$ dpkg -l $ dpkg -l |grep ssh $ sudo apt-get install openssh-server $ netstat -ntl $ sudo /etc/init.d/ssh restart $ sudo vi /etc/ssh/sshd_config --- #Port 22 -> Port 22 ---