strace -e trace=file -fp PID (file) or strace -e trace=desc -fp PID (file descriptors)
Common calls:
accessclose– close file handlefchmod– change file permissionsfchown– change file ownership
| # Pallette in BGR format | |
| # Preview & reference: https://www.rapidtables.com/web/color/RGB_Color.html | |
| ALICE_BLUE = (255, 248, 240) | |
| ANTIQUE_WHITE = (215, 235, 250) | |
| AQUA = (255, 255, 0) | |
| AQUA_MARINE = (212, 255, 127) | |
| AZURE = (255, 255, 240) | |
| BEIGE = (220, 245, 245) | |
| BISQUE = (196, 228, 255) |
| // g++ cache-prefetching.cc -Wall -std=c++11 -g -pthread -O2 | |
| #include <string> | |
| #include <vector> | |
| #include <mutex> | |
| #include <random> | |
| #include <chrono> | |
| #include <thread> | |
| #include <iomanip> | |
| #include <iostream> |
| #!bin/bash | |
| chmod a-x /Applications/Thunder.app/Contents/Bundles/XLPlayer.app | |
| chmod a-x /Applications/Thunder.app/Contents/PlugIns/bbassistant.xlplugin | |
| chmod a-x /Applications/Thunder.app/Contents/PlugIns/browserhelper.xlplugin | |
| chmod a-x /Applications/Thunder.app/Contents/PlugIns/featuredpage.xlplugin | |
| chmod a-x /Applications/Thunder.app/Contents/PlugIns/myvip.xlplugin | |
| chmod a-x /Applications/Thunder.app/Contents/PlugIns/playgame.xlplugin | |
| chmod a-x /Applications/Thunder.app/Contents/PlugIns/subtitle.xlplugin | |
| chmod a-x /Applications/Thunder.app/Contents/PlugIns/thunderstore.xlplugin |
| # While this code still works, I would recommend using Fast API for websockets in modern applications. | |
| # See: https://fastapi.tiangolo.com/advanced/websockets/ | |
| # Note this is targeted at python 3 | |
| import tornado.web | |
| import tornado.httpserver | |
| import tornado.ioloop | |
| import tornado.websocket | |
| import tornado.options |
| __version__ = "0.1.6.8" | |
| if __name__ == "__main__": | |
| import sys | |
| import argparse | |
| def increment_line(args): | |
| vi = [int(i) for i in __version__.split('.')] | |
| print('current version: %s' % __version__) |
| ZigZag-Encoding | |
| --------------- | |
| Maps negative values to positive values while going back and | |
| forth (0 = 0, -1 = 1, 1 = 2, -2 = 3, 2 = 4, -3 = 5, 3 = 6 ...) | |
| (i >> bitlength-1) ^ (i << 1) | |
| with "i" being the number to be encoded, "^" being | |
| XOR-operation and ">>" would be arithemtic shifting-operation |
| ctrl + w + h 光标 focus 左侧树形目录 | |
| ctrl + w + l 光标 focus 右侧文件显示窗口 | |
| ctrl + w + w 光标自动在左右侧窗口切换 | |
| ctrl + w + r 移动当前窗口的布局位置 | |
| o 在已有窗口中打开文件、目录或书签,并跳到该窗口 | |
| go 在已有窗口 中打开文件、目录或书签,但不跳到该窗口 | |
| t 在新 Tab 中打开选中文件/书签,并跳到新 Tab | |
| T 在新 Tab 中打开选中文件/书签,但不跳到新 Tab | |
| i split 一个新窗口打开选中文件,并跳到该窗口 | |
| gi split 一个新窗口打开选中文件,但不跳到该窗口 |
| #!/usr/bin/env python | |
| ''' | |
| Send an multipart email with HTML and plain text alternatives. The message | |
| should be constructed as a plain-text file of the following format: | |
| From: Your Name <your@email.com> | |
| To: Recipient One <recipient@to.com> | |
| Subject: Your subject line | |
| --- |