pagination 에서의 페이지별 행 번호
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 서버 만들기
참고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
$ 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 --set-upstream origin master
프록시 접속시 실 아이피 가져오기 - Get real client IP address
원문 : 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/
[PHP] sprintf(), printf() 사용법 - 형식화 문자열 반환
원문 : https://crivius.tistory.com/12
[PHP] sprintf(), printf() 사용법 - 형식화 문자열 반환
sprintf(format,arg1,arg2,arg++) sprintf () 함수는 변수에 서식 첨부 캐릭터 라인을 기록합니다. ARG1, ARG2, arg++는 "단계별"작동한다. 첫 번째 % 기호는 ARG1로 두 번째 % 기호는 ARG2로 format, arg1은 필..
crivius.tistory.com
sprintf(format,arg1,arg2,arg++)
sprintf () 함수는 변수에 서식 첨부 캐릭터 라인을 기록합니다.
ARG1, ARG2, arg++는 "단계별"작동한다. 첫 번째 % 기호는 ARG1로 두 번째 % 기호는 ARG2로
format, arg1은 필수인자이고 arg2,arg++ 선택적인자이다.
%% - 백분율 기호를 반환합니다.
% b - 이진수
% c - ASCII 값에 따른 문자
% d - 부호있는 10 진수 (음수, 0 또는 양수)
% e - 소문자 (예 : 1.2e + 2)를 사용하는 과학 표기법
% E - 대문자 (예 : 1.2E + 2)를 사용하는 과학 표기법
% u - 부호없는 10 진수 (0보다 크거나 같음)
% f - 부동 소수점 수 (로컬 설정 인식)
% F - 부동 소수점 수 (로컬 설정 인식 없음)
% g - % e와 % f 중 짧은 것
% G - % E 및 % f 중 더 짧음
% o - 8 진수
% s - 문자열
% x - 16 진수 (소문자)
% X - 16 진수 (대문자)
추가적인 형식 = %와 문자사이에 추가형식이 배치가능 (예 : %.2f)
예1)
1 2 3 4 5 6 |
$str = "홍길동"; $num1 = 10000; $num2 = 12; $txt = sprintf("%s님 %u원 쿠폰 사용기간이 %u일 남았습니다.",$str,$num1,$num2); echo $txt; // 결과 홍길동님 10000원 쿠폰 사용기간이 12일 남았습니다.
|
예2) 소수점 몇째자리까지 표현해줄지 설정
1 2 3 |
$num = 123.123; $txt = sprintf("%.2f",$num); echo $txt; // 결과 123.12 |
예3) 달력의 한자리수인 월앞에 0을 붙일 경우
1 2 3 |
$num = 3; $txt = sprintf("%02d",$num); echo $txt; // 결과 03 |
printf() 함수는 sprintf()와 사용법은 동일하다.
printf()는 결과를 출력하고 sprintf()는 결과를 리턴한다.(echo를 해주고 안 해주고 차이)
apt-get update에서 발생하는 GPG public key 오류 해결 방법
원문 : https://dreamlog.tistory.com/76
apt-get update에서 발생하는 GPG public key 오류 해결 방법.
Linux를 사용 중 프로그램을 설치와 삭제를 반복하면 아래와 같은 오류가 발생한다. W: GPG 오류: http://ppa.launchpad.net natty Release: 다음 서명들은 공개키가 없기 때문에 인증할 수 없습니다: NO_PUBKEY X..
dreamlog.tistory.com
현상 : W: GPG 오류: http://ppa.launchpad.net natty Release: 다음 서명들은 공개키가 없기 때문에 인증할 수 없습니다: NO_PUBKEY XXXXXXXXXXXXXXXXXX
해결 : $ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys XXXXXXXXXXXXXXXXXX
우분투 패키지 업데이트 오류 해결
우분투 패키지 업데이트 오류 해결 – Ubuntu 활용
$ sudo -i # apt-get clean # cd /var/lib/apt # mv lists lists.old # mkdir -p lists/partial # apt-get clean # apt-get update # exit $
enjoystat.epizy.com
$ sudo -i
# apt-get clean
# cd /var/lib/apt
# mv lists lists.old
# mkdir -p lists/partial
# apt-get clean
# apt-get update
# exit
$
php - composer create-project와 함께 특정 laravel 버전 설치하기
https://code-examples.net/ko/q/16a7614
composer create-project laravel/laravel=4.1.27 your-project-name --prefer-dist
또는
composer create-project laravel/laravel your-project-name --prefer-dist
4.1.27
버전은 패키지스트 https://packagist.org/packages/laravel/laravel 에 존재하는 버전이어야 한다.
5.8 버전 설치시
composer create-project laravel/laravel="5.8.*" [프로젝트 이름] 예: composer create-project laravel/laravel="5.8.*" blog
pageant couldn't this key old pem format
Pageant refuses to load SSH-2 key generated with GitBash
The implementation of key handling with (Tortoise)Git for Windows confuses me. As far as I understood, you can implement with either ssh.exe (gits own ssh program), where you can then choose an ssh...
stackoverflow.com
Pageant는 PuTTY 형식 ( .ppk)으로 만 키를로드 할 수 있습니다 .
PuTTY 도구에서 여전히 인식하는 다른 형식으로 키를로드하려고하면 언급 된 오류 메시지가 표시됩니다.
이 키를로드 할 수 없습니다 (OpenSSH-SSH-2 개인 키)
키 를 OpenSSH 형식에서 PuTTY 형식으로 변환하려면 PuTTYgen 을 사용해야 합니다. Pageant가 파일 형식을 인식하면 PuTTYgen이 파일 형식을 변환 할 수 있습니다.
- PuTTYgen을 실행하십시오.
- 개인 키를 OpenSSH 형식으로로드하려면 로드 를 누르십시오 .
- 개인 키 저장을 눌러 개인 키를 .ppk형식으로 저장하십시오 .
- 이제 개인 키 .ppk를 Pageant 형식으로 로드 할 수 있습니다 .
윈도우10 업데이트 강제 재부팅 막기
http://kimchki.blogspot.com/2017/11/10.html
윈도우10 업데이트 강제 재부팅 막기
치매 걸리기 전에 기록하자
kimchki.blogspot.com
"로컬 그룹 정책 편집기" 를 실행시킨다.
"시작 - 실행 - gpedit.msc"
"컴퓨터 구성 - 관리 템플릿 - Windows 구성 요소 - Windows 업데이트"
"자동 업데이트 구성"
"자동으로 다운로드하고 설치할때 알림"
"예약된 자동 업데이트 설치 시 로그온한 사용자가 있을 경우 자동 다시 시작 사용 안 함"
"사용"
mysql 한글 문자열 길이
MySQL 문자열 길이 구하는 함수
1. LENGTH() : 길이를 bytes로 나타낸다.
SELECT LENGTH('한글') -> 6
SELECT LENGTH('abc') -> 3
2. CHAR_LENGTH() : 글자의 수를 나타낸다.
SELECT CHAR_LENGTH('한글') -> 2
SELECT CHAR_LENGTH('abc') -> 3
3. BIT_LENGTH() : 길이를 bit로 나타낸다.
SELECT BIT_LENGTH('한글a') -> 56
SELECT BIT_LENGTH('한글') -> 48
** 참고로 MySQL에서는 UTF-8일 경우 한글은 3bytes, 영어는 1bytes 처리하네요 ^^
출처: https://nejary.tistory.com/entry/MySQL-문자열-길이-한글 [세상 품기]