웹마짱구의 블로그

우분투 커널 삭제

Ubuntu2023. 3. 29. 14:43
728x90

현재 커널 확인
# uname -r

4.15.0-208-generic

설치된 모든 커널 확인
# dpkg --list|grep "linux-image\|linux-headers\|linux-modules"
ii  linux-headers-4.15.0-208               4.15.0-208.220                                  all          Header files related to Linux kernel version 4.15.0
ii  linux-headers-4.15.0-208-generic       4.15.0-208.220                                  amd64        Linux kernel headers for version 4.15.0 on 64 bit x86 SMP
ii  linux-headers-generic                  4.15.0.208.191                                  amd64        Generic Linux kernel headers
ii  linux-image-4.15.0-208-generic         4.15.0-208.220                                  amd64        Signed kernel image generic
pi  linux-image-4.4.0-210-generic          4.4.0-210.242                                   amd64        Signed kernel image generic
ii  linux-image-generic                    4.15.0.208.191                                  amd64        Generic Linux kernel image
ii  linux-modules-4.15.0-208-generic       4.15.0-208.220                                  amd64        Linux kernel extra modules for version 4.15.0 on 64 bit x86 SMP
pi  linux-modules-4.4.0-210-generic        4.4.0-210.242                                   amd64        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
ii  linux-modules-extra-4.15.0-208-generic 4.15.0-208.220                                  amd64        Linux kernel extra modules for version 4.15.0 on 64 bit x86 SMP
pi  linux-modules-extra-4.4.0-210-generic  4.4.0-210.242                                   amd64        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP


자동삭제
# apt autoremove

수동삭제
# apt purge linux삭제커널

728x90

출처 : https://youtu.be/yQ20jZwDjTE?t=14429

 

interval = 2

prev_height = browser.execute_script('return document.body.scrollHeight')

while True:

           browser.execute_script('window.scrollTo(0, document.body.scrollHeight)')

           time.sleep(interval)

           curr_height = browser.execute_script('return document.body.scrollHeight')

           if curr_height == prev_height:

                 break

            prev_height = curr_height

 

print('스크롤 완료')

vim 단축키

Linux2022. 11. 17. 14:05
728x90

I : 문장시작(입력모드)

A : 문장끝(입력모드)

0 : 문장 앞으로 이동

$ : 문장 뒤로 이동

H : 화면 위

M : 화면 중간

L : 화면 끝

gg : 파일 앞

G : 파일 끝

20G: 20번째 줄로 이동

w : 단어 이동  (nw, 3w-> 3단어씩 이동)

b : 단어 뒤로 이동 (nb, 4b)

ctrl+u : 위로 스크롤링

ctrl+d : 아래로 스크롤링

{ : 문단 시작

} : 문단 끝

x : 커서 위치의 글자 삭제

dd : 문장삭제

yy : 문장복사

p : 붙여넣기

*p : 클립보드 붙여넣기

vim 단축키

Linux2022. 10. 20. 14:00
728x90

I : 문장시작(입력모드)

A : 문장끝(입력모드)

0 : 문장 앞으로 이동

$ : 문장 뒤로 이동

H : 화면 위

M : 화면 중간

L : 화면 끝

gg : 파일 앞

G : 파일 끝

20G: 20번째 줄로 이동

w : 단어 이동  (nw, 3w-> 3단어씩 이동)

b : 단어 뒤로 이동 (nb, 4b)

ctrl+u : 위로 스크롤링

ctrl+d : 아래로 스크롤링

{ : 문단 시작

} : 문단 끝

x : 커서 위치의 글자 삭제

dd : 문장삭제

yy : 문장복사

p : 붙여넣기

*p : 클립보드 붙여넣기

728x90

원문 : tutsforweb.com/how-to-set-up-task-scheduling-cron-job-in-laravel/

 

How to set up Task Scheduling with Cron job in Laravel - TutsForWeb

Implementing Cron Job in Laravel. Set up and demonstrate the use of Task Scheduler using Cron Job in Laravel. Version control Cron jobs and Artisan command.

tutsforweb.com

 

커맨드 생성

php artisan make : command WordOfTheDay

 

스케쥴링 등록

app / Console / Kernel.php

 

crontab 등록 
* * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1

728x90

원문 : junistory.blogspot.com/2017/08/virtualbox-vagrant.html

기본적인 Vagrant 명령어 모음

명령어설명

vagrant up 가상머신 기동
vagrant status 가상머신 상태 확인
vagrant ssh 가상머신에 접속
vagrant halt 가상머신 정지
vagrant suspend 가상머신 휴면
vagrant resume 가상머신 휴면에서 복원
vagrant reload 가상머신 재시동
vagrant destroy 가상머신 제거

linux find & replace

Linux2020. 7. 31. 14:27
728x90

https://linuxize.com/post/how-to-use-sed-to-find-and-replace-string-in-files/

 

sed -i 's/SEARCH_REGEX/REPLACEMENT/g' INPUTFILE

 

 

sed -i 's/Date(2013, 1, 1)/Date(2020, 1, 1)/g' *.php
sed -i 's/Date(2020, 6, 25)/Date(2025, 12, 31)/g' *.php

728x90

https://stackoverflow.com/questions/18024237/increment-row-number-with-laravel-pagination

 

increment row number with laravel pagination

How to make increment row number with laravel pagination ? When i use pagination and i go to page 2 and above it will back to beginning. for example i will paginate(3) <tr...< p=""> </tr...<>

stackoverflow.com

 

 

@foreach ($telephone as $key=> $whatever)

<td>{{ $key+ $telephone->firstItem() }}</td>

@endforeach

git 서버 만들기

Git2020. 3. 24. 18:21
728x90

참고1:https://git-scm.com/book/ko/v2/Git-%EC%84%9C%EB%B2%84-%EC%84%9C%EB%B2%84-%EC%84%A4%EC%A0%95%ED%95%98%EA%B8%B0

참고2: https://www.youtube.com/watch?v=sAeXpcGCQfI

 

[서버]

$ mkdir git_test

$ cd git_test

$ git init --bare remote

$ cd remote

 

[hooks/post-receive]

#!/bin/bash
TARGET="/home/web/deploy"
GIT_DIR="/home/web/remote"
BRANCH="master"

while read oldrev newrev ref
do
# only checking out the master (or whatever branch you would like to deploy)
if [ "$ref" = "refs/heads/$BRANCH" ];
then
echo "Ref $ref received. Deploying ${BRANCH} branch to production..."
git --work-tree=$TARGET --git-dir=$GIT_DIR checkout -f $BRANCH
else
echo "Ref $ref received. Doing nothing: only the ${BRANCH} branch may be deployed on this server."
fi
done

 

[클라이언트]

$ git init local

$ cd local

$ git config --global user.email "you@example.com"
$ git config --global user.name "Your Name"

$ vi f1.txt

$ git add f1.txt

$ git commit -m 1

$ git remote add origin ssh://jjangu@192.168.1.20/home/jjangu/git_test/remote/

$ git remote -v

origin  ssh://jjangu@192.168.1.20/home/jjangu/git_test/remote/ (fetch)
origin  ssh://jjangu@192.168.1.20/home/jjangu/git_test/remote/ (push)

$ git push origin master

 

728x90

원문 : https://www.alibabacloud.com/help/doc-detail/42205.htm

 

Get real client IP address - Website Access| Alibaba Cloud Documentation Center

In many cases, a visitor’s browser is not directly connected to the server for website access because CDN, WAF, or Anti-DDoS Pro is deployed in between. For example, the following is a common architecture: Client > CDN/WAF/Anti-DDoS Pro > Origin server. He

www.alibabacloud.com

Nginx

1. Install http_realip_module.

Apache

Windows system

The Apache 2.4 or higher versions have the remoteip_module file ( mod_remoteip.so) in the installation package. You can use this file to get the real client IP address.

 

Linux system

You can get the real client IP address by installing the third-party module mod_rpaf.

 

아파치 모듈 적용
Apache 2.2 이하버전은 mod_rpaf
Apache 2.4 버전은mod_remoteip

 

 

so 파일 다운로드 https://www.pconlife.com/viewfileinfo/mod-remoteip-so/