This file contains 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
ssh -D 5000 <server> | |
export http_proxy="socks5://127.0.0.1:5000" | |
export https_proxy="socks5://127.0.0.1:5000" |
This file contains 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
version: '3' | |
services: | |
elasticsearch: | |
image: docker.elastic.co/elasticsearch/elasticsearch:7.17.13 | |
container_name: elasticsearch-logs | |
restart: always | |
network_mode: host | |
environment: | |
- xpack.security.enabled=false | |
- discovery.type=single-node |
This file contains 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
celery_app = Celery( | |
'celery_tasks', | |
broker=BROKER_URL, | |
backend='celery_tasks:CustomBackendResult', | |
elasticsearch_save_meta_as_text=False, | |
result_extended=True, | |
) | |
class CustomBackendResult(ElasticsearchBackend): | |
def __init__(self, url=None, *args, **kwargs): |
This file contains 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 argparse | |
import logging | |
import os | |
logging.basicConfig( | |
format='%(asctime)s %(levelname)s %(message)s', | |
level=logging.INFO, | |
handlers=[logging.StreamHandler()] | |
) |
This file contains 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
conda create -n py3.11 python=3.11 | |
conda activate py3.11 |
This file contains 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
# pull apk from device | |
adb shell pm list packages | |
adb shell pm path com.example.someapp | |
adb pull /data/app/com.example.someapp.apk path/to/desired/destination | |
# add mitm certificate | |
apk-mitm someapp.apk --certificate ~/.mitmproxy/mitmproxy-ca-cert.pem --apktool ~/bin/apktool_2.9.3.jar | |
# push to the device | |
adb install -r someapp.apk |
This file contains 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
𝗙𝗮𝘀𝘁𝗲𝗿 𝗗𝗼𝗰𝗸 𝗛𝗶𝗱𝗶𝗻𝗴: defaults write com.apple.dock autohide-delay -float 0; defaults write com.apple.dock autohide-time-modifier -int 0;killall Dock | |
𝗙𝗮𝘀𝘁𝗲𝗿 𝗗𝗼𝗰𝗸 𝗛𝗶𝗱𝗶𝗻𝗴 𝗨𝗻𝗱𝗼: defaults write com.apple.dock autohide-delay -float 0.5; defaults write com.apple.dock autohide-time-modifier -int 0.5 ;killall Dock |
This file contains 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
chown www-data.www-data /root/folder | |
chmod g+w /root/folder | |
chmod g+s /root/folder | |
setfacl -d -m u::rwX,g::rwX,o::- /root/folder |
This file contains 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
#!/bin/bash | |
# Reference | |
# https://www.programonaut.com/setup-ssl-with-docker-nginx-and-lets-encrypt/ | |
# --dry-run to simulate renewal | |
docker run -it --rm --name certbot \ | |
-v "/etc/letsencrypt:/etc/letsencrypt" \ | |
-v "/var/lib/letsencrypt:/var/lib/letsencrypt" \ | |
-v "/var/log/letsencrypt:/var/log/letsencrypt" \ |
This file contains 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
#!/bin/bash | |
# Reference | |
# https://www.programonaut.com/setup-ssl-with-docker-nginx-and-lets-encrypt/ | |
# --dry-run to simulate renewal | |
docker run -it --rm --name certbot \ | |
-v "/etc/letsencrypt:/etc/letsencrypt" \ | |
-v "/var/lib/letsencrypt:/var/lib/letsencrypt" \ | |
-v "/var/log/letsencrypt:/var/log/letsencrypt" \ |
NewerOlder