Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@thesamesam
thesamesam / xz-backdoor.md
Last active April 23, 2024 12:44
xz-utils backdoor situation (CVE-2024-3094)

FAQ on the xz-utils backdoor (CVE-2024-3094)

This is still a new situation. There is a lot we don't know. We don't know if there are more possible exploit paths. We only know about this one path. Please update your systems regardless.

This is a living document. Everything in this document is made in good faith of being accurate, but like I just said; we don't yet know everything about what's going on.

@suy
suy / main.cpp
Created May 25, 2020 07:25
A simple tool to sort and print in a more human readable form the compiler output
#include <QtCore>
static void dump(const char* name, const QStringList& variable) {
QTextStream out(stdout);
out << variable.count() << " " << name << endl;
foreach (const QString& item, variable) {
out << " " << item << endl;
}
}
@oleavr
oleavr / frida-logging.md
Last active April 7, 2023 08:53
Frida logging hacks

Frida logging helper

For adding temporary logging to help understand behavior. For when it is impractical to use Frida to instrument Frida.

Choose one of these and copy-paste it into e.g. lib/interfaces/session.vala, then use log_event ("name='%s'", name); to log.

When something appears to be hanging, try applying: x-async-debug.patch.

@rchoudhary
rchoudhary / random.cpp
Created October 29, 2018 07:51
An experiment with random number generation
#include <cstdio>
#include <random>
#include <algorithm>
#include <chrono>
int getRandNum_Old() {
static bool init = false;
if (!init) {
std::srand(time(nullptr)); // Seed std::rand
init = true;
@oKcerG
oKcerG / colattachedtype.cpp
Last active April 5, 2017 10:53
Bootstrap grid system PoC in QML
#include "colattachedtype.h"
#include <QQuickItem>
#include <QQuickWindow>
#include <QQmlInfo>
ColAttachedType::ColAttachedType(QObject* parent) :
QObject{parent},
m_item{qobject_cast<QQuickItem*>(parent)}
{
if (!m_item) {
@ssokolow
ssokolow / firefox_migration.rst
Last active February 26, 2024 04:35
Disaster Plans for Firefox XUL Sunset

Disaster Plans for Firefox XUL Sunset

Public URL

Github Gist

Status

Incomplete

Last Updated

2018-08-23 04:10 EDT

Threat Summary

@edsu
edsu / replies.py
Last active December 7, 2022 18:59
Try to get replies to a particular set of tweets, recursively.
#!/usr/bin/env python
"""
Twitter's API doesn't allow you to get replies to a particular tweet. Strange
but true. But you can use Twitter's Search API to search for tweets that are
directed at a particular user, and then search through the results to see if
any are replies to a given tweet. You probably are also interested in the
replies to any replies as well, so the process is recursive. The big caveat
here is that the search API only returns results for the last 7 days. So
#include <cassert>
#include <memory> // std::addressof
template<typename ResourceTag, typename ResourceType> class Resource {
public:
Resource() noexcept = default;
explicit Resource(ResourceType resource) noexcept : resource_{ resource } {}
Resource(const Resource&) = delete;
Resource& operator=(const Resource&) = delete;
@jbache
jbache / NavigationDrawer.qml
Created December 1, 2014 15:02
Qt Quick Navigation Drawer
/*
Copyright (c) 2014 Cutehacks A/S
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
@ddrown
ddrown / prune
Created October 20, 2014 15:00
Expire quassel backlog
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# run this in the directory ~/.config/quassel-irc.org/
import sqlite3
import time
con = sqlite3.connect('quassel-storage.sqlite')
with con: