Skip to content

Instantly share code, notes, and snippets.

View janoskk's full-sized avatar
🏠
Working from home

Janos Kasza janoskk

🏠
Working from home
  • Budapest, Hungary
View GitHub Profile
@hoop33
hoop33 / kittycolors.zsh
Last active February 9, 2023 22:26
A shell function for displaying your kitty theme colors
# Prerequisites:
# kitty: https://sw.kovidgoyal.net/kitty/
# kitty themes: https://github.com/dexpota/kitty-themes
# pastel: https://github.com/sharkdp/pastel
# Usage:
# $ kittycolors
# $ kittycolors -s
kittycolors() {
if [[ $# -eq 0 ]]; then
grep -o "#[a-f0-9]\{6\}" ~/.config/kitty/current-theme.conf | pastel color
@asheroto
asheroto / Public-Key-Authentication-Troubleshooting.md
Last active December 22, 2024 11:24
OpenSSH on Windows - working sshd_config for public key authentication

Public key authentication troubleshooting

Make sure you don't have ANY instances of sshd or ssh-agent running (important):

  • Run PowerShell as Administrator:
Stop-Service sshd
Stop-Service ssh-agent
taskkill /f /im sshd.exe
taskkill /f /im ssh-agent.exe
@hzhangxyz
hzhangxyz / custom.cfg
Created August 22, 2018 15:07
boot from iso via grub
menuentry 'ubuntu live' {
set rootuuid=709ba2df-2ded-4a27-83fe-34093fe97ce7
search --no-floppy --fs-uuid --set=root $rootuuid
set isofile='/img/ubuntu-18.04.1-desktop-amd64.iso'
loopback loop $isofile
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile
initrd (loop)/casper/initrd.lz
}
menuentry 'debian live' {
@fntlnz
fntlnz / self-signed-certificate-with-custom-ca.md
Last active December 20, 2024 19:41
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@pudquick
pudquick / loginwindow_events.py
Created April 7, 2016 08:15
Send polite Logout / "really" Logout / Restart / Shutdown Apple Events to loginwindow via python and pyObjC
import struct, objc
from Foundation import NSBundle
from Cocoa import NSAppleEventDescriptor
def OSType(s):
# Convert 4 character code into 4 byte integer
return struct.unpack('>I', s)[0]
# Create an opaque pointer type to mask the raw AEDesc pointers we'll throw around
AEDescRef = objc.createOpaquePointerType('AEDescRef', '^{AEDesc=I^^{OpaqueAEDataStorageType}}')
@LiveOverflow
LiveOverflow / cookbook.py
Last active June 6, 2022 11:54
Exploit for cookbook challenge from Boston Keyparty CTF 2016
import struct
import sys
import subprocess
import socket
import telnetlib
import ctypes
"""
Cookbook - 6 - 0 solves : pwn: a top chef wrote this cookbook for me but i think he has an extra secret recipe!
https://s3.amazonaws.com/bostonkeyparty/2016/58056c425dc617b65f94a8b558a4699fedf4a9fb.tgz
@masahirompp
masahirompp / User.ts
Last active May 5, 2021 20:04
mongoose + typescript
/// <reference path="../tsd/tsd.d.ts" />
import mongoose = require('mongoose');
import passport = require('passport');
interface IUser extends mongoose.Document {
provider: string;
id: string;
authorId: string;
displayName: string;
@mridgers
mridgers / pdbdump.c
Created June 21, 2012 21:19
Small tool to list and query symbols in PDB files.
//------------------------------------------------------------------------------
// pdbdump.c - dump symbols from .pdb and executable files (public domain).
// - to compile; cl.exe /Ox /Zi pdbdump.c
// -
// - Martin Ridgers, pdbdump 'at' fireproofgravy.co.uk
//------------------------------------------------------------------------------
#include <stdio.h>
#include <Windows.h>
#include <DbgHelp.h>
@sivachandran
sivachandran / SimpleTcpRedirector.py
Created March 4, 2012 01:42
A simple TCP redirector in python
#!/usr/bin/env python
import socket
import threading
import select
import sys
terminateAll = False
class ClientThread(threading.Thread):