Skip to content

Instantly share code, notes, and snippets.

@attractivechaos
attractivechaos / getopt.c
Created February 18, 2018 13:28
Implementation of getopt() and getopt_long() from musl
#include <stddef.h>
#include <stdio.h>
#include <string.h>
#include "getopt.h"
char *optarg;
int optind=1, opterr=1, optopt, __optpos, optreset=0;
#define optpos __optpos
@Mnkai
Mnkai / README.md
Last active November 4, 2024 11:37
TDP and turbo parameter modification with MSR on non-overclockable Intel CPU (such as Intel i7-8550U)

TDP and Turbo Parameter Modification with MSR on Non-Overclockable CPUs

Disclaimer

  • Modifying MSR may void your CPU's (or system board's) warranty. Proceed with caution. I am not responsible for any damage caused by this article.
  • MSR addresses vary significantly between CPUs. Check your CPU's MSR address using Intel's documentation.
  • This has only been tested on the Intel i7-8550U (Kaby Lake R).
  • This article is a translation of this article. If you can read Korean, I recommend reading that article instead.

Introduction

@ecliptik
ecliptik / aarch64qemu.md
Last active August 16, 2023 11:03
Ubuntu 14.04 arm64 Port QEMU Configuration

Setting up a Ubuntu 14.04 or Debian 8 (jessie) arm64 VM

This is mainly a notes dump and should be used for reference. This guide assumes:

  • Ubuntu 14.04 (or Debian 8) hypervisor/host with bridge networking
  • Knowledge of qemu
  • Knowledge of debootstrap

Limitations of the qemu-system-aarch64 emulator on x86 include only being able to emulate one CPU and no KVM support.

@aslpavel
aslpavel / bashrc
Last active October 6, 2022 16:49
Simple bashrc with nice prompt
# simple bashrc with nice prompt
# link: https://gist.github.com/aslpavel/5925739
# install: wget --no-check-certificate -q -O - https://gist.github.com/aslpavel/5925739/download | tar -xzO -f- --strip-components=1 > "$HOME/.bashrc"
[ -z "$PS1" ] && return
### PROMPT
case $TERM in
linux|rxvt)
col_user=3
@hakre
hakre / iconv-l.txt
Created December 2, 2012 12:35
Iconv List of Encodings
ANSI_X3.4-1968 ANSI_X3.4-1986 ASCII CP367 IBM367 ISO-IR-6 ISO646-US ISO_646.IRV:1991 US US-ASCII CSASCII
UTF-8
ISO-10646-UCS-2 UCS-2 CSUNICODE
UCS-2BE UNICODE-1-1 UNICODEBIG CSUNICODE11
UCS-2LE UNICODELITTLE
ISO-10646-UCS-4 UCS-4 CSUCS4
UCS-4BE
UCS-4LE
UTF-16
UTF-16BE