Skip to content

Instantly share code, notes, and snippets.

View todoleza's full-sized avatar

Tomáš Doležal todoleza

  • Red Hat
  • CZ - Brno
View GitHub Profile
@zajdee
zajdee / Digital-Green-Certificate-Dump.py
Last active November 5, 2021 19:15
A simple tool to dump the European Union's COVID passports (Digital Green Certificates)
#!/usr/bin/env python3
# install dependencies:
# pip install base45 cbor2 (cwt - not used here)
import sys
import zlib
from base45 import b45decode
from cbor2 import loads
@PCHSwS
PCHSwS / turn-off-screen.ps1
Created April 18, 2021 16:45 — forked from oledid/turn-off-screen.ps1
PowerShell: Turn off computer screen
# Source: http://www.powershellmagazine.com/2013/07/18/pstip-how-to-switch-off-display-with-powershell/
# Turn display off by calling WindowsAPI.
# PostMessage(HWND_BROADCAST,WM_SYSCOMMAND, SC_MONITORPOWER, POWER_OFF)
# HWND_BROADCAST 0xffff
# WM_SYSCOMMAND 0x0112
# SC_MONITORPOWER 0xf170
# POWER_OFF 0x0002
powershell (Add-Type '[DllImport(\"user32.dll\")]^public static extern int PostMessage(int hWnd, int hMsg, int wParam, int lParam);' -Name a -Pas)::PostMessage(-1,0x0112,0xF170,2)
@xan7r
xan7r / decryptKerbTicket.py
Last active April 10, 2024 04:29
Decrypt kerberos tickets and parse out authorization data
#!/usr/bin/env python2
# NOTE: this script was created for educational purposes to assist learning about kerberos tickets.
# Likely to have a few bugs that cause it to fail to decrypt some TGT or Service tickets.
#
# Recommended Instructions:
# Obtain valid kerberos tickets using Rubeus or mimikatz "sekurlsa::tickets /export"
# Optionally convert tickets to ccache format using kekeo "misc::convert ccache <ticketName.kirbi>"
# Obtain appropriate aes256 key using dcsync (krbtgt for TGT or usually target computer account for Service Ticket)
# Run this script to decrypt:
# ./decryptKerbTicket.py -k 5c7ee0b8f0ffeedbeefdeadbeeff1eefc7d313620feedbeefdeadbeefafd601e -t ./Administrator@TESTLAB.LOCAL_krbtgt~TESTLAB.LOCAL@TESTLAB.LOCAL.ccaches
@klingtnet
klingtnet / how-to-upgrade-nvmw-ssd-firmware-on-linux.md
Last active September 16, 2023 23:37
How to upgrade [Lenovo] NVMe SSD firmware on Linux

The instructions were tested on a Lenovo X1 Carbon 5th Gen (X1C5) on Arch Linux but should be applicable to other Lenovo models and Linux distributions.

BACKUP YOUR DATA! I created a bootable Ubuntu Image like this:

$ sudo sh -c 'curl --location --silent --fail "http://releases.ubuntu.com/18.04/ubuntu-18.04.1-desktop-amd64.iso" | pv > /dev/<your-usb-drive>'
# note that pv is only there to show progress, it is perfectly fine to redirect curl to the usb drive directly.

then I booted from this drive by pressing F12 on reboot and dumped my NVMe disk to an external hard drive like this:

@lynt-smitka
lynt-smitka / .htaccess
Last active January 27, 2024 05:56
Block hidden files except .well-known - Apache .htaccess + Nginx
RewriteRule "(^|/)\.(?!well-known\/)" - [F]
@MawKKe
MawKKe / cryptsetup-with-luks2-and-integrity-demo.sh
Last active April 29, 2024 21:19
dm-crypt + dm-integrity + dm-raid = awesome!
#!/usr/bin/env bash
#
# Author: Markus (MawKKe) ekkwam@gmail.com
# Date: 2018-03-19
#
#
# What?
#
# Linux dm-crypt + dm-integrity + dm-raid (RAID1)
#
@lubien
lubien / stickers-downloader.js
Last active November 21, 2023 03:06
Download all visible telegram stickers images
// How to download telegram sticker images
/*
1. Go to Telegram Web;
2. Open console (F12);
3. Paste the code below in the console and press Enter;
4. Open your stickers menu and make sure you see the sticker pack you want to download (so Telegram will load it).
5. At the console paste and run "downloadStickers()" any time you want to download a pack.
6. [Convert .webm to another format](http://www.freewaregenius.com/convert-webp-image-format-jpg-png-format/);
7. Happy hacking.
@AsciiWolf
AsciiWolf / systemd.txt
Last active September 22, 2017 15:16
systemd tahák
Základní systemd utility:
systemctl # správa systému a služeb
journalctl # správa systemd journalu (logu)
loginctl # správa systemd logind
hostnamectl # vypsání a změna hostname
localectl # vypsání a změna locale a klávesnice
timedatectl # vypsání a změna času a data
busctl # práce s D-Bus busem
Základní typy unit:
@hroncok
hroncok / wedos-updatedns.py
Last active January 24, 2021 13:45
OpenShift WEDOS domain updater
#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
OpenShift WEDOS domain updater
==============================
This script makes sure that your main domain (example.org) resolves to the
same IP address as your WWW domain (www.example.org). When you run your
webapp on OpenShift, you should set CNAME DNS records, however, this is not
possible for main domains, such as example.org without a subdomain.