Skip to content

Instantly share code, notes, and snippets.

@plembo
plembo / czrocksdiskclone.md
Last active February 2, 2024 12:32
Clonezilla Rocks Ubuntu boot SSD to NVME

Cloning a Ubuntu boot SSD to NVME

Getting short of space on a 120G boot/root SSD on Ubuntu Server, decided to replace it with a bigger NVME (IDE) 250G drive.

Using the latest Clonezilla, the process was really painless. After cloning, there was still over 100G unallocated space on the larger drive for expansion of a new parition. The paritions of the clone had the same disk UUIDs and flags as the original.

  1. Checked disk and partition sizes using lsblk.
  2. Downloaded latest Stable iso from https://clonezilla.org/downloads.php.
  3. Get a 1G or more USB stick and burn the iso onto it using Startup Disk Creator.
  4. Installed the NVME drive onto the motherboard.
@dbrookman
dbrookman / build-mpv_silicon.sh
Last active April 15, 2024 20:34
How to build mpv & mpv.app on an Apple silicon Mac
#!/usr/bin/env bash
# Builds mpv & mpv.app on Apple silicon Macs.
# Run this script from the root directory of the mpv repo.
# if anything fails, gtfo
set -ex
meson setup build
meson compile -C build
@mytory
mytory / make-url-clickable-without-a-tag.php
Last active October 19, 2021 13:13
URL을 링크로 바꿔 주는데, 이미 링크가 걸린 a 태그는 건드리지 않는다.
<?php
/**
* 아래는 참고한 자료.
* @link https://stackoverflow.com/questions/24651869/regex-matching-links-without-a-tag/24653720?stw=2#24653720
*/
function make_link_clickable($text)
{
return preg_replace(
'!<a(.|\n)*?</a>(*SKIP)(*F)|' //skip a tag
. '(((f|ht)tp(s)?://)[-a-zA-Zа-яА-Я()0-9@:%_+.~#?&;/=]+)!i',
@akihikodaki
akihikodaki / README.en.md
Last active April 20, 2024 02:43
Linux Desktop on Apple Silicon in Practice

Linux Desktop on Apple Silicon in Practice

I bought M1 MacBook Air. It is the fastest computer I have, and I have been a GNOME/GNU/Linux user for long time. It is obvious conclusion that I need practical Linux desktop environment on Apple Silicon.

Fortunately, Linux already works on Apple Silicon/M1. But how practical is it?

  • Two native ports exist.
@wilsonpage
wilsonpage / swr.ts
Last active April 22, 2024 08:58
An implementation of stale-while-revalidate for Cloudflare Workers
export const CACHE_STALE_AT_HEADER = 'x-edge-cache-stale-at';
export const CACHE_STATUS_HEADER = 'x-edge-cache-status';
export const CACHE_CONTROL_HEADER = 'Cache-Control';
export const CLIENT_CACHE_CONTROL_HEADER = 'x-client-cache-control';
export const ORIGIN_CACHE_CONTROL_HEADER = 'x-edge-origin-cache-control';
enum CacheStatus {
HIT = 'HIT',
MISS = 'MISS',
REVALIDATING = 'REVALIDATING',
#!/bin/bash
###
### my-script — does one thing well
###
### Usage:
### my-script <input> <output>
###
### Options:
### <input> Input file to read.
### <output> Output file to write. Use '-' for stdout.
@s3rj1k
s3rj1k / HowTo
Last active March 6, 2024 12:12
Ubuntu 20.04.3 AutoInstall
# For recent versions of Ubuntu:
- https://www.pugetsystems.com/labs/hpc/ubuntu-22-04-server-autoinstall-iso/
# Docs:
- https://wiki.ubuntu.com/FoundationsTeam/AutomatedServerInstalls
- https://wiki.ubuntu.com/FoundationsTeam/AutomatedServerInstalls/ConfigReference
- https://cloudinit.readthedocs.io/en/latest/topics/datasources/nocloud.html
- https://discourse.ubuntu.com/t/please-test-autoinstalls-for-20-04/15250/53
# Download ISO Installer:
@tomhicks
tomhicks / plink-plonk.js
Last active March 18, 2024 02:23
Listen to your web pages
@ExtremeGTX
ExtremeGTX / Ubuntu_AP.md
Last active April 24, 2024 03:48
Setup Ubuntu server as Access point

Introduction

This tutorial for setting up Ubuntu Server (RPi 3B) as Wifi access point

Overview:

The main steps can be listed as following:

  1. Install required packages
  2. Setup hostapd
  3. Setup DNSmasq
  4. Configure AP IP Address
@channprj
channprj / oldman_shaves_opensource.md
Last active September 19, 2023 10:43
퇴근길에 @lqez 님 트윗을 보고 갑자기 영감을 받아 작성해봤습니다. 이미 유행 한참 지난 밯망희 깎던 노인쓰,,,

바닐라 스크립트로 오픈소스 깎던 노인

벌써 3~4여 년 전이다. 내가 개발자로 취직한 지 얼마 안 되어 테헤란로 쪽에서 일할 때다. 퇴근하며 트위터 타임라인을 훑어보는 와중에, 재미있는 트윗을 발견하여 정독하던 중이었다. 스타벅스 앞을 지날 즈음, 그 곳에는 바닐라 자바스크립트로 오픈소스를 깎던 노인이 있었다. 마침 유용할 것 같은 프로젝트라 오픈소스 패키지로 받아 쓰려고 부탁을 했다. 버전을

"좀 빨리 올려 줄 수 없습니까?"

했더니,

"마이너 버전 릴리즈 하나 가지고 에누리하겠소? 비싸거든 다른 오픈소스 받아서 쓰시우."