Skip to content

Instantly share code, notes, and snippets.

View MrQubo's full-sized avatar
🐶
Bugging & Depwning

Jakub Nowak MrQubo

🐶
Bugging & Depwning
View GitHub Profile
@MrQubo
MrQubo / configuration.nix
Created April 26, 2025 17:59
synaTudor on NixOS
{
pkgs,
...
}:
{
environment.systemPackages = [ pkgs.libfprint-2-tod1-synatudor ];
services.dbus.packages = [ pkgs.libfprint-2-tod1-synatudor ];
systemd.packages = [ pkgs.libfprint-2-tod1-synatudor ];
@MrQubo
MrQubo / test.hs
Created December 17, 2023 19:05
Implicit constraint on associated type family
{-# LANGUAGE
DerivingStrategies,
TypeFamilies,
PatternSynonyms,
DataKinds
#-}
class (Show (SymbolIdent' p)) => IdentParam p where
data SymbolIdent' p
@MrQubo
MrQubo / solve.sage
Created November 30, 2021 18:10
Power Up (AtHackCTF) solution
import itertools
from pathlib import Path
def tonelli3(a,p,many=False):
def solution(p,root):
g=p-2
while pow(g,(p-1)//3,p)==1: g-=1 #Non-trivial solution of x**3=1
g=pow(g,(p-1)//3,p)
return sorted([root%p,(root*g)%p,(root*g**2)%p])
#!/usr/bin/env bash
set -o errexit -o nounset -o pipefail
declare -r NAME="toggle-redshift"
# If user doesn't have write permission to /var/lock then the $NAME directory
# with write permissions should be created beforehand.
declare -r LOCK_FILE="/var/lock/$NAME/$NAME.lock"
declare -r PERSISTENT_FILE="/tmp/$NAME.tmp"
@MrQubo
MrQubo / attempt.rs
Last active December 6, 2018 15:07
Multi-index operator attempt in rust
mod Foo
{
use ::std::ops;
pub struct Bar<T>
{
a: T,
@MrQubo
MrQubo / test.cc
Created December 2, 2018 23:21
WTF c++ ?
#include <chrono>
#include <ctime>
#include <iostream>
#include <thread>
template <auto f>
constexpr auto foo() {
return f();
}
@MrQubo
MrQubo / error
Last active December 2, 2018 13:39
O co chodzi?
$ clang -Wall -Wextra -std=c++17 -O2 commonfleet.o rebelfleet.o commonfleet.o rebelfleet.o test.cc -o test
/usr/bin/ld: /tmp/test-394cbc.o: in function `main':
test.cc:(.text+0x2e): undefined reference to `RebelArmedStarship<float, 299796ll, 2997960ll>::RebelArmedStarship(float, float, float)'
clang-7: error: linker command failed with exit code 1 (use -v to see invocation)
@MrQubo
MrQubo / CMakeLists.txt
Created May 5, 2018 12:59
KConfig "ItemAccessors doesn't work with signals" bug MWE
cmake_minimum_required(VERSION 2.8.12)
set(KF5_MIN_VERSION "5.15.0")
set(ECM_MIN_VERSION "1.8.0")
find_package(ECM ${ECM_MIN_VERSION} REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
include(KDEInstallDirs)
import string
# num = msg * C
# We know num, so we have to check every possible C,
# but there's a hint "P.S.2. It's just two bytes.",
# so we only check two-byte numbers
num = 1087943696176439095600323762148055792209594928798662843208446383247024 # given number
# converts integer to array of its bytes
#include <cstdio>
#include <cinttypes>
#include <iostream>
int main();
#define in :
template<typename T>
struct _xrange {
T b, e;