기본 콘텐츠로 건너뛰기

dmesg 사람이 보기 쉽게

CentOS6 dmesg 에 찍히는 시간이 uptime 이후 시간이여서 알아보기 힘들다 아래와 같이 uptime - 현재시간 구해서 보면 편하다  dmesg_human () {     $(type -P dmesg) "$@" | perl -w -e 'use strict;         my ($uptime) = do { local @ARGV="/proc/uptime";<>}; ($uptime) = ($uptime =~ /^(\d+)\./);         foreach my $line (<>) {             printf( ($line=~/^\[\s*(\d+)\.\d+\](.+)/) ? ( "[%s]%s\n", scalar localtime(time - $uptime + $1), $2 ) : $line )         }' } CentOS7 에서는 간단히 -T 옵션을 사용할 수 있다. dmesg -T

OneDrive version 삭제

꽁자 5TB OenDrive 파일 버전 관리로 인해 용량이 줄어들때 일일히 버전 파일을 삭제 하기란 매우 힘든일이다. PowerShell  에서 아래와 같이 한다. SharePoint Online Client Components SDK 를 먼저 설치한다. https://www.microsoft.com/en-us/download/details.aspx?id=42038 아래와 같이 PowerShell 스크립트를 실행하면 모든 버전 파일이 for loop 을 돌면서 삭제된다. Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll" Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"     #Config Parameters $SiteURL= "https://yoursharepont-my.sharepoint.com/personal/yourid_domain_com/" $LibraryName="Documents" #Setup Credentials to connect $Cred = Get-Credential $Cred = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Cred.UserName,$Cred.Password)        #Setup the context     $Ctx = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL)     $Ctx.Credentials = $Cred ...

Asuswrt Merlin dnsmasq 를 이용하여 시간대별 youtube lol 차단

우선 /jffs/scripts 를 사용할수 있게 config에서 설정 Support for these scripts stored under /jffs/scripts/ must be enabled, under Administration -> System on the webui: 아래 등록 스크립트 작성 cat /jffs/scripts/add.sh #!/bin/sh echo "address=/youtube.com/127.0.0.1"  > /jffs/configs/dnsmasq.conf.add echo "address=/prod.kr.lol.riotgames.com/127.0.0.1" >> /jffs/configs/dnsmasq.conf.add service restart_dnsmasq 아래 삭제 스크립트 작성 cat /jffs/scripts/del.sh #!/bin/sh echo "" > /jffs/configs/dnsmasq.conf.add service restart_dnsmasq 실행 권한 주기 chmod 755  /jffs/scripts/add.sh chmod 755  /jffs/scripts/del.sh 크론탭에 등록하기 예제는 24:00 에 차단 07:00 에 차단해제 cru a add_dnsmasq "0 0 * * * /jffs/scripts/add.sh" cru a del_dnsmasq "0 7 * * * /jffs/scripts/del.sh" 참고  크론탭 등록 방법 https://www.cyberciti.biz/faq/how-to-add-cron-job-on-asuswrt-merlin-wifi-router/ 커스텀 dnsmasq 사용 방법 https://github.com/RMerl/asuswrt-merlin.ng/wiki/Custom-domains-with-dnsmasq

android app 에서 32bit , 64bit 선택 설치

 2019 년 8월 1일부터 Google Play에 게시되는 앱은 64bit 아키텍처를 지원해야 합니다. 그런데 64bit app 에서 일부 불안정하여 32bit app 을 필요로 할때가 있습니다. 디폴트로 아키텍처가 64bit면 64bit 모드로만 설치가 됩니다. 아래와 같이 adb를 --abi 옵션을 이용하여 선택적으로 설치가 가능합니다. 지원되는 abi 자세한 설명에 대해선 아래 사이트를 참조 합니다. https://developer.android.com/ndk/guides/abis?hl=ko 아래는 인텔 아키텍처 32bit 전용으로 설치할 경우 입니다.  32bit 인텔 아키텍처는 x86 입니다.  adb install --abi x86 example.apk 4652 KB/s (35631753 bytes in 7.479s)         pkg: /data/local/tmp/example.apk Failure [INSTALL_FAILED_NO_MATCHING_ABIS] 위와같이 32bit 를 지원하지 않는 app 경우에 INSTALL_FAILED_NO_MATCHING_ABIS 에러가 납니다.  adb install --abi x86 example.apk 4012 KB/s (83017609 bytes in 20.207s)         pkg: /data/local/tmp/example.apk Failure [INSTALL_FAILED_ALREADY_EXISTS] 이미 앱이 설치가 되어있는 경우에 위와 같이 INSTALL_FAILED_ALREADY_EXISTS 설치가 미리 되었다는 에러가 나는데 그럴땐 재설치 옵션 -r 를 사용합니다. adb install -r --abi x86 example.apk 4330 KB/s (83017609 bytes in 18.720s)         pkg: /data/local/tm...

iterm2 에서 shift+space 한영전환시 공백이 들어갈때

 iterm2 메뉴에서 Preferences => Keys 로 가서 아래 첨부파일 그림 참조하여 추가