This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# linux environment is recommended. not tested on other environment. tested on Ubuntu 20.04 | |
# python3 leveldb_dump_joseph.py '/mnt/d/Users/USERID/Chrome/User Data/Default/Local Extension Settings/chphlpgkkbolifaimnlloiipkdnihall' > result.csv | |
# result is tab seperated values(TSV). save result to *.csv and import on new excel documents with 'tab' seperator | |
# original code from https://gist.github.com/dexX7/cbd16b05f1f3870b7afc | |
# I made this code from original for recovering OneTab bookmarks | |
import binascii | |
import sys | |
import json | |
import yaml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from pathlib import Path | |
p = "/home/pi/src/projA/kk.c" | |
pp = os.path.splitext(p) | |
# pp = ('/home/pi/src/projA/kk', 'c') | |
print(f"filename with path={pp[0]}, extension={pp[1]}") | |
p1 = Path(p) | |
p1ext = p1.suffix | |
p1name = p1.name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 현재 설정 확인 | |
fswebcam --list-controls | |
# 오토포커스 끄기 | |
v4l2-ctl -d 0 -c focus_auto = 0 | |
# 포커스 수동 지정. 여기에서는 0으로 지정(원하는 값으로 변경) | |
v4l2-ctl --set-ctrl=focus_absolute=0 | |
# 현재 설정 확인 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def getSystemDns() -> tuple: | |
"""returns dns1, dns2 from /tmp/resolv.conf.auto | |
openwrt: OpenWrt | |
""" | |
dns1 = "" | |
dns2 = "" | |
try: | |
with open("/tmp/resolv.conf.auto") as f: | |
dnscount = 0 | |
for line in f.readlines(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ apt download libc-bin | |
받기:1 http://mirror.kakao.com/ubuntu bionic-updates/main amd64 libc-bin amd64 2.27-3ubuntu1.4 [643 kB] | |
내려받기 643 k바이트, 소요시간 0초 (4,890 k바이트/초) | |
$ ls | |
libc-bin_2.27-3ubuntu1.4_amd64.deb | |
$ dpkg -x libc-bin_2.27-3ubuntu1.4_amd64.deb libc-bin_2.27 | |
$ sudo cp libc-bin_2.27/sbin/ldconfig /sbin | |
$ sudo apt install --reinstall libc-bin | |
패키지 목록을 읽는 중입니다... 완료 | |
의존성 트리를 만드는 중입니다 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "%sudo ALL=NOPASSWD: /usr/sbin/service" | sudo tee /etc/sudoers.d/97-ssh-service | |
sudo chmod 0440 /etc/sudoers.d/97-ssh-service |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# php-cgi --version | |
PHP 7.2.21 (cgi-fcgi) | |
Copyright (c) 1997-2018 The PHP Group | |
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
make 'd:\aliases.cmd' and type following line | |
doskey az=azsphere $* | |
set target in property window of azure sphere developer command prompt to | |
C:\Windows\System32\cmd.exe /k ""C:\Program Files (x86)\Microsoft Azure Sphere SDK\\InitializeCommandPrompt.cmd" & D:\aliases.cmd" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
n=input() | |
a=[sys.stdin.readline() for i in range(n)] | |
print sum(list(map(int,a)))-n+1 | |
# https://www.acmicpc.net/board/view/855 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import threading | |
class testthread(threading.Thread): | |
def __init__(self, testvar=None): | |
threading.Thread.__init__(self) | |
self.enabled = False | |
def stop(self): | |
self.enabled = False |