Skip to content

Instantly share code, notes, and snippets.

@mooware
mooware / gnu-libc-print-stacktrace.c
Last active April 25, 2024 12:29
Print a stacktrace on Linux with GNU libc
// this code fragment shows how to print a stack trace (to stderr)
// on Linux using the functions provided by the GNU libc
#include <execinfo.h>
#define MAX_STACK_LEVELS 50
// helper-function to print the current stack trace
void print_stacktrace()
{
private val DefaultHighlightWidth = 136.dp
private val DefaultDuration = 1200.milliseconds
private val DefaultDelay = 1.seconds
private val DefaultStartColor = Color(0x32394A00)
private val DefaultMiddleColor = Color.White
private val DefaultEndColor = DefaultStartColor
private const val DefaultAlpha = 0.2F
private val DefaultShape = RoundedCornerShape(12.dp)
@Composable
@ricksladkey
ricksladkey / log.py
Last active April 25, 2024 12:27
Example Python script for GDB that reads and displays the text in a ring buffer every time the program stops
from __future__ import print_function
import struct
import gdb
def log():
# Get the inferior.
try:
@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active April 25, 2024 12:27
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized

Docker Hub 镜像加速器

国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。Docker 官方和国内很多云服务商都提供了国内加速器服务。

Dockerized 实践 https://github.com/y0ngb1n/dockerized

配置加速地址

Ubuntu 16.04+、Debian 8+、CentOS 7+

@xgroleau
xgroleau / sonarr-symlink.sh
Last active April 25, 2024 12:27
symlink script for sonarr
@MarkusH
MarkusH / serial-to-identity.sql
Last active April 25, 2024 12:26
A script that outputs the raw SQL to convert Django's serial columns to identity columns.
WITH tab AS (
SELECT
a.attrelid::regclass::text AS t,
a.attname AS c,
pg_get_serial_sequence(a.attrelid::regclass::text, a.attname) AS s,
nextval(pg_get_serial_sequence(a.attrelid::regclass::text, a.attname)) AS v
FROM pg_attribute a
JOIN pg_class c ON c.oid = a.attrelid
WHERE
a.attrelid::regclass::text LIKE '%'
@FreddieOliveira
FreddieOliveira / docker.md
Last active April 25, 2024 12:24
This tutorial shows how to run docker natively on Android, without VMs and chroot.

Docker on Android 🐋📱

Edit 🎉

All packages, except for Tini have been added to termux-root. To install them, simply pkg install root-repo && pkg install docker. This will install the whole docker suite, left only Tini to be compiled manually.


Summary

@kunicmarko20
kunicmarko20 / Readme.md
Last active April 25, 2024 12:24
ThinkPad keeps turning off because temprature is too high when charging

Thinkpad (Lenovo ThinkPad X1 Carbon Gen 9) Overheating resolved

This laptop overheats a lot, which makes it turn off a lot. As soon as I connect it to charger and I am in balanced power mode, CPU temp goes over 100.

This script will switch power mode to "power saving" when charging which should keep the temperatur around 60.

@sam0737
sam0737 / clock.html
Last active April 25, 2024 12:24
OBS Studio: A HTML page for showing current date and time in the video
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>A simple clock</title>
</head>
<body translate="no" >