All posts by RSR

Ubuntu Laptop disable going to sleep when lid closed

lightdm과 같은 윈도 매니저 쓸때는 전원 컨트롤이 잘 되었으나 콘솔모드에서 뚜껑을 덮으면 연결된 네트워크가 끊어지는 문제 발생

추적결과 대충 아래의 메시지 발견

systemd-logind[12221]: Lid closed.
systemd-logind[12221]: Suspending...
NetworkManager[878]: <info>  [1572522339.0077] manager: sleep: sleep requested (sleeping: no  enabled: yes)
NetworkManager[878]: <info>  [1572522339.0078] device (wlp4s0): state change: unavailable -> unmanaged (reason 'sleeping', sys-iface-state: 'managed')
NetworkManager[878]: <info>  [1572522339.0084] manager: NetworkManager state is now ASLEEP
NetworkManager[878]: <info>  [1572522339.0088] device (enp2s0): state change: activated -> deactivating (reason 'sleeping', sys-iface-state: 'managed')
dbus-daemon[835]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service' requested by ':1
NetworkManager[878]: <info>  [1572522339.0280] device (enp2s0): state change: deactivating -> disconnected (reason 'sleeping', sys-iface-state: 'managed')
vmnet-natd[11087]: RTM_NEWLINK: name:enp2s0 index:2 flags:0x00011043
vmnetBridge[11065]: RTM_NEWLINK: name:enp2s0 index:2 flags:0x00011043
systemd[1]: Starting Network Manager Script Dispatcher Service...
dbus-daemon[835]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
systemd[1]: Started Network Manager Script Dispatcher Service.
nm-dispatcher[23024]: req:1 'connectivity-change': new request (1 scripts)
nm-dispatcher[23024]: req:1 'connectivity-change': start running ordered scripts...
NetworkManager[878]: <info>  [1572522339.0930] dhcp4 (enp2s0): canceled DHCP transaction, DHCP client pid 22932
NetworkManager[878]: <info>  [1572522339.0930] dhcp4 (enp2s0): state changed bound -> done
vmnet-natd[11087]: RTM_DELROUTE: index:2
vmnetBridge[11065]: RTM_DELROUTE: index:2
vmnet-natd[11087]: RTM_DELADDR: index:2, addr:192.168.1.32
NetworkManager[878]: <warn>  [1572522339.0959] dns-mgr: update-dns: plugin unbound update failed
NetworkManager[878]: <info>  [1572522339.1035] device (enp2s0): state change: disconnected -> unmanaged (reason 'sleeping', sys-iface-state: 'managed')
nm-dispatcher[23024]: req:2 'down' [enp2s0]: new request (1 scripts)
nm-dispatcher[23024]: req:2 'down' [enp2s0]: start running ordered scripts...
kernel: r8169 0000:02:00.0 enp2s0: Link is Down
vmnetBridge[11065]: RTM_NEWLINK: name:enp2s0 index:2 flags:0x00001002
vmnet-natd[11087]: RTM_NEWLINK: name:enp2s0 index:2 flags:0x00001002
vmnetBridge[11065]: Removing interface enp2s0 index:2
vmnetBridge[11065]: Stopped bridge enp2s0 to virtual network 0.
kernel: userif-3: sent link down event.
kernel: userif-3: sent link up event.

“/etc/systemd/logind.conf” 파일의

HandleLidSwitch=ignore
HandleLidSwitchDocked=ignore

부분 수정 후 재부팅

systemd-logind[968]: Lid closed.
systemd-logind[968]: Lid opened.
systemd-logind[968]: Lid closed.

반응없음을 확인

Office 365, Outlook 로그인 이슈 해결

office 365 login blank screen에 대한 이미지 검색결과

로그인화면에서 메일 입력이후 흰화면만 나오기에 구글링 하다가 아래의 레지스트 발견

\HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Common\Identity\ 하위에 Dword 값을 생성 후

DisableADALatopWAMOverrideEnableADAL 값을 0으로 바꿨다가 1로바꿨다가 막 하다보니 로그인성공

 

https://social.technet.microsoft.com/Forums/en-US/c76b6058-e42f-4467-9827-c08c688dab42/blank-login-screen-for-office-365-proplus?forum=Office2016ITPro

밥 로스

We don’t make mistakes. We have happy accidents.

If you ever do a pinting that you are totally satisfied with, you might as well quit.

But, you will never be satisfied with what you do.

If you can do things all your life that make you happy, needless to say, You are going to be a happy person.

명언만들기 참 쉽죠?

WAP2 KEY 변환

일반적으로 공유기에서 특정 ASCII를 WPA passphrase로 사용하지 못하게 막고있다.
이런경우

과 같이 필터링을 당하게 되며 스크립트단에서 넘긴다 하더라도 공격시도로 인해 세션이 끊어지게 된다.
ASCII 외에 HEX 옵션이 있는경우 SSID와 WPA passphrase를 이용하여 키를 계산해서 HEX값으로 넣어줄 수 있다.
http://jorisvr.nl/wpapsk.html 와 같은 웹베이스 계산기를 사용하여도 되지만 보안상 찝찝하다면 아래의 파이썬 코드를 실행하면 된다.

from pbkdf2 import PBKDF2
ssid = 'home' 
phrase = 'qwerty123'
print "SSID: "+ssid
print "Pass phrase: "+phrase
print "Pairwise Master Key: " + PBKDF2(phrase, ssid, 4096).read(32).encode("hex")

파이썬 코드는 https://medium.com/@billatnapier/wpa-2-hash-cracking-3098befd1300 에서 참조하였다.

실행시 나오는 Pairwise Master Key항목을 이용하여 WPA2 세션을 진행할 수 있다.

Flac Wav파일 CUE로 분할 및 태그 정리

*.cue로 *.wav 분할하기 (flac 가능, 결과는 wav로..)

shnsplit -f *.cue *.wav -t “%n %t”

분할된 wav를 다시 flac 압축

flac *.wav

CUE를 기반으로 Tag 생성 (cuetools 필요)

cuetag.sh *.cue *.flac

TAG를 기반으로 Filename 변경

for a in *.flac; do
ARTIST=`metaflac “$a” –show-tag=ARTIST | sed s/.*=//g`
TITLE=`metaflac “$a” –show-tag=TITLE | sed s/.*=//g`
TRACKNUMBER=`metaflac “$a” –show-tag=TRACKNUMBER | sed s/.*=//g`
mv “$a” “`printf %02g $TRACKNUMBER` – $ARTIST – $TITLE.flac”
done

ref.

https://wiki.archlinux.org/index.php/CUE_Splitting
http://lglinux.blogspot.com/2008/10/use-flac-tags-to-rename-files.html