ftp -n 172.16.0.25 << EOF
user ftpuser 1111
passive
cd FTP
prompt
bin
mput ${thisDate}.tgz
quit
EOF

1. 문제점

Total download size: 63 M
Downloading packages:
No Presto metadata available for jenkins
warning: /var/cache/yum/x86_64/7/jenkins/packages/jenkins-2.235.3-1.1.noarch.rpm: Header V4 RSA/SHA512 Signature, key ID 45f2c3d5: NOKEY
Public key for jenkins-2.235.3-1.1.noarch.rpm is not installed
jenkins-2.235.3-1.1.noarch.rpm

 

2. 해결책

# wget -qO - https://pkg.jenkins.io/debian-stable/jenkins.io.key | apt-key add - 
# rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key

 

참고 : https://lovapi.tistory.com/173

1. 문제점

svn: E170013: Unable to connect to a repository at URL 'https://some.host/some/repo/'
svn: E120171: Error running context: An error occurred during SSL communication

 

2. 해결 방법

/usr/lib/ssl/openssl.cnf 파일을 다음과 같이 수정할 것

 

# 첫째 라인
openssl_conf = default_conf

.
.
.
# 끝라인
[ default_conf ]

ssl_conf = ssl_sect

[ssl_sect]

system_default = ssl_default_sect

[ssl_default_sect]
MinProtocol = TLSv1
CipherString = DEFAULT:@SECLEVEL=1

 

 

참고 : https://superuser.com/questions/1473219/subversion-error-svn-e120171-error-running-context-an-error-occurred-during

1. 문제점

VirtualBox환경 Linux에서 mount path 쓰기가 안될때

 

2. 해결 방법

sudo adduser 유저명 vboxsf

1. 백업

 

1.1 mysql 백업

 

- 기존 mysql 비밀번호 확인

# cat /opt/redmine-3.3.3-1/apps/redmine/htdocs/config/database.yml

production:
  adapter: mysql2
  database: bitnami_redmine
  host: localhost
  username: bitnami
  password: xxxxxxxxxx

 

- mysql 백업 파일 생성

# /opt/redmine-3.3.3-1/mysql/bin/mysqldump -u bitnami -p bitnami_redmine > backup.sql

 

1.2 redmine 데이터 파일 백업

# cd /opt/redmine-3.3.3-1/apps/redmine/htdocs
# tar zcvf files.tar.gz files

 

1.3 redmine 플러그인 백업

# cd /opt/redmine-3.3.3-1/apps/redmine/htdocs
# tar zcvf plugins.tar.gz plugins

2. 복구

 

1.1 신규 서버에 bitnami-redmine 설치. 

 

- 설치 바이너리 다운로드 (https://bitnami.com/stack/redmine/installer)

# wget https://downloads.bitnami.com/files/stacks/redmine/3.3.3-1/bitnami-redmine-3.3.3-1-linux-x64-installer.run

 

- 설치

# chmod 755 bitnami-redmine-3.3.3-1-linux-x64-installer.run
# ./bitnami-redmine-3.3.3-1-linux-x64-installer.run

 

- 신규 서버의 http://xxx.xxx.xxx.xxx/redmine/phpmyadmin 외부 접근 가능하게 하기 위해 내 아이피를 추가

# vi /opt/redmine-3.3.3-1/apps/phpmyadmin/conf/httpd-app.conf

<IfVersion >= 2.3>
Require local
Require ip xxx.xxx.xxx.xxx
</IfVersion>

 

1.2 신규 서버의 mysql 비밀번호 확인

# cat /opt/redmine-3.3.3-1/apps/redmine/htdocs/config/database.yml

production:
  adapter: mysql2
  database: bitnami_redmine
  host: localhost
  username: bitnami
  password: xxxxxxxxxx

 

1.3 mysql 복구

 

- 기본설치된 redmine db를 삭제

# /opt/redmine-3.3.3-1/mysql/bin/mysql -u bitnami -p bitnami_redmine

mysql> drop database bitnami_redmine;
Query OK, 1 rows affected (0.00 sec)

mysql> create database bitnami_redmine;
Query OK, 1 row affected (0.00 sec)

mysql> exit
Bye

 

- 복원용 DB파일을 로딩

# /opt/redmine-3.3.3-1/mysql/bin/mysql -u bitnami -p bitnami_redmine < backup.sql

 

1.4 redmine 데이터 파일 복구

# cd /opt/redmine-3.3.3-1/apps/redmine/htdocs/
# rm -f files
# tar zxvf files.tar.gz

 

1.5 redmine 플러그인 복구

# cd /opt/redmine-3.3.3-1/apps/redmine/htdocs
# rm -rf plugins
# tar zxvf plugins.tar.gz

 

1.6 DB migration 처리

# cd /opt/redmine-3.3.3-1/apps/redmine/htdocs
# /opt/redmine-3.3.3-1/ruby/bin/rake db:migrate RAILS_ENV="production"
# /opt/redmine-3.3.3-1/ruby/bin/rake redmine:plugins:migrate RAILS_ENV=production

 

1.7 시작 프로그램 등록

 

- Redhat 계열

$ cp /opt/redmine-3.3.3-1/ctlscript.sh /etc/init.d/bitnami-redmine

# 부팅스크립트 시작 부분 수정
$ vi /etc/init.d/bitnami-redmine

#!/bin/sh
#
# chkconfig: 2345 80 30
# description: Bitnami services

# 서비스로 등록
$ chkconfig --add bitnami-redmine

 

- Ubuntu 계열

$ sudo cp /opt/redmine-3.3.3-1/ctlscript.sh /etc/init.d/bitnami-redmine
$ sudo chmod +x /etc/init.d/bitnami-redmine

# 부팅 스크립트 시작부분 수정
$ sudo vi /etc/init.d/bitnami-redmine

### BEGIN INIT INFO
# Provides:          bitnami-redmine
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start daemon at boot time
# Description:       Enable services provided by daemon.
### END INIT INFO

# 서비스로 등록
$ sudo update-rc.d -f bitnami-redmine defaults
$ sudo update-rc.d -f bitnami-redmine enable

 

Ubuntu apt-get 저장소 일괄 바꾸기

sudo sed -i -re 's/([a-z]{2}\.)?archive.ubuntu.com|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list


/* 기존 저장소 덤프 */
svnadmin dump /svn/repos/siwon > siwon.dump
svnadmin dump /svn/repos/yeonwoo > yeonwoo.dump

/* 새 저장소 생성 */
svnadmin create /svn/repos/newrepos

/* 새 저장소 안에 복구할 디렉토리 각각 생성 */
svn mkdir svn://server/repos/newrepos/siwon
svn mkdir svn://server/repos/newrepos/yeonwoo

/* 복구 */
svnadmin load /svn/repos/newrepos --parent-dir siwon < siwon.dump
svnadmin load /svn/repos/newrepos --parent-dir yeonwoo < yeonwoo.dump

최종적으로 아래의 경로에 생성이 된다.

/svn/repos/newrepos/siwon
/svn/repos/newrepos/yeonwoo


# ps -ef | grep httpd | awk '{print $2}' | xargs kill -9
또는
# killall httpd


http://www.linux.co.kr/home/lecture/index.php?cateNo=1&secNo=27&theNo=&leccode=10801

Wifi beacon을 캡쳐하려면, ethernet이 아니라, 802.11 mac을 필터링 해줘야 함.


Windows에서는 winpcap을 쓰고, 리눅스는 libpcap 라이브러리를 쓰는데, 둘다 ethernet만을 캡쳐해줌.
802.11 mac에 대한 캡쳐 기능이 없음.


따라서, windows에서는 별도의 유료도구를 구매해야하고,
리눅스는 별도의 라이브러리를 설치해줘야 함.


여기서는 리눅스로 하는 방법을 설명함.


방법
  1. aircrack-ng 툴 설치
    1. http://wiki.wireshark.org/CaptureSetup/WLAN/#Linux 여기를 보면 다음과 같은 언급이 있음.
      1. The easiest way to turn manually turn monitor mode on or off for an interface is with the airmon-ng script in aircrack-ng; your distribution may already have a package for aircrack-ng.
    2. # iwconfig wlan0=>device명
      을 치면, Mode:Monitored라고 나와야함. 보통은 Mode:Managed라고 나옴.
    3. aircrack-ng를 설치하고,
    4. # airmon-ng start wlan0
      을 실행하면, ifconfig해보면, mon0이 생김. 이에, iwconfig mon0을 실행하면, Mode:Monitored라고 나옴.
  2. wireshark 설치
    1. wireshark.org에서 리눅스용 tar.gz를 받아서,
    2. libpcap-developement 설치하고,
    3. wireshark설치한후
    4. mon0디바이스로 캡쳐하면 가능함.

/* -------------------------- IOCTL LIST -------------------------- */

/* Wireless Identification */
#define SIOCSIWCOMMIT   0x8B00      /* Commit pending changes to driver */
#define SIOCGIWNAME 0x8B01      /* get name == wireless protocol */
/* SIOCGIWNAME is used to verify the presence of Wireless Extensions.
 * Common values : "IEEE 802.11-DS", "IEEE 802.11-FH", "IEEE 802.11b"...
 * Don't put the name of your driver there, it's useless. */

/* Basic operations */
#define SIOCSIWNWID 0x8B02      /* set network id (pre-802.11) */
#define SIOCGIWNWID 0x8B03      /* get network id (the cell) */
#define SIOCSIWFREQ 0x8B04      /* set channel/frequency (Hz) */
#define SIOCGIWFREQ 0x8B05      /* get channel/frequency (Hz) */
#define SIOCSIWMODE 0x8B06      /* set operation mode */
#define SIOCGIWMODE 0x8B07      /* get operation mode */
#define SIOCSIWSENS 0x8B08      /* set sensitivity (dBm) */
#define SIOCGIWSENS 0x8B09      /* get sensitivity (dBm) */

/* Informative stuff */
#define SIOCSIWRANGE    0x8B0A      /* Unused */
#define SIOCGIWRANGE    0x8B0B      /* Get range of parameters */
#define SIOCSIWPRIV 0x8B0C      /* Unused */
#define SIOCGIWPRIV 0x8B0D      /* get private ioctl interface info */
#define SIOCSIWSTATS    0x8B0E      /* Unused */
#define SIOCGIWSTATS    0x8B0F      /* Get /proc/net/wireless stats */
/* SIOCGIWSTATS is strictly used between user space and the kernel, and
 * is never passed to the driver (i.e. the driver will never see it). */

/* Spy support (statistics per MAC address - used for Mobile IP support) */
#define SIOCSIWSPY  0x8B10      /* set spy addresses */
#define SIOCGIWSPY  0x8B11      /* get spy info (quality of link) */
#define SIOCSIWTHRSPY   0x8B12      /* set spy threshold (spy event) */
#define SIOCGIWTHRSPY   0x8B13      /* get spy threshold */

/* Access Point manipulation */
#define SIOCSIWAP   0x8B14      /* set access point MAC addresses */
#define SIOCGIWAP   0x8B15      /* get access point MAC addresses */
#define SIOCGIWAPLIST   0x8B17      /* Deprecated in favor of scanning */
#define SIOCSIWSCAN 0x8B18      /* trigger scanning (list cells) */
#define SIOCGIWSCAN 0x8B19      /* get scanning results */

/* 802.11 specific support */
#define SIOCSIWESSID    0x8B1A      /* set ESSID (network name) */
#define SIOCGIWESSID    0x8B1B      /* get ESSID */
#define SIOCSIWNICKN    0x8B1C      /* set node name/nickname */
#define SIOCGIWNICKN    0x8B1D      /* get node name/nickname */
/* As the ESSID and NICKN are strings up to 32 bytes long, it doesn't fit
 * within the 'iwreq' structure, so we need to use the 'data' member to
 * point to a string in user space, like it is done for RANGE... */

/* Other parameters useful in 802.11 and some other devices */
#define SIOCSIWRATE 0x8B20      /* set default bit rate (bps) */
#define SIOCGIWRATE 0x8B21      /* get default bit rate (bps) */
#define SIOCSIWRTS  0x8B22      /* set RTS/CTS threshold (bytes) */
#define SIOCGIWRTS  0x8B23      /* get RTS/CTS threshold (bytes) */
#define SIOCSIWFRAG 0x8B24      /* set fragmentation thr (bytes) */
#define SIOCGIWFRAG 0x8B25      /* get fragmentation thr (bytes) */
#define SIOCSIWTXPOW    0x8B26      /* set transmit power (dBm) */
#define SIOCGIWTXPOW    0x8B27      /* get transmit power (dBm) */
#define SIOCSIWRETRY    0x8B28      /* set retry limits and lifetime */
#define SIOCGIWRETRY    0x8B29      /* get retry limits and lifetime */

/* Encoding stuff (scrambling, hardware security, WEP...) */
#define SIOCSIWENCODE   0x8B2A      /* set encoding token & mode */
#define SIOCGIWENCODE   0x8B2B      /* get encoding token & mode */
/* Power saving stuff (power management, unicast and multicast) */
#define SIOCSIWPOWER    0x8B2C      /* set Power Management settings */
#define SIOCGIWPOWER    0x8B2D      /* get Power Management settings */

/* WPA : Generic IEEE 802.11 informatiom element (e.g., for WPA/RSN/WMM).
 * This ioctl uses struct iw_point and data buffer that includes IE id and len
 * fields. More than one IE may be included in the request. Setting the generic
 * IE to empty buffer (len=0) removes the generic IE from the driver. Drivers
 * are allowed to generate their own WPA/RSN IEs, but in these cases, drivers
 * are required to report the used IE as a wireless event, e.g., when
 * associating with an AP. */
#define SIOCSIWGENIE    0x8B30      /* set generic IE */
#define SIOCGIWGENIE    0x8B31      /* get generic IE */

/* WPA : IEEE 802.11 MLME requests */
#define SIOCSIWMLME 0x8B16      /* request MLME operation; uses
                     * struct iw_mlme */
/* WPA : Authentication mode parameters */
#define SIOCSIWAUTH 0x8B32      /* set authentication mode params */
#define SIOCGIWAUTH 0x8B33      /* get authentication mode params */

/* WPA : Extended version of encoding configuration */
#define SIOCSIWENCODEEXT 0x8B34     /* set encoding token & mode */
#define SIOCGIWENCODEEXT 0x8B35     /* get encoding token & mode */

/* WPA2 : PMKSA cache management */
#define SIOCSIWPMKSA    0x8B36      /* PMKSA cache operation */

/* -------------------- DEV PRIVATE IOCTL LIST -------------------- */

/* These 32 ioctl are wireless device private, for 16 commands.
 * Each driver is free to use them for whatever purpose it chooses,
 * however the driver *must* export the description of those ioctls
 * with SIOCGIWPRIV and *must* use arguments as defined below.
 * If you don't follow those rules, DaveM is going to hate you (reason :
 * it make mixed 32/64bit operation impossible).
 */
#define SIOCIWFIRSTPRIV 0x8BE0
#define SIOCIWLASTPRIV  0x8BFF
/* Previously, we were using SIOCDEVPRIVATE, but we now have our
 * separate range because of collisions with other tools such as
 * 'mii-tool'.
 * We now have 32 commands, so a bit more space ;-).
 * Also, all 'odd' commands are only usable by root and don't return the
 * content of ifr/iwr to user (but you are not obliged to use the set/get
 * convention, just use every other two command). More details in iwpriv.c.
 * And I repeat : you are not forced to use them with iwpriv, but you
 * must be compliant with it.
 */

/* ------------------------- IOCTL STUFF ------------------------- */

/* The first and the last (range) */
#define SIOCIWFIRST 0x8B00
#define SIOCIWLAST  SIOCIWLASTPRIV      /* 0x8BFF */
#define IW_IOCTL_IDX(cmd)   ((cmd) - SIOCIWFIRST)
/* ----------------------- WIRELESS EVENTS ----------------------- */
/* Those are *NOT* ioctls, do not issue request on them !!! */
/* Most events use the same identifier as ioctl requests */

#define IWEVTXDROP  0x8C00      /* Packet dropped to excessive retry */
#define IWEVQUAL    0x8C01      /* Quality part of statistics (scan) */
#define IWEVCUSTOM  0x8C02      /* Driver specific ascii string */
#define IWEVREGISTERED  0x8C03      /* Discovered a new node (AP mode) */
#define IWEVEXPIRED 0x8C04      /* Expired a node (AP mode) */
#define IWEVGENIE   0x8C05      /* Generic IE (WPA, RSN, WMM, ..)
                     * (scan results); This includes id and
                     * length fields. One IWEVGENIE may
                     * contain more than one IE. Scan
                     * results may contain one or more
                     * IWEVGENIE events. */
#define IWEVMICHAELMICFAILURE 0x8C06    /* Michael MIC failure
                     * (struct iw_michaelmicfailure)
                     */
#define IWEVASSOCREQIE  0x8C07      /* IEs used in (Re)Association Request.
                     * The data includes id and length
                     * fields and may contain more than one
                     * IE. This event is required in
                     * Managed mode if the driver
                     * generates its own WPA/RSN IE. This
                     * should be sent just before
                     * IWEVREGISTERED event for the
                     * association. */
#define IWEVASSOCRESPIE 0x8C08      /* IEs used in (Re)Association
                     * Response. The data includes id and
                     * length fields and may contain more
                     * than one IE. This may be sent
                     * between IWEVASSOCREQIE and
                     * IWEVREGISTERED events for the
                     * association. */
#define IWEVPMKIDCAND   0x8C09      /* PMKID candidate for RSN
                     * pre-authentication
                     * (struct iw_pmkid_cand) */

#define IWEVFIRST   0x8C00
#define IW_EVENT_IDX(cmd)   ((cmd) - IWEVFIRST)

+ Recent posts