Skip to content

Instantly share code, notes, and snippets.

@atyachin
atyachin / Android_Emulator_AWS_EC2_ARM64_2022.txt
Last active May 18, 2024 02:08
Running headless android emulator on AWS EC2 Ubuntu instance (ARM64 / aarch64) - 2022
Android Emulator (ARM64) on EC2 - 2022
---------------------------------------
1. Launch EC2 ARM based Instance (a1.metal / a1.2xlarge): (16 Gb RAM, 32Gb Disk), Ubuntu Server 22.04 LTS (HVM) ARM x64
2. sudo apt update && sudo apt upgrade
3. sudo apt install default-jdk python3-pip repo python-is-python3 unzip libpcre2-dev adb
4. wget https://dl.google.com/android/repository/commandlinetools-linux-8512546_latest.zip
5. unzip commandlinetools-linux-8512546_latest.zip -d android-sdk
6. sudo mv android-sdk /opt/
7. mkdir /opt/android-sdk/cmdline-tools/latest
8. mv /opt/android-sdk/cmdline-tools/* /opt/android-sdk/cmdline-tools/latest (ignore the error)
@ctlllll
ctlllll / longest_chinese_tokens_gpt4o.py
Created May 13, 2024 19:53
Longest Chinese tokens in gpt4o
import tiktoken
import langdetect
T = tiktoken.get_encoding("o200k_base")
length_dict = {}
for i in range(T.n_vocab):
try:
length_dict[i] = len(T.decode([i]))
except:
@AveYo
AveYo / @ batch scripts for power users.md
Last active May 18, 2024 02:01
Windows batch scripts for power users

windows_update_toggle.bat v10.1 final
~ one script to rule them all!
~ block build upgrades and/or automatic updates without breawking Store downloads and Defender protection updates
~ there is a lot of focus on Defender updates working independently, unlike any other updates "management" solution
~ ifeo safe blocking with no destructive changes of ownership, deleting files, removing tasks, or over-blocking
~ toggle everything from the Desktop right-click context menu!
but wait, there is more:
~ hide/unhide/install update lists with counter at the Desktop right-click context menu!

Previous update toggle batch suite scripts have been overwritten on pastebin, but will still be available here:

@simonw
simonw / recover_source_code.md
Last active May 18, 2024 01:57
How to recover lost Python source code if it's still resident in-memory

How to recover lost Python source code if it's still resident in-memory

I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6

Attach a shell to the docker container

Install GDB (needed by pyrasite)

apt-get update && apt-get install gdb
@Vendicated
Vendicated / ids.txt
Last active May 18, 2024 01:54
spy pet account ids, gathered by @Dziurwa14. be careful, their api now returns innocent people. don't get tricked into banning the wrong people. do not trust their api and double check before banning
1210165420493905982
956054319529066527
956075132571508757
1171196139647803513
956210819325132921
956164930061619230
1185038257789079614
956246550152118374
956178931512410222
1172076548791226439
@agentlame
agentlame / comskip.ini
Created November 12, 2018 14:55
Default comskip file for Plex Media Server
; See comskip.txt in the distribution zip file for many settable parameters, read manual.html, tuning.html and debugwindow.html for how to tune and debug comskip
detect_method=43 ; 1=black frame, 2=logo, 4=scene change, 8=fuzzy logic, 16=closed captions, 32=aspect ration, 64=silence, 128=cutscenes, 255=all
validate_silence=1 ; Default, set to 0 to force using this clues if selected above.
validate_uniform=1 ; Default, set to 0 to force using this clues (like pure white frames) if blackframe is selected above.
validate_scenechange=1 ; Default, set to 0 to force using this clues if selected above.
verbose=10 ; show a lot of extra info, level 5 is also OK, set to 0 to disable
max_brightness=60 ; frame not black if any pixels checked are greater than this (scale 0 to 255)
test_brightness=40 ; frame not pure black if any pixels checked are greater than this, will check average brightness (scale 0 to 255)
max_avg_brightness=25 ; maximum average brightness for
@Khalmatov
Khalmatov / config-nginx-gunicorn+django
Created March 3, 2021 11:35
Настройка NGINX + Gunicorn + Django
Подготовка:
Установка всех пакетов:
sudo apt update
sudo apt install python3-pip python3-dev libpq-dev postgresql postgresql-contrib nginx curl
Создание виртуальной среды:
sudo pip3 install virtualenv
mkdir ~/myprojectdir
cd ~/myprojectdir
@craig-m
craig-m / README.md
Last active May 18, 2024 01:49
Packer Vagrant VirtualBox Ubuntu 22.04 install with Cloud-Init

Ubuntu Packer VirtualBox

A simple Packer + Vagrant VirtualBox install of Ubuntu live-server 22.04 (x86) using Cloud-Init, and documentation of my host desktop.

host setup

A fresh install of any supported LTS or the latest Ubuntu desktop version is good. I have tested this on ubuntu 18.04.6 running on an i5-4570 (4 core 3.20GHz) with 16GB of RAM, a nearly 10 year old computer. Get a dedicated machine, it need not be fancy or new.

Update and get setup with some tools + deps first: