Skip to content

Instantly share code, notes, and snippets.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lisp3r
lisp3r / curl.md
Created January 11, 2019 13:25 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@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.

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,
	}

Термы

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

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

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

  1. Атом - текстовая константа. Имя начинается с маленькой буквы и может содержать буквы, цифры, подчеркивание. Тип данных - символьный.

Процедура аутентификации в 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)
@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>

Dump a .plist file to stdout:

plutil -convert xml1 -o - filename.plist

@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):
@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
}