Skip to content

Instantly share code, notes, and snippets.

View likohank's full-sized avatar

Liko likohank

View GitHub Profile
@likohank
likohank / decryptchromecookies.py
Created December 2, 2022 06:08
Decrypt Chrome Cookies File (Python 3) - Windows
# Based on:
# https://gist.github.com/DakuTree/98c8362fb424351b803e
# https://gist.github.com/jordan-wright/5770442
# https://gist.github.com/DakuTree/428e5b737306937628f2944fbfdc4ffc
# https://stackoverflow.com/questions/60416350/chrome-80-how-to-decode-cookies
# https://stackoverflow.com/questions/43987779/python-module-crypto-cipher-aes-has-no-attribute-mode-ccm-even-though-pycry
import os
import json
import base64
@likohank
likohank / dante_setup.sh
Created August 1, 2022 13:56 — forked from gpchelkin/dante_setup.sh
How to Setup SOCKS5 Proxy Server for (not only) Telegram using Dante on Ubuntu 16.04 / 18.04 / 20.04
### NOT A SCRIPT, JUST A REFERENCE!
# install dante-server
sudo apt update
sudo apt install dante-server
# or download latest dante-server deb for Ubuntu, works for 16.04 / 18.04 / 20.04:
wget http://archive.ubuntu.com/ubuntu/pool/universe/d/dante/dante-server_1.4.2+dfsg-7build3_amd64.deb
# or older version:
wget http://ppa.launchpad.net/dajhorn/dante/ubuntu/pool/main/d/dante/dante-server_1.4.1-1_amd64.deb
@likohank
likohank / 自旋锁.go
Created March 22, 2022 11:58
自旋锁
package main
import (
"runtime"
"sync"
"sync/atomic"
)
type spinLock uint32
@likohank
likohank / 1.参照文档.md
Last active January 21, 2022 05:07
python3 字符默认编码unicode 具体指的是哪种编码,在内存中如何存储的
@likohank
likohank / test.py
Created September 27, 2020 09:55
Python Multiprocessing Value Block | Python Multiprocessing 访问 Value阻塞
Python Multiprocessing Value Blocking
Python Multiprocessing Value 多进程多线程情况下 调用 kill 后访问 进程通信变量 阻塞
When call kill in multi process, other process whill block when try to visit the Value,
just replace SIGKILL to SIGQUIT
from multiprocessing import Value
from multiprocessing import Process
@likohank
likohank / gist:ea9444f78e2dd82079c6534c79bf7e0a
Created August 5, 2020 12:16
shell 窗口 渲染 命令前缀
export PS1="\[\033[01;31m\]\u\[\033[00m\]@\[\033[01;32m\]\h\[\033[00m\][\[\033[01;33m\]\t\[\033[00m\]]:\[\033[01;34m\]\w\[\033[00m\]$ "
加进 bashrc
@likohank
likohank / gist:b083bf2fca08043c2759d706a643304b
Created February 25, 2020 07:18
系统内存充足 python创建进程 报内存不足
echo 1 > /proc/sys/vm/overcommit_memory
if your're sure that your system has enough memory. See Linux over commit heuristic.
https://stackoverflow.com/questions/38688824/linux-over-commit-heuristic
内存充足,但是当 python 调用 thread 创建线程 或者 创建Process 进程时, 报内存失败
cat /proc/sys/vm/overcommit_memory
:syntax off
:se binary nospell
:setgl noswap
:set undolevel=0
:set undofile=
set undolevels=-1
set noswapfile
@likohank
likohank / a.sh
Created June 11, 2019 03:02
如何在关闭vim文件后,屏幕上还显示之前文件的内容
在.vimrc文件里加上配置语句:
在.vimrc中设置set t_ti= t_te=
1. lateral view numeric_range (problem : Lateral View multiple array)
------- 将一条pv日志中,包含了多个广告的pv信息,且统一使用list 做存储的情况 lateral view numeric_range
select cookie,
array_index( product_id_arr, n ) as product_id,
array_index( catalog_id_arr, n ) as catalog_id,
array_index( qty_id_arr, n ) as qty
from table
lateral view numeric_range( size( product_id_arr )) n1 as n;