생각을 해보니..

차단될때 마다 blacklist 파일에 추가해주면

다음번 재시작 시에 blacklist를 보고 자동으로 DROP 하도록 되어 있으니

REJECT 하는 자동 차단이랑 섞어서 쓰면 쓸만할지도?!


$ cat /etc/fail2ban/action.d/iptables-multiport24.conf

actionban = iptables -I fail2ban-<name> 1 -s <ip>/24 -j <blocktype>

            echo <ip> >> /etc/fail2ban/ip.blacklist 


'프로그램 사용 > fail2ban' 카테고리의 다른 글

fail2ban ssh 차단 실패???  (0) 2017.03.06
fail2ban phpmyadmin  (0) 2017.02.28
fail2ban 차단 관련...  (0) 2017.02.09
ssh 로그인 보안 - fail2ban  (4) 2017.02.08
apache ip deny  (0) 2017.02.08
Posted by 구차니
Linux/Ubuntu2017. 2. 15. 14:50

음.. 프로세스 별로 처리인가?

유저별로 제한이라던가 하는 기능은 없나보네..


$ cpulimit

Error: You must specify a target process

CPUlimit version 2.1

Usage: cpulimit TARGET [OPTIONS...] [-- PROGRAM]

   TARGET must be exactly one of these:

      -p, --pid=N        pid of the process

      -e, --exe=FILE     name of the executable program file

                         The -e option only works when

                         cpulimit is run with admin rights.

      -P, --path=PATH    absolute path name of the

                         executable program file

   OPTIONS

      -b  --background   run in background

      -c  --cpu=N        override the detection of CPUs on the machine.

      -l, --limit=N      percentage of cpu allowed from 1 up.

                         Usually 1 - 400, but can be higher

                         on multi-core CPUs (mandatory)

      -q, --quiet        run in quiet mode (only print errors).

      -k, --kill         kill processes going over their limit

                         instead of just throttling them.

      -r, --restore      Restore processes after they have

                         been killed. Works with the -k flag.

      -s, --signal=SIG   Send this signal to the watched process when cpulimit exits.

                         Signal should be specificed as a number or

                         SIGTERM, SIGCONT, SIGSTOP, etc. SIGCONT is the default.

      -v, --verbose      show control statistics

      -z, --lazy         exit if there is no suitable target process,

                         or if it dies

          --             This is the final CPUlimit option. All following

                         options are for another program we will launch.

      -h, --help         display this help and exit 


[링크 : http://cpulimit.sourceforge.net/]

[링크 : https://www.howtoforge.com/how-to-limit-cpu-usage-with-cpulimit-on-ubuntu-linux]

[링크 : https://www.digitalocean.com/community/tutorials/how-to-limit-cpu-usage-on-ubuntu-12-10]

[링크 : http://manpages.ubuntu.com/manpages/precise/man1/cpulimit.1.html]



+

ulimit을 통해 전체 시스템에 대해서 일괄적으로 cpu및 메모리 등의 용량 제한을 걸 수 있는 듯?


[링크 : http://www.linuxquestions.org/questions/linux-server-73/how-to-limit-the-users-cpu-usage-617928/]

    [링크 : http://www.linuxquestions.org/questions/debian-26/how-to-limit-the-cpu-usage-per-user-715490/]

[링크 : http://stackoverflow.com/questions/437433/limit-the-memory-and-cpu-available-for-a-user-in-linux]

[링크 : https://linux.die.net/man/3/ulimit]


<item>

core

limits the core file size (KB)

data

maximum data size (KB)

fsize

maximum filesize (KB)

memlock

maximum locked-in-memory address space (KB)

nofile

maximum number of open files

rss

maximum resident set size (KB) (Ignored in Linux 2.4.30 and higher)

stack

maximum stack size (KB)

cpu

maximum CPU time (minutes)

nproc

maximum number of processes

as

address space limit (KB)

maxlogins

maximum number of logins for this user except for this with uid=0

maxsyslogins

maximum number of all logins on system

priority

the priority to run user process with (negative values boost process priority)

locks

maximum locked files (Linux 2.4 and higher)

sigpending

maximum number of pending signals (Linux 2.6 and higher)

msgqueue

maximum memory used by POSIX message queues (bytes) (Linux 2.6 and higher)

nice

maximum nice priority allowed to raise to (Linux 2.6.12 and higher) values: [-20,19]

rtprio

maximum realtime priority allowed for non-privileged processes (Linux 2.6.12 and higher) 


[링크 : https://linux.die.net/man/5/limits.conf]

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

cgroups  (0) 2017.08.24
리눅스 하드 절전 설정  (0) 2017.05.23
우분투 루트 인증서 업데이트 내역  (0) 2017.01.18
우분투 창 관리 - 윈7처럼 창분할 단축키  (0) 2017.01.09
crontab 과 cron 서비스 reload  (0) 2017.01.04
Posted by 구차니

국민은행에서 창구고객에게 수수료 물린다는데

가끔 어쩔수 없이 인터넷으로 안되서 창구로 가서 하는데도

엄청 줄이 길고(물론 직딩이라 점심시간을 이용할수 밖에 없어서..)

온갖 동의 사인에 시간도 너무 걸리는데

그런 불편함을 해소할 방법도 없이 창구고객에게 입출금시 돈을 받는다고 하면 참 어이가 없네

그러면 24시간 ATM기 가동에 ATM은 수수료 0원으로 무조건 강제 하는 식으로

정부에서 제한을 할 필요가 있는거 아닌가 싶기도 하고


근데 대한민국이잖아? 안될거야

[링크 : http://v.media.daum.net/v/20170214184546571]

[링크 : http://v.media.daum.net/v/20170214160450635]

Posted by 구차니

EOS M3는 솔찍히 포커스 속도 관련 펌웨어 업데이트 된거랑 크게 차이가 없는 느낌이라고 해야하나

줌을 다른걸로 해서 정확한 비교는 아니지만,

막상 사서 쓰기에는 미미한 성능 차이라 웬지 M3는 그닥.. 이라는 느낌


그리고 소니 A7 EVF를 보는데 화소가 안보이는 신기함 ㄷㄷ

예전의 EVF가 아니구나 라는걸 느끼는 하루..




+

굳이 카메라를 산다면.. 라는 가정이 들어갈 이유가 있을지 모르겠지만

다음번에는 캐논 말고 다른걸 한번 살지도 모르겠다. 소니라던가?

근데 소니는 중고가 빨리 떨어진다니까.. 조금 기다렸다가 소니 미러리스를 노려보게 되려나? ㅋㅋ

'개소리 왈왈 > 직딩의 비애' 카테고리의 다른 글

운전하다가 드는 뻘생각  (0) 2017.02.16
출퇴근 길 2층 버스...  (0) 2017.02.15
소득공제 돌려보니 뱉으라네?!?!? ㅠㅠ  (0) 2017.01.31
아 내일 출근하기 싫다  (0) 2017.01.30
설 끝 ?  (0) 2017.01.28
Posted by 구차니

음.. 웹쪽이야 svn으로 하면되는데

db의 구조가 변경되는건 어떻게 이력으로 남길수 있지?

라는 생각이 들어 검색을 해보니


결론은.. db 스키마 덤프해서 버전관리해라 정도의 느낌?

[링크 : https://blog.codinghorror.com/get-your-database-under-version-control/]

[링크 : https://blog.codinghorror.com/is-your-database-under-version-control/] <<


[링크 : http://stackoverflow.com/questions/115369/do-you-use-source-control-for-your-database-items]

[링크 : http://stackoverflow.com/questions/175451/how-do-you-version-your-database-schema]

[링크 : http://stackoverflow.com/questions/173/versioning-sql-server-database]

'프로그램 사용 > mysql & mariaDB' 카테고리의 다른 글

mysql view  (0) 2017.03.14
db designer  (0) 2017.03.14
mysql 통화관련 변수타입  (0) 2017.02.07
mysql 다국어 문자길이  (0) 2017.02.06
mysql select case insensitive  (0) 2017.02.06
Posted by 구차니
프로그램 사용/vi2017. 2. 13. 09:37

:ls 버퍼 목록

:bn buffer next

:bp buffer previous

:b0 0번째로 이동

:bf buffer first 처음

:bl buffer last 마지막


:[N]bn[ext][!] [+cmd] [N]                               *:bn* *:bnext* *E87*

                Go to [N]th next buffer in buffer list.  [N] defaults to one.

                Wraps around the end of the buffer list.

                See |:buffer-!| for [!].

                Also see ||+cmd|.

                If you are in a help buffer, this takes you to the next help

                buffer (if there is one).  Similarly, if you are in a normal

                (non-help) buffer, this takes you to the next normal buffer.

                This is so that if you have invoked help, it doesn't get in

                the way when you're browsing code/text buffers.  The next three

                commands also work like this. 


bN이 대문자임

:[N]bN[ext][!] [+cmd] [N]               *:bN* *:bNext* *:bp* *:bprevious* *E88*

:[N]bp[revious][!] [+cmd] [N]

                Go to [N]th previous buffer in buffer list.  [N] defaults to

                one.  Wraps around the start of the buffer list.

                See |:buffer-!| for [!] and 'switchbuf'.

                Also see ||+cmd|. 


:br[ewind][!] [+cmd]                                    *:br* *:brewind*

                Go to first buffer in buffer list.  If the buffer list is

                empty, go to the first unlisted buffer.

                See |:buffer-!| for [!].


:bf[irst] [+cmd]                                        *:bf* *:bfirst*

                Same as |:brewind|.

                Also see |+cmd|. 


:bl[ast][!] [+cmd]                                      *:bl* *:blast*

                Go to last buffer in buffer list.  If the buffer list is

                empty, go to the last unlisted buffer.

                See |:buffer-!| for [!]. 


:[N]bd[elete][!]                        *:bd* *:bdel* *:bdelete* *E516*

:bd[elete][!] [N]

                Unload buffer [N] (default: current buffer) and delete it from

                the buffer list.  If the buffer was changed, this fails,

                unless when [!] is specified, in which case changes are lost.

                The file remains unaffected.  Any windows for this buffer are

                closed.  If buffer [N] is the current buffer, another buffer

                will be displayed instead.  This is the most recent entry in

                the jump list that points into a loaded buffer.

                Actually, the buffer isn't completely deleted, it is removed

                from the buffer list |unlisted-buffer| and option values,

                variables and mappings/abbreviations for the buffer are

                cleared. 


:[N]bw[ipeout][!]                       *:bw* *:bwipe* *:bwipeout* *E517*

:bw[ipeout][!] {bufname}

:N,Mbw[ipeout][!]

:bw[ipeout][!] N1 N2 ...

                Like |:bdelete|, but really delete the buffer.  Everything

                related to the buffer is lost.  All marks in this buffer

                become invalid, option settings are lost, etc.  Don't use this

                unless you know what you are doing. 


[링크 : http://gyuha.tistory.com/157]


+

ctrl-n,n은 새 버퍼로 수평 창을 여는데

ctrl-n,v는 이전 창의 버퍼를 연결해서 수직 창으로 연다


 CTRL-W CTRL-V                                           *CTRL-W_CTRL-V*

CTRL-W v                                                *CTRL-W_v*

:[N]vs[plit] [++opt] [+cmd] [file]                      *:vs* *:vsplit*

                Like |:split|, but split vertically.  The windows will be

                spread out horizontally if

                1. a width was not specified,

                2. 'equalalways' is set,

                3. 'eadirection' isn't "ver", and

                4. one of the other windows is wider than the current or new

                   window.

                Note: In other places CTRL-Q does the same as CTRL-V, but here

                it doesn't!


CTRL-W n                                                *CTRL-W_n*

CTRL-W CTRL_N                                           *CTRL-W_CTRL-N*

:[N]new [++opt] [+cmd]                                  *:new*

                Create a new window and start editing an empty file in it.

                Make new window N high (default is to use half the existing

                height).  Reduces the current window height to create room (and

                others, if the 'equalalways' option is set and 'eadirection'

                isn't "hor").

                Also see |++opt| and |+cmd|.

                If 'fileformats' is not empty, the first format given will be

                used for the new buffer.  If 'fileformats' is empty, the

                'fileformat' of the current buffer is used.  This can be

                overridden with the |++opt| argument.

                Autocommands are executed in this order:

                1. WinLeave for the current window

                2. WinEnter for the new window

                3. BufLeave for the current buffer

                4. BufEnter for the new buffer

                This behaves like a ":split" first, and then an ":enew"

                command.


:[N]vne[w] [++opt] [+cmd] [file]                        *:vne* *:vnew*

                Like |:new|, but split vertically.  If 'equalalways' is set

                and 'eadirection' isn't "ver" the windows will be spread out

                horizontally, unless a width was specified.


:[N]new [++opt] [+cmd] {file}

:[N]sp[lit] [++opt] [+cmd] {file}                       *:split_f*

                Create a new window and start editing file {file} in it.  This

                behaves like a ":split" first, and then an ":e" command.

                If [+cmd] is given, execute the command when the file has been

                loaded |+cmd|.

                Also see |++opt|.

                Make new window N high (default is to use half the existing

                height).  Reduces the current window height to create room

                (and others, if the 'equalalways' option is set).



[링크 : http://stackoverflow.com/.../vim-how-do-you-open-another-no-name-buffer-like-the-one-on-startup]

'프로그램 사용 > vi' 카테고리의 다른 글

vi 여러개 파일 편집하기(동시 x)  (0) 2017.09.16
vi 반복 입력  (0) 2017.09.16
vi buffer window tab 차이점?  (0) 2017.02.11
vi 창 분할해서 보기  (0) 2017.02.10
vi 현재 위치에서 끝까지 복사  (0) 2017.02.01
Posted by 구차니
embeded/AVR (ATmega,ATtiny)2017. 2. 12. 20:07

대충보는데

링커에서 개별 오브젝트 파일의 상대주소나 절대주소를 변경해줄수 있는데

hex파일로 바뀐건 이미 링커의 결과물이라

임의로 변경은 힘들지도?


그럼 hex를 objdump로 object 파일로 덤프해서 다시 링커로 연결하면서 주소를 바꿀수 있을려나?

hex는 bin의 ascii 표현법이고

hex2bin으로 바이너리로 환원하고 다시 링커로 해주면 되려나


[링크 : http://www.avrfreaks.net/forum/how-link-bootloaderhex-applicationelf]


걍 찾아봐도 안나오는거 봐서는.. 그리 권장할 만한 아이디어가 아닌건가?

아니면 리버스목적이 아닌 이상 쓸모가 없는 방법이라서 그런걸까?

'embeded > AVR (ATmega,ATtiny)' 카테고리의 다른 글

avr pwm 관련  (0) 2017.04.19
IAR AVR은 start section 설정이 안되나?  (0) 2017.02.17
우리로봇기술 사이트 폐쇄  (0) 2016.08.24
avr iar __flash winavr PROGMEM  (0) 2016.07.06
부품들 정리  (0) 2016.04.16
Posted by 구차니
프로그램 사용/vi2017. 2. 11. 16:27

사용에 옳은 방법이 있겠냐 마는

버퍼는 일종의 파일 하나당 할당된 메모리 개념 같고

윈도우는 버퍼를 골라서 띄우는 역할

그리고 탭은 윈도우에서 레이아웃을 담당하는 역할이라고 하는데

솔찍히 탭 + 윈도우로 쓰긴 또 에러고

가장 무난한건 윈도우 여러개 분할해서 버퍼 골라가며 쓰는거?


[링크 : http://bakyeono.net/post/2015-08-13-vim-tab-madness-translate.html]


[링크 : https://sanctum.geek.nz/arabesque/buffers-windows-tabs/]

[링크 : http://stackoverflow.com/questions/26708822/why-do-vim-experts-prefer-buffers-over-tabs]

'프로그램 사용 > vi' 카테고리의 다른 글

vi 반복 입력  (0) 2017.09.16
vi 버퍼 컨트롤  (0) 2017.02.13
vi 창 분할해서 보기  (0) 2017.02.10
vi 현재 위치에서 끝까지 복사  (0) 2017.02.01
vi 단어 단위 이동  (0) 2017.02.01
Posted by 구차니
embeded/arduino(genuino)2017. 2. 11. 12:54

그렇게 궁금해 하던 오리지널 소스 발견!


int main(void)
{
init();
initVariant();
#if defined(USBCON)
USBDevice.attach();
#endif
setup();
for (;;) {
loop();

if (serialEventRun) serialEventRun();

}
return 0;
}



[링크 : https://github.com/arduino/Arduino/blob/master/hardware/arduino/avr/cores/arduino/main.cpp]

    [링크 : https://github.com/arduino/Arduino/tree/master/hardware/arduino/avr/cores/arduino]


[링크 : https://github.com/arduino/Arduino/tree/master/hardware/arduino/avr/bootloaders] AVR기반

[링크 : https://github.com/arduino/ArduinoCore-samd/tree/master/bootloaders/zero] ARM기반


2016/03/28 - [embeded/arduino(genuino)] - 아두이노 빌드 프로세스 & c/cpp



+

간단하게 말해서.. FT232 USB to RS232 칩에서 DTR를 감지하면 자동으로 리셋을 걸어버린다.

그런 이유로 아두이노 부트로더에만 업로드 하는 것이 있고,

아두이노 sketch쪽 스켈레톤 코드에는 특정 코드에서 리부팅 하는 부분이 없다.


Since the DTR signal goes from 5V to 0 at the moment a new connection to the Arduino is started, if you send this signal to the reset line of the Arduino's processor, it resets. 

[링크 : http://www.instructables.com/id/Overview-the-Arduino-sketch-uploading-process-and-/]


Data Terminal Ready (DTR) is a control signal in RS-232 serial communications, transmitted from data terminal equipment (DTE), such as a computer, to data communications equipment (DCE), for example a modem, to indicate that the terminal is ready for communications and the modem may initiate a communications channel.

[링크 : https://en.wikipedia.org/wiki/Data_Terminal_Ready]

[링크 : https://www.arduino.cc/en/uploads/Main/ArduinoNano30Schematic.pdf]


대충보면.. Makefile에서 sketch를 c로 변경해서 빌드할때 .text 섹션을 BOOT_START 주소로 옮기고 링킹하는 듯?


$ vi /usr/share/arduino/hardware/arduino/bootloaders/caterina/Makefile

#---------------- Linker Options ---------------- # -Wl,...: tell GCC to pass this to linker. # -Map: create map file # --cref: add cross reference to map file LDFLAGS = -Wl,-Map=$(TARGET).map,--cref LDFLAGS += -Wl,--section-start=.text=$(BOOT_START) LDFLAGS += -Wl,--relax LDFLAGS += -Wl,--gc-sections LDFLAGS += $(EXTMEMOPTS) LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS)) LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB) #LDFLAGS += -T linker_script.x








-Wl,--section-start=.bootloader=0x1E000 

[링크 : http://www.atmel.com/webdoc/AVRLibcReferenceManual/FAQ_1faq_reloc_code.html]

'embeded > arduino(genuino)' 카테고리의 다른 글

릴레이로 AC전원 스위치하기  (0) 2017.10.26
hoverlabs 사의 hover 제품  (0) 2017.07.17
avrdude arduino  (0) 2016.12.02
pwm ppm decode  (0) 2016.11.28
arduino clcd  (0) 2016.11.25
Posted by 구차니
회사일2017. 2. 11. 12:37

VDI / VDO에 대한 명확한(?) 약어는 안보이고

대충.. 보이는 녀석들이


Vertical Drive Output / Input - VDO/VDI

Vertical Sync Output / Output - Vsync 정도?


CIS-ISP 간의 master/slave 모드로 인해서

Input/Output 모드로 전환해서 사용



[링크 : http://www.semicon.panasonic.co.jp/ds4/MN83951_E_discon.pdf]

'회사일' 카테고리의 다른 글

HSTL  (0) 2017.07.01
Rigid-Flex PCB  (0) 2017.06.09
sdi bt.1120  (0) 2016.12.07
ldo - linear drop out  (0) 2016.12.07
동축 케이블 표준  (0) 2016.09.09
Posted by 구차니