Skip to content

Instantly share code, notes, and snippets.

@thesamesam
thesamesam / xz-backdoor.md
Last active May 16, 2024 19:46
xz-utils backdoor situation (CVE-2024-3094)

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

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.

Background

On March 29th, 2024, a backdoor was discovered in xz-utils, a suite of software that

@7645re
7645re / JetBrainsActivation.md
Last active May 18, 2024 08:35
JetBrains Activation MacOS/Windows

1. Proxifier method

Right now, the easiest way to activate JetBrains products is to use redirection of all requests from the application to localhost, but then nothing will work for you, neither pull/push git nor other plugins that use Internet access.

There is a better way, we will forward requests only to those that will go to the address account.jetbrains.com. This can be done without using the program, but it seems to me the easiest way to do it is through Proxifier. This program is available for both Windows and macOS.

@adtac
adtac / Dockerfile
Last active April 13, 2024 22:33
#!/usr/bin/env docker run
#!/usr/bin/env -S bash -c "docker run -p 8080:8080 -it --rm \$(docker build --progress plain -f \$0 . 2>&1 | tee /dev/stderr | grep -oP 'sha256:[0-9a-f]*')"
# syntax = docker/dockerfile:1.4.0
FROM node:20
WORKDIR /root
RUN npm install sqlite3

AppArmor

  1. AppArmor là gì?
  2. Có các chức năng gì?
  3. Cấu hình như thế nào?

AppArmor

  1. AppArmor là một công cụ cho phép quản lý các chương trình, cho phép giới hạn quyền truy cập vào các file trên hệ thống với một program.

Khác với window's UAC, trao quyền cho user, AppArmor giới hạn khả năng truy cập cho các program

@thrawn01
thrawn01 / main.go
Created December 3, 2018 20:34
etcd `concurrency.Election` example with connection interruption detection and initial leadership status reporting
package main
import (
"context"
"fmt"
"os"
"os/signal"
"syscall"
"time"
@creack
creack / main.go
Created January 7, 2018 17:30 — forked from enricofoltran/main.go
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"fmt"
"log"
"net/http"
"os"
"os/signal"
"strconv"
@enricofoltran
enricofoltran / main.go
Last active April 1, 2024 00:17
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@jmarroyave
jmarroyave / myappindicator_v5.py
Last active January 11, 2019 22:34 — forked from candidtim/myappindicator_v5.py
Ubuntu AppIndicator to show Chuck Norris jokes - Updated to python 3
# This code is an example for a tutorial on Ubuntu Unity/Gnome AppIndicators:
# http://candidtim.github.io/appindicator/2014/09/13/ubuntu-appindicator-step-by-step.html
import os
import signal
import json
from urllib import request
from urllib.error import URLError
from urllib.request import urlopen
@tokestermw
tokestermw / restore_tf_models.py
Created February 21, 2017 21:09
Restoring frozen models are hard in TensorFlow.
"""
Play with saving .
Closest:
https://github.com/tensorflow/tensorflow/issues/616#issuecomment-205620223
"""
import numpy as np
import tensorflow as tf
from tensorflow.python.platform import gfile
@JPvRiel
JPvRiel / linux_memory_control_to_avoid_swap_thrashing.md
Created November 7, 2016 22:29
Notes on linux memory management options to prioritize and control memory access using older ulimits, newer cgroups and overcommit policy settings. Mostly as an attempt to keep a desktop environment responsive and avoid swap thrashing under high memory pressure.

Overview

Some notes about:

  • Explaining why current day Linux memory swap thrashing still happens (as of 2016).
  • Mitigating "stop the world" type thrashing issues on a Linux workstation when it's under high memory pressure and where responsiveness is more important than process completion.
  • Prioritizing and limiting memory use.
  • Older ulimit versus newer CGroup options.

These notes assume some basic background knowledge about memory management, ulimits and cgroups.