Discover gists
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import print_function | |
import struct | |
import gdb | |
def log(): | |
# Get the inferior. | |
try: |
国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。Docker 官方和国内很多云服务商都提供了国内加速器服务。
Dockerized 实践 https://github.com/y0ngb1n/dockerized
Ubuntu 16.04+、Debian 8+、CentOS 7+
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# see https://github.com/Sonarr/Sonarr/issues/967#issuecomment-228599877 | |
EVENT_TYPE="$sonarr_eventtype" | |
LOGFILE="/config/logs/sonarr-symlink.log" | |
ERROR_LOGFILE="/config/logs/sonarr-symlink.error.log" | |
PERMPATH="$sonarr_episodefile_path" | |
LINKPATH="$sonarr_episodefile_sourcepath" | |
main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 '%' |
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.
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>A simple clock</title> | |
</head> | |
<body translate="no" > |
NewerOlder