Skip to content

Instantly share code, notes, and snippets.

@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active April 19, 2024 22:07
国内的 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+

@bmcbm
bmcbm / setup-nvdia-suspend.sh
Last active April 19, 2024 22:03
NVIDIA Suspend fix
# Use systemd for managing NVIDIA driver suspend in drivers ====>>> PRIOR to version 470 <<<=====
# https://download.nvidia.com/XFree86/Linux-x86_64/450.66/README/powermanagement.html
# https://forums.developer.nvidia.com/t/unable-to-set-nvidia-kernel-module-parameters/161306
# Please note: In Fedora Linux you may need to just install the xorg-x11-drv-nvidia-power pakage
# as sugested by @goombah88 in the comments below.
TMP_PATH=/var/tmp
TMPL_PATH=/usr/share/doc/nvidia-driver-460/
echo "options nvidia NVreg_PreserveVideoMemoryAllocations=1 NVreg_TemporaryFilePath=${TMP_PATH}" | sudo tee /etc/modprobe.d/nvidia-power-management.conf
#!/bin/bash
iatest=$(expr index "$-" i)
#######################################################
# SOURCED ALIAS'S AND SCRIPTS BY zachbrowne.me
#######################################################
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
@scottslowe
scottslowe / pf-launchd-item
Created May 15, 2013 05:00
This is a launchd item that you could use to automatically start pf on OS X Mountain Lion at boot.
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE plist PUBLIC "-//Apple Computer/DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.scottlowe.pf.plist</string>
<key>Program</key>
<string>/sbin/pfctl</string>
<key>ProgramArguments</key>
<array>
@XlogicX
XlogicX / games.md
Last active April 19, 2024 21:57
List of Boot Sector Gamers

Boot Sector Games

A list of playable boot sector games, most of which are on github. Fun to play, great to learn from. There are also many cool non-booting boot sectors out there that aren't games (so more like demos), but this page is just reserved to interactive boot sectors / games. This list is also not complete, but not on purpose, it is a best effort collection of games, so if you know of any fun boot sector games, please contribute.

This page lists a collection of 31 games spanning several authors: nanochess, me, daniel-e, shikhin, JulianSlzr, XanClic, QiZD90, darkvoxels, guyhill, w-shackleton, egtzori, VileR, ish_works, franeklubi, queso_fuego, franeklubi, Jethro82, waternine9, tevoran, palma3k, taylor-hartman. peterferrie should also be mentioned as he has touched a lot of these games.

TetrOS

https://github.com/daniel-e/tetros

Tetris Clone. Full color, no score. This was one of the older boot sector games out there. ![tetros](https://gist.github.com/assets/1570856/3a0d1023-cbe6-4b4d-

@jonleighton
jonleighton / base64ArrayBuffer.js
Last active April 19, 2024 21:54
Encode an ArrayBuffer as a base64 string
// Converts an ArrayBuffer directly to base64, without any intermediate 'convert to string then
// use window.btoa' step. According to my tests, this appears to be a faster approach:
// http://jsperf.com/encoding-xhr-image-data/5
/*
MIT LICENSE
Copyright 2011 Jon Leighton
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:
@dapepe
dapepe / TextTable.php
Last active April 19, 2024 21:53
Class to generate a Markdown-style table from a PHP array
<?php
/**
* Creates a markdown document based on the parsed documentation
*
* @author Peter-Christoph Haider <peter.haider@zeyon.net>
* @package Apidoc
* @version 1.00 (2014-04-04)
* @license GNU Lesser Public License
*/
@OmarMtya
OmarMtya / gist:9ce68c563893d1c774f11a94ea73a31c
Last active April 19, 2024 21:53
Flowbite decorator to fix Angular routing problem
import { initFlowbite } from "flowbite";
import { Subject, concatMap, delay, of } from "rxjs";
let flowbiteQueue = new Subject<any>();
flowbiteQueue.pipe(
concatMap(item => of(item).pipe(delay(100)))
).subscribe((x) => {
x();
})
@zburgermeiszter
zburgermeiszter / export-k8s.sh
Last active April 19, 2024 21:49
Export all resources from Kubernetes (k8s) clusters. Resources are exported to separate folders and files by namespace and API name.
#!/bin/bash
backup_folder="kubernetes_backup"
# Create a directory to store the backup
mkdir -p $backup_folder
# Get a list of all resource resources, including both namespaced and non-namespaced resources
resources=$(kubectl api-resources --verbs=list -o name)
# Get a list of all namespaces
@atenni
atenni / README.md
Last active April 19, 2024 21:48
How to permalink to a gist's raw file

Problem: When linking to the raw version of a gist, the link changes with each revision.

Solution:

To return the first file from a gist: https://gist.github.com/[gist_user]/[gist_id]/raw/

To get a file from multi–file gist: https://gist.github.com/[gist_user]/[gist_id]/raw/[file_name]