Instantly share code, notes, and snippets.
Discover gists
Discord timestamps can be useful for specifying a date/time across multiple users time zones. They work with the Unix Timestamp format and can be posted by regular users as well as bots and applications.
The Epoch Unix Time Stamp Converter is a good way to quickly generate a timestamp. For the examples below I will be using the Time Stamp of1543392060, which representsNovember 28th, 2018 at09:01:00 hours for my local time zone (GMT+0100 Central European Standard Time).
| Style | Input | Output (12-hour clock) | Output (24-hour clock) |
|---|---|---|---|
| Default | <t:1543392060> | November 28, 2018 9:01 AM | 28 November 2018 09:01 |
| // Source: https://gist.github.com/luetkemj/2023628 | |
| // Xem hướng dẫn WP_Query toàn tập: http://goo.gl/kRpzTz | |
| <?php | |
| $args = array( | |
| //////Author Parameters - Tham số lấy bài viết theo tác giả | |
| //http://codex.wordpress.org/Class_Reference/WP_Query#Author_Parameters | |
| 'author' =>'1,2,3,',//(int) - Các ID tác giả cần lấy bài viết (thêm dấu - vào để loại trừ tác giả, ví dụ: -14, -20) | |
| 'author_name' =>'luetkemj',//(string) - Lấy bài viết dựa theo tên nick name của tác giả | |
| 'author__in' =>array(2,6 ),//(array) - Lấy bài dựa theo ID của tác giả |
В Python есть отличная встроенная библиотека - logging. Часто ее противопоставляют print-ам, однако на мой взгляд это гораздо более весомый инструмент. Разобравшись с некотрыми приемами в работе, хочу поделиться с сообществом наиболее, на мой взгляд, интересными вещами. Данная заметка основана наофициальнойдокументации, и по сути является частичным вольным переводом.
Для самого простого использования, модуль предоставляет функции debug(), info(), warning(), error() и critical(). Название функций соответствует названию уровней или серьезности логируемых событий. Рекомендации по использованию стандартных уровней сведены в таблицу (в порядке возрастания серьезности).
| Уровень сообщений | Когда использовать |
|---|---|
| CRITICAL | Критическая ошибка, выполнение программы невозможно |
| ERROR | Из-за серьезной ошибки программа не смогла выполнить какую-либо функ |
| import Foundation | |
| import WebKit | |
| final class WebCacheCleaner { | |
| class func clean() { | |
| HTTPCookieStorage.shared.removeCookies(since: Date.distantPast) | |
| print("[WebCacheCleaner] All cookies deleted") | |
| WKWebsiteDataStore.default().fetchDataRecords(ofTypes: WKWebsiteDataStore.allWebsiteDataTypes()) { records in |
| Whenever I try using Frida from the official repo https://build.frida.re I kept getting the following errors after which my device panics and restarts: | |
| default15:46:47.251624 +0530kernelAMFI: '/private/var/tmp/frida-D8kjW6.dylib' has no CMS blob? | |
| default15:46:47.251817 +0530kernelAMFI: '/private/var/tmp/frida-D8kjW6.dylib': Unrecoverable CT signature issue, bailing out. | |
| Looks like codesigning/entitlements issue. Here are the steps I followed to get Frida Running on a jailbroken iOS 12 device | |
| Downloads Latest version of Frida from https://github.com/frida/frida/releases. In my case it was frida-server-12.4.0-ios-arm64.xz. | |
| xz -d frida-server-12.4.0-ios-arm64.xz | |
| scp frida-server-12.4.0-ios-arm64 root@<ios-device-ip>:/usr/bin/frida-server |
| -- Yoneda -------------------------------------------------------------- | |
| newtypeYonedafa=Yoneda{runYoneda::forallb. ((a->b)->fb)} | |
| instanceFunctor (Yonedaf)where | |
| fmap f y=Yoneda (\ab-> runYoneda y (ab. f)) | |
| toYoneda::Functorf=>fa->Yonedafa | |
| toYoneda fa=Yoneda (\f->fmap f fa) | |
| fromYoneda::Yonedafa->fa |
| admin account info" filetype:log | |
| !Host=*.* intext:enc_UserPassword=* ext:pcf | |
| "# -FrontPage-" ext:pwd inurl:(service | authors | administrators | users) "# -FrontPage-" inurl:service.pwd | |
| "AutoCreate=TRUE password=*" | |
| "http://*:*@www" domainname | |
| "index of/" "ws_ftp.ini" "parent directory" | |
| "liveice configuration file" ext:cfg -site:sourceforge.net | |
| "parent directory" +proftpdpasswd | |
| Duclassified" -site:duware.com "DUware All Rights reserved" | |
| duclassmate" -site:duware.com |
| inurl:"/vpn/tmindex.html" vpn | |
| intext:"Powered by GetSimple" -site:get-simple.info | |
| inurl:"/fuel/login" | |
| intitle:"index of" intext:"Includes wordpress" | |
| intitle:"netscaler gateway" intext:password "please log on" | |
| inurl:users.json + "username" | |
| intitle:"index of" intext:"Includes | |
| inurl:old "index of" "wp-config.php" |
| import json | |
| import requests | |
| from authentik.sources.plex.models import UserPlexSourceConnection | |
| connection = UserPlexSourceConnection.objects.filter(user=request.user).first() | |
| if not connection: | |
| ak_logger.info("Overseer: No Plex connection found") | |
| return {} | |
| base_url = "http://overseerr:5055" |