Skip to content

Instantly share code, notes, and snippets.

IN_LLDB = False # DO NOT MOVE THIS
import sys
import struct
import subprocess
import os
import os.path
# usage: python3 frida_patcher.py TARGET_BINARY_PATH [args...]
# spawns the specified target in a "blocked but not suspended" state that allows frida to attach.
@nalgeon
nalgeon / 00_inn.md
Last active July 16, 2024 11:29
Определить ИНН по паспортным данным человека

Определить ИНН по паспортным данным человека

В поддержку «Дадаты» часто обращаются с вопросом «как получить ИНН по паспортным данным». Налоговая служба предоставляет такой сервис, но без API.

В интернете есть несколько сайтов, которые предоставляют сервис «узнать ИНН» через API. Насколько нам известно, все они используют «неофициальный» интерфейс взаимодействия с налоговой, потому что ни официального API, ни открытых данных по ИНН не существует.

Мы в «Дадате» не хотим подключать неофициальное API налоговой: оно не отличается стабильностью работы и имеет непонятные перспективы. Если вы очень хотите получать ИНН через API — вызывайте API налоговой напрямую. Мы подготовили примеры, как это сделать на самых популярных языках — Python, PHP и JavaScript.

API налоговой бесплатное, но используете его вы на свой страх и риск. Никто не гарантирует, что оно будет работать корректно и стабильно.

@MT224244
MT224244 / ponder_portal_README.md
Last active July 16, 2024 11:28
PonderJSで試しに作ったネザーポータル作成思案
@obfusk
obfusk / break.py
Last active July 16, 2024 11:26
python "breakpoint" (more or less equivalent to ruby's binding.pry); for a proper debugger, use https://docs.python.org/3/library/pdb.html
import code; code.interact(local=dict(globals(), **locals()))
# nix-env -p /nix/var/nix/profiles/system --delete-generations old
# nix-collect-garbage -d
# nix-env -p /nix/var/nix/profiles/system --list-generations
## Remove entries from /boot/loader/entries:
# sudo bash -c "cd /boot/loader/entries; ls | grep -v <current-generation-name> | xargs rm"
@pvanliefland
pvanliefland / README.md
Last active July 16, 2024 11:25
Django embed template tag

embed template tag

Rationale

The issue

When working on a web application, you may have, on different screens, a variable number of similar components with minor differences. A "card" component is a good example: every card has a wrapper section element, a title, and an arbitrary content wrapped inside a div element.

Consider the following simplified HTML example of an application :

@Xiol
Xiol / README.md
Last active July 16, 2024 11:20
Extend Gitlab access token expiry dates

Extend Gitlab Access Tokens

Gitlab enforced token expiry limits to 365 days last year, and the time is now upon us.

They don't have an opt-out for this, and haven't provided a way to easily extend tokens in the web interface. They have also gated their credential management interface behind their Ultimate license.

This quickly thrown together script will allow you to add an extra year to all tokens that expire in the next 30 days. It will not reactivate tokens that have already expired.

Requires the python-gitlab module. Edit your self-hosted Gitlab instance details into the script and run it. It will dump out CSVs of all expiring tokens, and then dump out a list of commands you can paste into a gitlab-rails console session to extend the expiry date by another year. If you need them to be active for longer, change 1.year.from_now to the value of your choice, e.g. `10.years.fro

@seedprod
seedprod / gist:272610
Created January 9, 2010 00:34
WordPress Loop Shortcode
// The Loop
/*
* Usage: loop category="news" query="" pagination="false"
*/
<?php
add_shortcode("loop", "myLoop");
function myLoop($atts, $content = null) {
extract(shortcode_atts(array(
@xiaolai
xiaolai / Readling-Aloud-MS-EDGE.md
Last active July 16, 2024 11:16
使用微软 Edge 浏览器的朗读功能

微软的浏览器,Edge,是基于 Google 的 Chrome 制作的。最近的新版本中,Edge 推出了基于 AI 的「自动朗读文本」…… 这其实并不是一个新鲜功能 —— IBM Voice 推出(1997)到现在都已经 24 年了…… 当时在 Windows 95 上试用这个功能的时候,纯粹是「鸡肋」的感觉。

1

然而,这一次的确不一样,从用户的角度,它不仅实用,而且真的很好 —— 起码,朗读已经基本上听不出「机器口音」了。

试用了一下之后,马上因为这个功能从各种浏览器中直接迁徙到了 Edge ���。想想微软也是很奇葩,弃用 Windows 的我在十年之后,发现手中用的东西,微软的还挺多,比如,github,vscode, 还有现在的这个 edge…

这个文本朗读功能(Read Aloud)在几天之内就彻底改变了我的新闻阅读习惯 —— 从过去「主要看新闻」直接变成了「只听新闻」…… 尤其是我现在整天站在工作台前的走步机上,更使得我喜欢这个文本朗读功能。

@fchollet
fchollet / classifier_from_little_data_script_1.py
Last active July 16, 2024 11:16
Updated to the Keras 2.0 API.
'''This script goes along the blog post
"Building powerful image classification models using very little data"
from blog.keras.io.
It uses data that can be downloaded at:
https://www.kaggle.com/c/dogs-vs-cats/data
In our setup, we:
- created a data/ folder
- created train/ and validation/ subfolders inside data/
- created cats/ and dogs/ subfolders inside train/ and validation/
- put the cat pictures index 0-999 in data/train/cats